I am trying to create a display for the door sensors on all doors. Currently the sensor is displaying the value 22 and 23 (for open and close). What I wanted to know is, can I change this so that I can either see open or close. Ideally I would like to see a toggle button which is highlighted if door is closed and not if door is open. Can I achieve this?
Here is the code that I used in the Yaml file.
group:
default_view:
view: yes
entities:
- group.front_main_door
front_main_door:
name: All Doors
view: no
entities:
- sensor.ecolink_unknown_type0004_id0002_access_control_3_9
front door1:
name: FrontDoorOther
view: no
entities:
- binary_sensor.ecolink_unknown_type0004_id0002_sensor_3_0
- sensor.ecolink_unknown_type0004_id0002_alarm_level_3_1
- sensor.ecolink_unknown_type0004_id0002_burglar_3_10
- sensor.ecolink_unknown_type0004_id0002_power_management_3_11
- sensor.ecolink_unknown_type0004_id0002_sourcenodeid_3_2
- sensor.ecolink_unknown_type0004_id0002_access_control_3_9
- sensor.ecolink_unknown_type0004_id0002_alarm_type_3_0
I’ve tried modifying the template provided on the template documentation and applying it in http://[my IP]:8123/developer-tools/template and, while the sample output window on the right appears correct (new values correspond to old state values) the states are not updating accordingly in the Lovelace UI. Is there another step that needs to happen to get the changes to reflect there?
You can make a template sensor to display open/closed so you can display as you wish in lovelace. You can also use the sensor in automations but that seems silly.
#Make the sensor show Closed or Open
sensor:
- platform: template
sensors:
mydoor_sensor:
friendly_name: "1 Door Open-Closed"
unique_id: "single_garage_door_open_closed_sensor"
value_template: >-
{% if is_state('binary_sensor.door1', 'off') %}
closed
{% elif is_state('binary_sensor.door1', 'on') %}
open
{% endif %}
edit: -I cut out of my sensor.yaml file and didn’t add in the ‘sensor:’ to start