Automation keeps triggering?

Hey all,

Home Assistant 0.113.3

I have this automation but every few moments, i keep getting a message on my Ios app, to

“Dishwasher has changed from Off to Off”

Any thoughts where i have gone wrong? why would the same state do this?
AS per the image, the state has not changed for hours now

############################################
########### Dishwasher Notification  ###########
############################################

- alias: dishwasher_notification
  id: dishwashernotification
  trigger:
    platform: state
    entity_id: sensor.dishwasher_g7310_status
  action:
    service: notify.notify
    data_template:
      message: Dishwasher just changed from {{ trigger.from_state.state }} to
        {{ trigger.to_state.state }}

Because you have included no to or from state in the trigger it will trigger on any change. Including changes to the attributes.

To avoid this add a template condition to ensure the trigger_to_state is not equal to the trigger_from_state.

thanks will try this then

- alias: dishwasher_notification
  id: dishwashernotification
  trigger:
    platform: state
    entity_id: sensor.dishwasher_g7310_status
  condition:
    condition: template
    value_template: >
      {{ trigger.to_state.state != trigger.from_state.state }}
  action:
    service: notify.notify
    data_template:
      message: Dishwasher just changed from {{ trigger.from_state.state }} to
        {{ trigger.to_state.state }}
1 Like