#Automation state trigger for attribute change

1 messages · Page 1 of 1 (latest)

languid lantern
#

I am trying to setup an automation trigger for changing the mode on a thermostat (any time the mode changes, whether it's through a dashboard, automation, or someone touching the thermostat). I know I can use a state trigger to trigger any time anything changes, or a to/from parameter to specify values, but how do I set it up to change when a specific attribute (in this case hvac_action ) changes from anything to anything different?

languid lantern
#

The problem is that hvac_action defines what the current status of the hvac system. So I can set it to cool but over the course of a few hours, it will change back and fourth from cooling to idle. What can I do to trigger the automation only when the mode is changed?

tame lily
#

the state of climate entities is the current mode (cool, heat, heat_cool, etc) so you could actually just trigger on state changes in this case

#

the hvac_action attribute is what the climate entity is currently doing (cooling, heating, etc.)

#

so you could do

- trigger: state
  entity_id: climate.whatever
  to:
  - 'heat'
  - 'cool'
  - 'off'
``` and specify any other states you want to trigger on