Android Next Alarm node no longer sending any payload at alarm time

Has something changed with the Android alarm and the recent app update to 2022.6.0? I use the time node configured with my Android phone’s next alarm entity to trigger a wake-up routine. Within the last week, the time node has stopped sending any outputs, even with the “Debug information” checkbox checked. I’ve tried using the example setup from the Node Red cookbook and it likewise does not output anything at the alarm time when configured for my phone:
image

Here’s the flow from the cookbook - the only thing I changed was the entity id.
[{"id":"40bcdbb06b7ff681","type":"ha-time","z":"e8d4172e.bb0eb8","name":"","server":"","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityId":"sensor.pixel_6_next_alarm","property":"state","offset":0,"offsetType":"num","offsetUnits":"minutes","randomOffset":false,"repeatDaily":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"sunday":true,"monday":true,"tuesday":true,"wednesday":true,"thursday":true,"friday":true,"saturday":true,"debugenabled":true,"x":1150,"y":240,"wires":[["513ebdd1.58be64"]]},{"id":"513ebdd1.58be64","type":"debug","z":"e8d4172e.bb0eb8","name":"do stuff","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1400,"y":240,"wires":[]}]

Edit: Adding some more notes - I have zero sensors selected in the Allow List and I can see the correct time on the Node Red node as well as in Developer Tools. I also tested creating a YAML automation based on the time for sensor.pixel_6_next_alarm and it ALSO does not fire when the alarm goes off.

If it does not work in HA it will not work in NR. The sensor itself in dev tools shows the right alarm time?

Go to template section and use the following with the alarm sensor.

{{ states('sensor.pixel_3_bluetooth_connection') }}

If the right time does not show try disabling and re enabling the sensor. then go to the mobile app integration and reload

If I put this in the template editor:
image
I get this:
image
Which is the correct time, just not displayed in my local time (i.e. with time zone and DST changes).

Okay there looks to be an attribute with the local time. Under the sensor drop down list, where it says property enter attributes.Local Time.

image

If I try this with a debug node set to the complete message object, I get “Invalid property”. If I leave it set to state and I have no other alarms set besides a single one-time testing alarm, I get “Unavailable” which seems incorrect considering what the msg.payload, msg.data, and msg.topic are supposed to be:

Interestingly, if I have two alarms set, e.g. 11:55 AM and 12:00 PM, when the 11:55 AM alarm triggers, there is nothing sent to the debug node. The time node updates with the next alarm but no downstream nodes trigger and nothing shows up in the debug panel.

There can be a race condition when your phone’s time is ahead of the server time running node-red. This will cause the alarm sensor to be set back to unavailable before the “alarm time” has gone off in node-red.

Ok, I’ve noticed that times set to 10pm seem to trigger at 10:02pm consistently. Is there a way to resolve the race condition? I’ve tried rebooting my phone but that didn’t change anything.

I tested setting an offset on the time node for my phone’s next alarm. The node triggered correctly with offsets of -3, -2, & -1, but with an offset of 0, the node just changed to ‘unavailable’ or the next alarm time without sending any messages. No output was sent regardless of whether there was another alarm set in the future or not. A YAML automation based on sensor.pixel_6_next_alarm worked the same way - offsets of at least 1 minute before the alarm worked as expected, but triggers based on the exact alarm time did not fire.

Those results seem to support the race condition issue. Is the race condition phone-based? App-based? Server-based? I can set time offsets for now, but it would be nice to be able to resolve the race condition to avoid the offset workaround.

When the alarm is triggered on your phone it updates the next_alarm sensor to unavailable or to whatever the next alarm is. If your HA server’s clock is a few seconds behind your phone’s clock the alarm is not going to be triggered because it gets reset before the time has occurred on the server based on the time.

Not sure of a simple solution but you could have an input_datetime that you start the flow with. Then set the input_datetime based on the next_alarm sensor but put a delay of X time before it changes the input_datetime.

As of June 22, I am having the same problem. Looks like I updated to core_2022.6.6 at that time. I have input_datetime helpers that are not triggering in Nodered using ha_time. Everything was working fine beforehand. I have not investigated whether these work with Automations.