2022.2.0 Door chime automation

I have a door chime which I have ring whenever a door is opened or closed. This has been working well but after the new update it also fires upon restart. This is a minor annoyance to me and a source of mystery to my dog. I assume this is related to the new unknown state on binary sensors. I’m aware I could split the triggers, one for ‘on’ and the other for ‘off’, but this seems like adding complexity. Is there some other method to silence the restart?

alias: Door Chime
description: ''
trigger:
  - platform: state
    entity_id:
      - binary_sensor.konnected_198e05_zone_4
      - binary_sensor.konnected_198e05_zone_5
      - binary_sensor.front_door_contact
      - binary_sensor.basement_entry_contact
      - binary_sensor.mailbox_contact
      - binary_sensor.garage_door_left_contact
      - binary_sensor.garage_door_right_contact
    to: null
condition: []
action:
  - service: switch.turn_on
    target:
      entity_id: switch.piezo
    data: {}
mode: single

Why the trigger is set to state null?

This was to ensure update to the attributes didn’t trigger the chime. It doesn’t make any difference for these binary sensors.

I agree.

Your State Trigger is configured to listen for any state-change so that means from some previous state to on/off/unknown/unavailable. As of 2022.2 your binary_sensors no longer default to off on startup but are unknown. Changing from unknown to off (or on/unavailable) is a state-change that is detected by your State Trigger.

If you want it to trigger for only certain state-changes, you’ll need to specify them.

  - platform: state
    entity_id:
      - binary_sensor.konnected_198e05_zone_4
      - binary_sensor.konnected_198e05_zone_5
      - binary_sensor.front_door_contact
      - binary_sensor.basement_entry_contact
      - binary_sensor.mailbox_contact
      - binary_sensor.garage_door_left_contact
      - binary_sensor.garage_door_right_contact
    from:
      - 'on'
      - 'off'
    to:
      - 'on'
      - 'off'

Thank you - I didn’t know I could specify a list in the to/from.