Skip to content

Manual Run card not working on sequence #717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xefil opened this issue Apr 10, 2025 · 2 comments
Closed

Manual Run card not working on sequence #717

xefil opened this issue Apr 10, 2025 · 2 comments

Comments

@xefil
Copy link

xefil commented Apr 10, 2025

Hi all,
I've succesfully configured Irrigation unlimited with code below:

irrigation_unlimited:
  controllers:
    all_zones_config:
      show:
        timeline: true
    zones:
      - name: "Retro Nord"
        entity_id: "switch.garden01_4ch_relay_1"
      - name: "Casetta"
        entity_id: "switch.garden01_4ch_relay_2"
      - name: "Camera"
        entity_id: "switch.garden01_4ch_relay_3"
      - name: "Studio"
        entity_id: "switch.garden01_4ch_relay_4"
      - name: "Soggiorno"
        entity_id: "switch.garden02_4ch_relay_1"
      - name: "Siepi"
        entity_id: "switch.garden02_4ch_relay_2"
    sequences:
      - name: "Stagione Estiva"
        delay: "00:01"
        schedules:
          - name: "Sunrise"
            time:
              sun: "sunrise"
              after: "01:00"
            weekday: [mon, wed, fri]
        zones:
          - zone_id: 1
            duration: "00:10"
          - zone_id: 2
            duration: "00:10"
          - zone_id: 3
            duration: "00:10"
          - zone_id: 4
            duration: "00:10"
          - zone_id: 5
            duration: "00:10"
          - zone_id: 6
            duration: "00:12"
      - name: "Manuale"
        delay: "00:01"
        zones:
          - zone_id: 1
            duration: "00:05"
          - zone_id: 2
            duration: "00:05"
          - zone_id: 3
            duration: "00:05"
          - zone_id: 4
            duration: "00:05"
          - zone_id: 5
            duration: "00:05"

The scheduler works well!
Sometimes I need to run the sequence manually, so I'm trying to use the manual card. The manual card works ONLY if I specify a zone or a controller without specify a sequence. But if I select a controller and set sequence to , it starts watering on all zones, which is not what I want. This because the water pressure is to low to start all 6 zones simultaniously. If I select a single zone with sequente , it works, but in this case, I need to do that manually for all 6 zones. I would like to let run all the zones in sequence. Here the error as soon I start selecting controller AND a sequence:

2025-04-10 08:32:46.260 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall irrigation_unlimited.manual_run (c:01JRFD915KM8YE4RED2M6AQTJ8): entity_id=['binary_sensor.irrigation_unlimited_c1_m'], time=0:04:00, sequence_id=['2']>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/core.py", line 2814, in _run_service_call_catch_exceptions
    await coro_or_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 2837, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
        hass, entity, func, data, call.context
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/irrigation_unlimited/service.py", line 56, in async_entity_service_handler
    entity.dispatch(call.service, call)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/irrigation_unlimited/entity.py", line 300, in dispatch
    self._coordinator.service_call(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        service, self._controller, self._zone, self._sequence, call.data
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 6660, in service_call
    controller.service_manual_run(data1, stime)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 5008, in service_manual_run
    sequence_list = self.decode_sequence_id(stime, data.get(CONF_SEQUENCE_ID))
  File "/config/custom_components/irrigation_unlimited/irrigation_unlimited.py", line 4922, in decode_sequence_id
    if self.get_sequence(sequence_id - 1) is not None:
                         ~~~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for -: 'str' and 'int'
2025-04-10 08:32:48.542 INFO (MainThread) [custom_components.irrigation_unlimited] CALL [2025-04-10 10:32:48] service: cancel, controller: 1, zone: 1, sequence: 0, data: {"entity_id": ["binary_sensor.irrigation_unlimited_c1_z1"]}

What's wrong?

Thanks,
Simon

@craigbarratt
Copy link
Member

I'm not sure this is related to pyscript. Are you using pyscript, and, if so, what is the specific issue you are reporting?

@xefil
Copy link
Author

xefil commented Apr 13, 2025

You,re right, I think it's related to HA or Irrigation Unlimited.
Thanks!
Simon

@xefil xefil closed this as completed Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants