Device classes have been around for a long time, and new choices are implemented from time to time. I believe they have more to do with internal implementation (backend and frontend), i.e., “behind the scene” details, than something a user should be too concerned about.
It means the entity’s state is one of a known set of values, which are listed (aka, enumerated) in the options attribute.
Make options attribute a list that maintains order
Improve HACS support
Release 2.2.0b3
Fix elevation sensor around sunrise/sunset
Normally the elevation sensor updates every 0.5 degrees. Code was added in 2.2.0b0 to add an update when the sun’s elevation crossed -0.833, which is the sunset/sunrise point. However, it was initially done improperly, resulting in multiple updates around that point. This release fixes that issue.
FYI, I’ve discovered a race condition in the code. It’s possible at startup for at least the elevation sensor to update initially, and then not update until the next restart. This will only happen if the entity uses the local location configuration (i.e., if latitude, etc. are not specified.) It happens because HA sends a config update signal a few times at startup and the sun2 integration is not handling this completely correctly. I think this bug will manifest rarely, but I’ve experienced it, so it is possible. If you experience this problem, I’d like to hear which type of sensor it happened to. In any case, a HA restart will probably make it work again normally.
hehe, yes, I guess it boils down how adventurous you want it to be, a quick google search on astral sun image icon - Google Search doesn’t really narrow down your options…
Has anyone seen errors related to some of the “point in time” sensors, such as astronomical_dawn, especially during the winter or summer? It seems some changes to the core software, possibly as far back as 2021.12, can cause exceptions with these sun2 sensors, but I only recently had the issue reported.
Specifically, if the event for a “point in time” sensor (such as astronomical_dusk) does not occur during the current day, the sensor used to attempt to set its state to “none”. Prior to HA 2021.12 this used to work. But starting with that release, since the sensor has a device class of timestamp, that value is not allowed, which can cause an exception. Further, if that exception happens during startup (i.e., the event does not occur on the day HA is (re)started), the sensor will not get created normally, and instead will have the value “unavailable”.
Now, for days on which the event does not occur, the sensor’s state will be “unknown” (which, internally, is represented with the Python value None.)
That feature is, as of yet, still considered beta. It is available if you use 2.3.0b3. (If you note above, the fix for the point-in-time sensors was released in both 2.2.2 and 2.3.0b3.) I probably need to go ahead and release that feature fully, but just haven’t spent the time to do so.
UPDATE: The manifest.json file for the beta release points to the corresponding documentation, which is: