Hey all been working on updating my front end, i have a page that i am using for simple push button home control page. I was trying to use entity-button to control my garage door, I am trying to figure out how i could change the icon based on a binary-sensor status. I know i can do this seperate from the button but i would like to see if i could put all the info on the button itself.
I have tired a couple different ways of doing it none seem to be working. Below is my latest iteration of what i have tried.
Expected a value of type `undefined` for `icon_template` but received `"{% if is_state('sun.sun', 'above_horizon') %}\n mdi:weather-sunny\n{% else %}\n mdi:weather-night\n{% endif %}"`.
Setting that will automatically switch your icon without a template to the exact icons that you want. All of that is discussed in the documentation for binary_sensors.
Perfect i got the sensor working properly. Thank you. I know i could do a frame with the sensor and button. Do you know if it is possible to incorporate the two so that the icon of the button directly reflects the sensor?
It should be doing it. You might need to CTRL+F5 your browser to refresh the cache. If it doesn’t, you could always incorporate the custom:button-card from the home assistant community store (HACS).
I just fond my problem i think, i think it is the programing i have on the switch that is overriding the icon to gate… I will have to take it down and reflash it. bah.