Hey everyone,
I’ve got a Monoprice door sensor switch set up but I’m having some troubles setting up a template to show the status.
It shows up just fine at the top of the main HASS page. It toggles between a values 23 for closed and 22 for open.
The entity_id in the states appears as:
sensor.front_door_sensor_access_control (I renamed it)
customization.yaml:
sensor.front_door_sensor_access_control:
friendly_name: Front Door Sensor
icon: mdi:glassdoor
sensors.yaml:
- platform: template
sensors:
front_door_sensor_access_control:
value_template: '{% if is_state("sensor.front_door_sensor_access_control", "23") %}Closed{% else %}Open{% endif %}'
friendly_name: 'Front Door Status'
For some reason when I use the above template a get a second icon at the top of the home page called “Front Door Status” which always shows as Open and never changes state.
And a second state, sensor.front_door_sensor_access_control_2 with the same entity_id sensor.front_door_sensor_access_control is created that now shows the correct status of the sensor, 22 or 23.
I can’t figure out what I’m doing wrong.
edit: added pics for clarity