I’m not sure if it changes the underlying state on Hass, it might just change the state that the JavaScript sees. So maybe just client side state is overridden which would affect all JavaScript templates (and possibly other frontend logic) but not Hass itself.
not exactly on topic here, but I noticed that you have lock icons on some switches in your screenshots. What are they for? I have been looking for a way to NOT accidentally press a switch in Home Assistant, is that what they represent?
And thanks for the solution to the state-dependent sensor icon change, that’s also very useful!
indeed, that s what they are for, at least in my setup.
You can do that without the lock, but the delay is still there, so I find that bit counter intuitively. The lock makes it clear (as is shown by your guess… )
@andrey has made them available even on the light sliders, which is of extreme good use on a handheld device. Before one couldn’t slide the page without switching the lights, now thats no issue whatsoever anymore.
Does anyone know if it’s possible to change icon_color based on attribute instead of state? (maybe @Mariusthvdb you can help/add an example of this to your amazing examples file?)
Like…
climate.livingroom:
templates:
icon_color: if (state.attr('this.entity','hvac_mode') == 'cooling') return '#25FE5C';
I feel like the above should be possible but it’s not working, so I thought it might be my syntax