I’m trying to do two things. 1) rename the display of the binary sensor for my roomba from “on” and “off” to “Full” and “Empty”, and 2) customize the icon based on that state.
From the documentation, it seems like this could work, but there aren’t any specific examples that call it out:
Officially it’s a “legacy” method. Still works, but presumably it will be depreciated at some point. Possibly not, though, because lots of people still use it.
Almost there! The only thing now is I’d like to have a friendly that won’t overlap with future Roomba’s, and within lovelace get it to say something like “Bin Full?”
I’ve tried a few different things with the unique_id field, but to no avail. Here’s where i’m stuck:
Also, perhaps it’s a separate thread, but there is no way to do this as a “binary_sensor” so that I can have lovelace add color when it’s full, is there? From what I read, I’d want to approach it with a device class but unfortunately there’s no way to create a custom device class for a trash bin, correct?
When defining a Template Sensor, its name is its “friendly_name” and it will also be used to create its object_id (that’s the right half of its entity_id).
If you redefine it as a binary_sensor its state values become on/off and cannot be custom like Full/Empty. To make a binary_sensor display different state values in the UI, you would select an appropriate device_class but there’s none for Full/Empty.
If you’re interested, there are several Feature Requests for new device classes including one asking for exactly what you suggested, the ability to define custom device classes.