Checking whether an automation is enabled/disabled in another automation

Hi, I am trying to check the state of an automation to see if it is enabled or disabled. The condition works fine to determine that the automation is currently disabled. However, its not working when trying to check if it is enabled.

The logic for the disabled state that works is:

condition: state
entity_id: automation.holiday_lights_on
attribute: current
state: 0

However, the one to detect the automation being enabled never gets triggered;

condition: state
entity_id: automation.holiday_lights_on
attribute: current
state: 1

Are the two possible states 1 and 0. When trying to get the values from the template debugger it returns ‘on’ and ‘off’. I have tried these in the conditions above but neither of them then work.

{{ states( ‘automation.holiday_lights_on’, ‘current’ ) }}

Any help would be appreciated.

Thanks

Steve

An automation’s current attribute doesn’t indicate if the automation is enabled/disabled. It indicates if the automation is currently executing its actions (i.e. it’s running). A value of 1 means one instance of the automation is currently busy executing its actions.

The automation’s state value indicates if the automation is enabled (on) or disabled (off).

Ah, thank you for your reply. That makes sense as to why it was never changing. Got it working now by just checking automation.holiday_lights-on without the attribute and checking for on and off.

Cheers

Steve

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

Done. Thanks again.

1 Like