Trigger does not seem to return true

Hi,

I created an automation to start my robot vacuum when it has the state “Charging” for 5 min and the battery is more than 60% (which is stored in an input number helper).

Even though both triggers are true, the automation does not continue with the next action and seems to be waiting for something.

See screenshots:

Already lowered the time to 5 seconds, easier for testing :wink:

Also used a fixed number in stead of the helper, no difference.

Disabled the triggers one by one to hopefully find out which one causes the issue and it happens with either trigger enabled. But when I disable both, the automation continues.

Not sure what is happening here.

Are triggers only evaluated once in a set time?

Triggers are not things that are evaluated and can be true or false; they are things that happen at an instant in time. Conditions, on the other hand, are things that are evaluated and can be true or false.

This is a common source of confusion. To give you a metaphor from the real world, imagine a home security system. A trigger might be the chime sounding that alerts you that the front door was just opened. A condition might be looking at the control panel and seeing if it says the door is currently open.

In the case of the first trigger, it is probably already in charging state when it reaches this action, so this trigger will never fire. In the case of your second trigger, you would need to reference the helper in a template, not just as the name. When you changed it to a fix value, I would suspect it was the same problem as the first one (it already being above the value when the wait_for_trigger action is reached, so it would never trigger.

Additionally, the wait_for_trigger action will pause until any of the triggers fire, so this would not give you the result you were looking for.

To get a good suggestion, please post your entire automation (formatted correctly; not a screenshot). I think most likely you should create a separate automation where these two items are the triggers and you also have similar statements as conditions (so that the automation runs when either of the triggers fires and the other condition is already true).

That is absolutely the case. Both trigger-values were already “reached” before the automation ran.

An automation that sets a boolean to true (and the main automation checks for that boolean) would be an option. But I think the issue will then be that if the main automations runs and the boolean switches are not yet true, it wouldn’t trigger. And I would like it to trigger and wait for the boolean to become true. The automation below will make my intentions clear :wink: I hope.

Below the complete automation. It has 4 options, with different conditions and actions. I was now testing option 3, but if it works for that one, it will work for all options.

alias: Roborock Dagelijkse Taak
description: ""
triggers:
  - trigger: time
    at: input_datetime.helper_roborock_start_tijd
conditions:
  - condition: state
    entity_id: input_select.status_huis
    state: Thuis
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.schoonmaak
            state: "on"
          - condition: time
            weekday:
              - fri
        sequence: []
      - conditions:
          - condition: state
            entity_id: input_boolean.schoonmaak
            state: "off"
          - condition: time
            weekday:
              - fri
        sequence:
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_status
                for:
                  hours: 0
                  minutes: 5
                  seconds: 0
                to: charging
                enabled: true
              - trigger: numeric_state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_battery
                above: input_number.helper_roborock_battery_zuigen_limiet
          - action: button.press
            metadata: {}
            data: {}
            target:
              entity_id: button.roborock_s8_pro_ultra_full_cleaning
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_status
                for:
                  hours: 0
                  minutes: 5
                  seconds: 0
                to: charging
                enabled: true
              - trigger: numeric_state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_battery
                above: input_number.helper_roborock_battery_dweilen_limiet
          - action: button.press
            metadata: {}
            data: {}
            target:
              entity_id: button.roborock_s8_pro_ultra_dweilen
      - conditions:
          - condition: time
            weekday:
              - tue
              - thu
        sequence:
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_status
                for:
                  hours: 0
                  minutes: 5
                  seconds: 0
                to: charging
              - trigger: numeric_state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_battery
                above: input_number.helper_roborock_battery_zuigen_limiet
          - action: button.press
            metadata: {}
            data: {}
            target:
              entity_id: button.roborock_s8_pro_ultra_full_cleaning
      - conditions:
          - condition: time
            weekday:
              - mon
              - wed
        sequence:
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_status
                for:
                  hours: 0
                  minutes: 5
                  seconds: 0
                to: charging
                enabled: true
              - trigger: numeric_state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_battery
                above: input_number.helper_roborock_battery_zuigen_limiet
          - action: button.press
            metadata: {}
            data: {}
            target:
              entity_id: button.roborock_s8_pro_ultra_full_cleaning
          - wait_for_trigger:
              - trigger: state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_status
                for:
                  hours: 0
                  minutes: 5
                  seconds: 0
                to: charging
                enabled: true
              - trigger: numeric_state
                entity_id:
                  - sensor.roborock_s8_pro_ultra_battery
                above: input_number.helper_roborock_battery_dweilen_limiet
          - action: button.press
            metadata: {}
            data: {}
            target:
              entity_id: button.roborock_s8_pro_ultra_dweilen
mode: queued
max: 10