I have several devices that can set alarms and provide sensors like sensor.devicename_next_alarm of device_class timestamp. The idea is that any of these can set an alarm which shall trigger a HA script, and I always want to use the “next” (=minimum) alarm from the group of devices to trigger the next run of the script.
So I naively created a “group” using the UI’s “Helper” functionality, entered the “next_alarm” entities, and set type to “Minimum”. I also set “Ignore unavailable” to on. The “group” created by the helper doesn’t create an old-style group.something but instead a sensor.something.
I expected its state to become the minimum timestamp (in ISO format, like the original device sensors) if any alarms on the grouped devices were set, or unavailable if none were set. So I could easily use the “group minimum” as a trigger to start the next alarm script.
Unfortunately, this doesn’t work, and the group sensor always returns unavailable, even if one or more alarms are set on the grouped devices.
Q1: Is handling of device_class timestamp in helper groups not yet implemented? If so, will it be implemented?
Q2: Any easy-to-implement workarounds (possibly using only the UI), in HA Core 2025.4.2 and newer?
Believe me, I read through all these and experimented a lot. I fear the culprit here is
[…] holding numeric states
All device_class=timestamp sensors I have seem to report the ISO datetime string, not a numeric timestamp. Then again, if I remember correctly, an entity’s state is always a string.
I reckon it’s simply not (yet?) implemented for device_class=timestamp. Something that should be possible, I’m thinking.
Gee, thanks! That’s a good workaround for now, and should do what I try to achieve (and didn’t know how to do). Instead of hard-coding the list into the template (for making changes easier), is there a way I could maybe expand the group into an entity list in the above? So I could easily add/remove device from the group via the UI without having to remember all the places where it’s hard-coded?
EDIT: Two guys, one idea—you were faster. Thanks again!