Struggling with multiple triggers

Trying to start when both conditions met … don’t really understand why not waiting for second trigger . Appears to test once then stop on 2nd trigger … advise appreciated

alias: ASHP House Heat Solar When Away
description:

```alias: ASHP House Heat Solar When Away
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.victron_battery_soc
    for:
      hours: 0
      minutes: 30
      seconds: 0
    above: 98
condition: []
action:
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.victron_grid_power
        for:
          hours: 0
          minutes: 5
          seconds: 0
        below: -1500
    continue_on_timeout: false
    timeout:
      hours: 5
      minutes: 0
      seconds: 0
      milliseconds: 0
  - service: climate.set_temperature
    data:
      temperature: 22
      hvac_mode: heat
    target:
      device_id: 90df94b41e9434375ab46ed84ab167c9
  - service: notify.mobile_app_peter_s22_ultra
    data:
      message: ASHP Heat Solar On
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.victron_battery_power_victron
        for:
          hours: 0
          minutes: 5
          seconds: 0
        below: -250
    continue_on_timeout: false
  - service: climate.set_temperature
    data:
      temperature: 19
      hvac_mode: "off"
    target:
      device_id: 90df94b41e9434375ab46ed84ab167c9
  - service: notify.mobile_app_peter_s22_ultra
    data:
      message: ASHP Heat Solar Off
mode: single

type or paste code here

I think you need to have two triggers in your trigger section: one for each of your ‘conditions’. That way your automation will be triggered by either of your ‘conditions’ occurring.

Then, I think you need to have both your ‘conditions’ in the conditions section. That way your automation will only perform any action if both the conditions are satisfied.

Thank you … Did try that but seems to run once then gets stuck

Could you provide the yaml you had for that? If you do, could you use the code formatting option in your message.

Your automation’s wait_for_trigger has a timeout of 5 hours. If Home Assistant is restarted while it’s waiting during the 5-hour period, or if you execute Reload Automations, the wait_for_trigger is terminated.

If you use the Automation Editor, a Reload Automations is executed the moment you click the Save button. Any automations that are “in-progress” (such as waiting for a wait_for_trigger) are terminated.

Any better code paste (sorry new here)

Ty but don’t believe I edited whilst waiting to run … 5 HR timeout is just to ensure battery does not discharge fully if battery - does not trigger

Edited many thanks

I wonder if this may do what you want:

alias: ASHP House Heat Solar When Away
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.victron_battery_soc
    for:
      hours: 0
      minutes: 30
      seconds: 0
    above: 98
    id: Victron Battery SOC
  - platform: numeric_state
    entity_id: sensor.victron_grid_power
    for:
      hours: 0
      minutes: 5
      seconds: 0
    below: -1500
    id: Vicreon Grid below -1500
  - platform: numeric_state
    entity_id: sensor.victron_battery_power_victron
    for:
      hours: 0
      minutes: 5
      seconds: 0
    id: Victron Battery Power below -250
condition: []
action:
  - choose:
      - conditions:
          - condition: numeric_state
            entity_id: sensor.victron_battery_soc
            above: 98
          - condition: numeric_state
            entity_id: sensor.victron_grid_power
            below: -1500
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 22
              hvac_mode: heat
            target:
              device_id: 90df94b41e9434375ab46ed84ab167c9
          - service: notify.mobile_app_peter_s22_ultra
            data:
              message: ASHP Heat Solar On
      - conditions:
          - condition: trigger
            id: Victron Battery Power below -250
        sequence:
          - service: climate.set_temperature
            data:
              temperature: 19
              hvac_mode: "off"
            target:
              device_id: 90df94b41e9434375ab46ed84ab167c9
          - service: notify.mobile_app_peter_s22_ultra
            data:
              message: ASHP Heat Solar Off
mode: single

Have you checked the automation’s trace to see how it handles the wait_for_trigger?

1 Like

Seems to check … get a false result and not proceed when true … not sure how to make 8t recheck … sooty quite new to HA