Template Binary Sensors after HA restart

just to be sure, I mentioned the thread and credited it didn’t I? Didn’t want to take the honors myself at all.

Yes you did, don’t worry, @petro’s name is there :wink:

@pnbruckner, @anon43302295,

I take it back.

I think the ONLY way to achieve what I need is to have automations set to initial: off and then implement some kind of delayed startup.

It’s not the automation having a

    trigger:
      platform: homeassistant
      event: start

that’s a problem.

It’s all the other triggers that are not being evaluated correctly.

I’m going to have to change all my automations. Thanks Marc (that is both genuine and sarcastic :sunglasses:).
And get in the habit from now on to include initial: off in any new automations.

1 Like

To avoid binary sensors firing at startup, you can make your automations follow an inverted binary sensor:

- platform: template
  sensors:
    contact_inverted:
      value_template: >-
         {{ is_state('binary_sensor.contact', 'off') }}
      device_class: door

Idea comes from ☔ DIY Zigbee rain gauge - #96 by oet