Hello, I have a Zwave door sensor - it’s a binary sensor that automatically populates with “on/off” in the frontend. But since it’s connected to a door, I made a template sensor that lets me see its status in the frontend as “Open/Closed” (it’s just friendlier that way…)
But when I check the logbook for activity from this template sensor, the logbook only ever records the “Closed” event, not the “Open” event.
I thought at first it’s because the door never stayed open long enough for the template sensor to register the change. But when I let the door stand open for 5 minutes, it still didn’t record “Open”. So I think perhaps I’ve set up my template sensor wrong?
lr_status_door:
friendly_name: 'Front Door'
value_template: >-
{%- if is_state("binary_sensor.lr_door_sensor", "off") -%}
Closed
{%- else -%}
Open
{%- endif -%}
I also tried
{%- if is_state("binary_sensor.lr_door_sensor", "off") -%}
Closed
{%- elif is_state("binary_sensor.lr_door_sensor", "on") -%}
Open
{%- else -%}
Unknown
{%- endif -%}
Thanks in advance for any help anyone’s able to provide!