using this simplest of automations:
- alias: Daylight sets outside motion sensors
id: Daylight sets outside motion sensors
trigger:
platform: state
entity_id: binary_sensor.outside_daylight_sensor
action:
service: >
homeassistant.turn_{{'off' if trigger.to_state.state == 'on' else 'on'}}
entity_id: group.philips_buiten_motion_sensor_switches
never was an issue. until the reload template entities came along (which in itself is a great tool)
the binary_sensor is based on another entity, hue_daylight sensor, which is taken of the Hue hub even before the template entities are initialized in startup, so no issue whatsoever there.
binary_sensor:
platform: template
sensors:
outside_daylight_sensor:
friendly_name: Outside daylight sensor
device_class: light
value_template: >
{{is_state('sensor.hue_daylight','on')}}
Upon reload, all my outside motion sensors keep getting switched onâŚ
I can probably add a few guards in this automation, or template binary_sensor, but this borders the ridiculous imho. We are now forced to create a full set of guards on these binary sensors (my quake, and battery alerts go awol tooâŚ)
Seems a rather undesired side-effect of a nice addition to the toolbox. What to do here, issue a bug, or rebuild all binary template sensors?
btw, before you suggest: Iâve already tried the availability sensor but this seems futile, since the base sensor is always there. its simply the fact the template binary_sensors are re-created upon reload.
for this particular automation, I can rewrite to
- alias: Daylight sets outside motion sensors
id: Daylight sets outside motion sensors
trigger:
platform: state
entity_id: sensor.hue_daylight
action:
service: >
homeassistant.turn_{{'off' if trigger.to_state.state == 'on' else 'on'}}
entity_id: group.philips_buiten_motion_sensor_switches
but that of course doesnt take away from the issue. Especially since the binary_sensors are extremely useful and âmadeâ for this purpose, checking âonâ/âoffâ