hey
I have an AQARA FP1 presence sensor, since it has many states I created a template sensor to know if there is presence or no presence and I also added to this sensor an icon for the present state and an icon for the non-present state, is it possible for me to make the present icon yellow?
I am attaching an example of some devices where this happens automatically
Change from a template sensor to template binary sensor. Leave out the icon template alltogether and just set the device class to presence. The functionality you need is all already built in.
No, I dont using chatgpt , but I just dont understand how to Change from a template sensor to template binary sensor.
here is not exist: Sensor - Home Assistant
Motion sensors are binary – by definition – and the device class I suggested exists, but only for binary sensors. In HA world, a motion sensor is binary: movement, or no movement. You can’t achieve the same with a normal sensor. You can’t force a sensor to be a binary sensor, but you can wrap your Aqara to get it into a binary state. I don’t own any Aqara products, so I can’t help with the logic unless you state what those states could be, but I’ll just use what you tried.
It shouldn’t be necessary, if your HA is set to use Hebrew as language (not sure if Hebrew is supported natively, but it doesn’t look like it).
Internal state shouldn’t be confused with how it’s presented on a UI, but that’s only a valid point if your language is supported.
To use English as an example. A binary sensor, internally, is true/false or on/off – regardless of the user’s language. HA will display this as detected/clear, and so forth for every language by mapping the internal state accordingly.
So, in your case, if you want to display the translated values, you’ll need to make your two-state “plain sensor” as you had initially and do as Ildar suggested: You’ll need to colour your icon with some UI trickery like using card-mod. There are many examples of that on the card-mod thread.