Whenever my instance of Home Assistant restarts, the next_alarm state for my Android device reverts to “unknown” instead of falling back to the previous value. Since sensor.next_alarm is only updated when the alarm state changes, the state remains “unknown” until my next alarm fires or I add, remove, or change the next alarm. The only other way the state gets updated is if I open the companion app, navigate to the next_alarm state, and open it.
The issue I’m trying to solve is running an automation prior to my alarm time. I run Home Assistant as a docker on Unraid, and Unraid restarts all dockers while I’m asleep to perform it’s AppData backup. This means the next_alarm state falls back to “unkown” until my alarm goes off, and by then it’s too late.
My current workaround uses the Tasker app to run a profile at the same time each morning to 1) get my next alarm time, 2) set an alarm for 1 minute before that, 3) cancel the alarm it just set. By doing this, it gets Home Assistant to update sensor.next_alarm for my phone.
I would much prefer to get something working natively in Home Assistant so I don’t have to rely on Tasker. Is there something I can implement that forces sensor.next_alarm to hold the last value or actively get a new one after a restart? Does anyone know if this qualifies as a feature or a bug?
I just updated my app to the latest beta version on playstore and rebooted HA.
The sensor was unavailable for a minute or so then it came back as normal again.
@dshokouhi That indeed appears to be the issue, thanks. I wasn’t finding the issue via Google, but I didn’t think to check the GitHub.
@Hellis81 I just tried the beta app too. When I first installed it, the alarm time was updated. But when I restarted HA, next_alarm has remained “unknown” for at least 12 minutes and counting.