#Why this automation triggers on homeassistant.start event?

1 messages ยท Page 1 of 1 (latest)

prime gazelle
#
alias: Kitchen Water Leak Warning
description: Sets led strips until water leak sensor is not dry
triggers:
  - entity_id:
      - binary_sensor.kitchen_water_leak
    to: "on"
    id: wet
    trigger: state
  - entity_id:
      - binary_sensor.kitchen_water_leak
    to: "off"
    id: dry
    trigger: state

I have these two triggers, and for some reason this autoamtion is being executed each time when I restart HomeAssistant. Why?

chrome parcel
#

What does the trace show?

open belfry
#

it's likely that your previous state is unavailable or unknown or something. you can add a condition to prevent the automation if the old state is either of those. As Tinkerer suggested, you should check the trace to see if that is indeed the case

prime gazelle
#

well as far I can tell the state is 'off'

chrome parcel
#

Check the changed variables tab ๐Ÿ˜‰

prime gazelle
#

I think when I do restart, that on startup HA picks up from MQTT states?

chrome parcel
#

Images of text are horrible, but look at the from state

prime gazelle
chrome parcel
prime gazelle
#

so I believe that it;s enough to put some condition where != unknown ?

chrome parcel
#

not_from exists in the state trigger ๐Ÿ˜‰

prime gazelle
#

ok let me check ๐Ÿ™‚