Wax motor (thermal actuator) state change delay

Hi, i have NO (normally open) actuators at energized state (closed) by default, with heating automation, and i would start the heating pump delayed after climate-thermostat triggers would switch the pump on. (wax motor needs some minutes to open/close). In the other hand, i would stop pump for a few minutes as well, if any of the wax motors energized -there may be a situation of 1 wax deenergized and other 1 energized only and because of slow state change, all of them blocks flow for a while.

(heating_pump_start is just commented out cos of error message: pump already running; heating_pump_stop runs ok)
How can i get rid of that error, is there a way to make the code more simple?

Thanks!

Here is my code:

- id: heating_pump_stop
  alias: 'Heating Pump Stop'
  trigger:
    - platform: state
      entity_id: switch.nappali_perem
      from: 'on'
      to: 'off'
    - platform: state
      entity_id: switch.nappali_belso
      from: 'on'
      to: 'off'
    - platform: state
      entity_id: switch.eloszoba_furdo
      from: 'on'
      to: 'off'
    - platform: state
      entity_id: switch.halo_belso
      from: 'on'
      to: 'off'
    - platform: state
      entity_id: switch.halo_perem
      from: 'on'
      to: 'off'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: switch.nappali_perem
        state: 'off'
      - condition: state
        entity_id: switch.nappali_belso
        state: 'off'
      - condition: state
        entity_id: switch.eloszoba_furdo
        state: 'off'
      - condition: state
        entity_id: switch.halo_belso
        state: 'off'
      - condition: state
        entity_id: switch.halo_perem
        state: 'off'
      - condition: state
        entity_id: switch.main_pump
        state: 'on'
  action:
    - service: switch.turn_off
      entity_id: switch.main_pump
 
# - id: heating_pump_start
#   alias: 'Heating Pump Start'
#   trigger:
#     - platform: state
#       entity_id: switch.nappali_perem
#       from: 'off'
#       to: 'on'
#     - platform: state
#       entity_id: switch.nappali_belso
#       from: 'off'
#       to: 'on'
#     - platform: state
#       entity_id: switch.eloszoba_furdo
#       from: 'off'
#       to: 'on'
#     - platform: state
#       entity_id: switch.halo_belso
#       from: 'off'
#       to: 'on'
#     - platform: state
#       entity_id: switch.halo_perem
#       from: 'off'
#       to: 'on'
#   condition:
#     condition: or
#     conditions:
#       - condition: state
#         entity_id: switch.nappali_perem
#         state: 'on'
#       - condition: state
#         entity_id: switch.nappali_belso
#         state: 'on'
#       - condition: state
#         entity_id: switch.eloszoba_furdo
#         state: 'on'
#       - condition: state
#         entity_id: switch.halo_belso
#         state: 'on'
#       - condition: state
#         entity_id: switch.halo_perem
#         state: 'on'
#   action:
#     - service: timer.start
#       entity_id: timer.timer_pump
#     - service: switch.turn_off
#       entity_id: switch.main_pump
# - alias: delay pump start til actuator opens (timer parameter in main configuration file)
#   trigger:
#     - platform: event
#       event_type: timer.finished
#       event_data:
#         entity_id: timer.timer_pump
#   action:
#     service: switch.turn_on
#     entity_id: switch.main_pump

I think you’re overcomplicating this.

You can create a group for all the switches. This group will turn ‘on’ automatically when 1 of the group is turned ‘on’
see: Home Assistant Group

Then create an automation that uses the group state as a trigger.
The example below works as follows:

  • Trigger: any state change for group.heating_valves
  • Action: choose
    • if group.heating_valves ‘on’ for 1 minute and main pump is ‘off’ → turn on main pump
    • if group.heating_valves ‘off’ and main pump is ‘on’ → turn off main pump
- id: heating_pump_control
  alias: 'Heating Pump Control'
  trigger:
    - platform: state
      entity_id: group.heating_valves
      
  condition: []
  action:
  - choose:
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: group.heating_valves
                state: 'on'
                for:
                  hours: 0
                  minutes: 1
                  seconds: 0
              - condition: state
                entity_id: switch.main_pump
                state: 'off'
        sequence:
          - service: switch.turn_on
            data: {}
            target:
              entity_id: switch.main_pump
      
      - conditions:
          - condition: and
            conditions:
              - condition: state
                entity_id: group.heating_valves
                state: 'off'
              - condition: state
                entity_id: switch.main_pump
                state: 'on'
        sequence:
          - service: switch.turn_off
            data: {}
            target:
              entity_id: switch.main_pump