I have a door sensor which records its value as on or off, which is not good for a door status:
The code I am using is
’
- entity: sensor.living_room_occupancy
type: custom:multiple-entity-row
name: Living Room Occupancy
icon: false
secondary_info: last-changed
icon: none
- entity: binary_sensor.0x00158d00041d4a8f_contact
type: custom:multiple-entity-row
name: Living Room Patio Door
icon: false
secondary_info: last-changed
icon: none
’
Home Assistant displays it beautifully as open and closed:
What I would like to do is change the word “On” to “Closed” and “Off” to “Open”, can I do that in Lovelace entity card?
Try adding a “device_class: door” to your binary_sensor. Btw standard definition for the binary_sensor device_class door is ‘on’ is ‘open’. If that doesn’t work you can always create a template sensor to convert the state from on/off to open/close and then use it in place of the original binary_sensor in the ui.