Would like to either change the background to red or a text line to red if the value is let’s say greater than 30 mins. Ideally also only display to home if my presence sensor is away and to work if it is set to home.
Is that possible or perhaps is there a custom card in HACS that can do that?
Yes that seems to be case which is fine, I can edit in VS Code but I suppose the above will apply colour to all entities, instead of just sensor.to_work so I’m not sure if you can do it but seems to be possible according to the example page:
that’s essentially saying all the evenly numbered items. So i believe this should work (I’m not great with nth-of-type() crap because I’ve never used it, I’m assuming its an index).
I think I have a better way, I can set up 2 cards one for To Home one for To Work and just one gets displayed based on my smartthings presence sensor (Home/Away values)
I want the color to change from green -> yellow -> red according to the usage of the sensor.
something like if sensor.vacuum_lavagem_filtro > 100 color: green ; if sensor.vacuum_lavagem_filtro <100 and > 50 color: yellow ; if sensor.vacuum_lavagem_filtro < 50 color:red
Just tried it with home and away and the card is basically never being displayed. Even though the sensor only has those two states, is it possible they get called something else in the background? Or is there another attribute other than state that needs to be used?
You need to look at the state in the states page. The display is Home, Away, and zone names in the UI. In the states page, it’s home and not_home. Don’t ever built automations & cards based on states shown in the UI. Those values are translated to the user and change based on langauge settings.
no, if it’s a binary_sensor it’s still ‘on’ and 'off. ‘home’ and ‘not_home’ are for device trackers. As I said before. Check the states page. Here is more proof.