I would also appreciate the ability to use custom device classes like this. I’ve got some binary sensors that don’t fit into the “normal” categories. Some are alarms, some are status (like steam pressure OK vs LOW), and some are RUNNING vs FAULT. Tom has presented a good idea that I could use as-is.
I was only really looking for a way to customise the mdi icons for the binary sensor motion device class.
I find the current ones (person and beacony thing with and without a slash) to be busy and not readily discernable.
But it appears this customisation connot be done.
I can customise the device class of all my sensors by a glob match… to, say “movement” but then the text isnt quite right.
I can also do customisation at UI level but its then a per-entity type thing and a lot of work/maintenance.
Toms proposed approach is much more generalised… I think it’s a good idea.
This is a great idea. I was actually searching to see if someone had suggested an active/inactive device_class (of which I would have 3-4 already), but making device_class completely customizable is probably the best option.
Hard to believe this is still not implemented. It’s such a no-brainer. The hard coded device classes are really limiting, considering the amount of novel smart devices entering the market and all the DIY devices around.
so we can set an on/off icon on any entity, and not only a generic icon and not specifically requiring a device_class at all.
Tbh, its a bit if a mystery the current HA frontend lacks that rather basic functionality in UX and feedback.
(just so you are aware: all of these options/wishes on states used for the icon selecting mentioned above are available with custom-ui, but I dont want to advertise that anymore…)
I think an easier starting point is simply if I assign an icon x=mdi:gate
then if x-open exists (mdi:gate-open), then use it when the state is on/open.
Most icons are already named like this. It wouldn’t need any definitions at all.
But not all and therein lies the problem… There’s no control over the MDI set (from HA) and there are other sets people use too. This is what’s called a tight coupling between “systems” which generally is a bad idea.