I have different binary_sensor which based on rf state ,
the problem is after HA restart - all of them become unavilable and it messed up some of the automations ,
example:
binary_sensor:
- platform: mqtt
name: 'office pir'
state_topic: 'home/office_pir'
off_delay: 5
device_class: motion
To overcome that i added automation which call below script it at startup:
reset_pir:
alias: reset pir
sequence:
- service: mqtt.publish
data:
topic: home/office_pir
payload: 'OFF'
mode: single
it does working but- I have ~15 binary_sensors and it will become quite ugly to reset all of them.
1.Is there a better way to do handle it?
2.little more tricky but is there an way to mqtt.publish for all topics which name as “home/*_pir”?