I’m fairly new to home assistant and am trying to get some basic customization of an entity icon. I am trying to get the icon to toggle between “mdi:door” and “mdi:door-open” based on the sensor state. The sensor is zwave and I set it up via the UI, so the actual config is buried in home-assistant’s self-made db somewhere.
The relevant (I think) config files are:
configuration.yaml:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# everything above here I believe came out of the box with the homeassistant install
homeassistant:
legacy_templates: false
customize: !include customize.yaml
customize.yaml:
# imported in configuration.yaml under 'homeassistant->customize'
binary_sensor.ecolink_door_window_sensor_sensor_3:
templates:
icon: >
if (state === 'on') return 'mdi:door-open';
return 'mdi:door';
I suspect there is something obvious I am missing. Any help would be appreciated.
I took a different approach by changing the lovelace dashboard config and using state_filter on badges, rather than trying to customize the entity itself, it works without installing any UI extensions:
Decided to take the plunge on Custom UI and get rid of my hacky solution. It worked great! The only stumbling block I had is that I didn’t immediately understand that /root/config/www in the homeassistant containers is where files need to go to be seen at /local by the web frontend.