The Template Binary Sensor’s template is evaluated when binary_sensor.smoke_1
changes state. Until that happens, the Template Binary Sensor’s initial value is unknown
.
For your application, the binary_sensor is a smoke detector so its state rarely ever changes (hopefully never, otherwise it has detected smoke). However, that makes it an entity that’s a bit too inert/quiet for use in a Template Binary Sensor.
I suggest creating a Trigger-based Template Binary Sensor with a State Trigger, to monitor the smoke detector, and an Event Trigger, to detect when Template entities are reloaded.
template:
- trigger:
- platform: state
entity_id: binary_sensor.smoke_1
- platform: event
event_type: event_template_reloaded
binary_sensor:
- name: fumee_rdc
device_class: smoke
state: "{{ is_state('binary_sensor.smoke_1', 'on') }}"
After you create it, execute Developer Tools > YAML> Reload Template Entities. Its initial value should now be the same as binary_sensor.smoke_1
.