I also realized I wrote the “=<” & “=>” reversed in my previous post above. It’s correct here.
and if there is a possibility of some other returned value other than hours & minutes then you could add a catchall to the end that will give a default color to handle that situation. If you don’t it will give errors in the log but I don’t think it will break anything tho. But here is that:
Sorry, I never looked at the context in which you were wanting to do what you asked. I just concentrated on the templating part and I just assumed that you had the basic functionality all worked out.
As far as I know, you can’t change the icon color in HA without installing a custom-ui.
You can do it using this custom-ui:
and here are the two sections you’ll need to do it:
and since I know almost nothing about javascript templates I don’t think I can help any further with this. If I have the time I can try to dig into it and see if I can figure out the template you’ll need but I can’t guarantee any results
And lastly, you need to make sure that you properly format your code when posting snippets to the forum.
Seems like I need to separate then things, feels like scripting is not allowed in customizing area?
I got the custom hi installed but it’s still not working.
What if I try in the sensor section? How to template a sensor with a substraction of 2 times?
Eg 23:00 - 22:50 equals 10 as integer?
I could then try using the “10” in the customizing condition section.