Automation condition being ignored

Hi,
I’m in the process of moving to HA from Domoticz and I’m struggling with some automations.

I’ve setup (using the GUI) an automation that should:

  1. Detect state change on burglar alarm from set>unset
  2. If helper boolean switch = off (ie it’s winter time)
  3. Send message to Evohome to set heating on

But no matter the state of the boolean switch it sends the message to Evohome.

This is the setup in automations.yaml

  alias: Alarm - Unset Heating
  description: ''
  trigger:
  - type: not_locked
    platform: device
    device_id: dd71327f686zzzzzz68265b1573
    entity_id: binary_sensor.alarm_sensor_2_any_3
    domain: binary_sensor
  condition:
  - condition: state
    entity_id: input_boolean.heating_summer_mode_on_summer
    attribute: editable
    state: 'Off'
  action:
  - service: evohome.set_system_mode
    data:
      mode: Auto
  mode: single

I’m sure this is a dumb new user error… any ideas?
Thx

state: 'off'

States are case sensitive. Look in developer Tools → States for the real state. The dashboard translates states to make them look pretty.

The September release has big improvements in this area.

2 Likes

Try using the debug/tracing functionality in HA for the automation, you can see each decision HA takes when evaluating the conditions in an automation. This should tell you what is going on.

Screenshot 2022-08-26 at 12.56.53

2 Likes

Thank you both, good point re the case.
My boolean switch is now state =on.

However it still activated, the traced showed:

image
Any idea why?
Thanks

I think I found out why… I was testing the automation using ‘Run Actions’, I assumed that would run the automation from the start, but all it seems to do is run the output.

I manually tested it using the alarm and all worked well!
It’s a shame I can’t test the system another way though

thx

The button is named ‘Run Actions’. It only runs the actions. This is also explained in the documentation: Testing your automation.

You can manually trigger the automation using the automation.trigger service. It doesn’t execute any of the automation triggers but it can optionally execute the condition.

Go to Developer Tools > Services, select your automation and then turn off ‘Skip Conditions’. When you click the Call Service button it will execute the automation’s condition and action.

Be advised that if you create an automation that references the trigger variable in the condition or action then you cannot test it with ‘Run Actions’ or automation.trigger (also explained in the documentation).

Another way to test the automation is to force the trigger. For example, your automation uses a Device Trigger that monitors the state of binary_sensor.alarm_sensor_2_any_3. You can go to Developer Tools > States, select binary_sensor.alarm_sensor_2_any_3 and force its state to a different value (‘off’).

In the following example, the state of binary_sensor.garage is currently on. I can set its state to off by typing off in the State field and then clicking the Set State button. That is sufficient to trigger an automation that’s monitoring the state of binary_sensor.garage.

3 Likes

Thank you! This helps massively