Error with time node (next alarm sensor)

Hello,

I have this situation:

I have 2 phones with applications where I listen to next_alarm sensors. Then I have a template sensor that compares these two alarms with each other and selects the later one if they are 2 hours apart, i.e. one, e.g. set to 5; 30, the other to 7; 00 so the true one is at 7; 00.

https://pastebin.com/RryqUFf4

Then, based on this sensor, I have automation in node-red (thrown in pastebin as well) where the trigger is simply time node and some action is happening. Everything was fine and stopped working 2-3 days ago. I didn’t change anything, just updated HA. I have an error “cannot read properties of undefined (reading ‘hour’)” with time - node. Anyone know what it is caused by or how to do automation where the trigger is a sensor with date and time?

Thanks for help.

2 Likes

What does the sensors look like in developer tools?

Just date. Everything works fine in this setup, the only thing I did (what I think and could have had an impact) was node-red or HA update.

but sensors alarm łukasz_phone or alarm gosia_phone are just next_alarm sensors. They are also not working.

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/cookbook/using-date-and-time-entities-to-trigger-flows.html#home-assistant-companion-app-next-alarm-sensor
Using this setup next_alarm sensors will work but not my template sensors with date

@UPDATE

I restore backup to HA version 2022.2.3 (instead of 2022.2.6) and node-red 10.4.0 (instead of 11.0.0) and it works :slight_smile:

That sounds like you have a breaking change you need to address.
I suggest you figure it out now because it will happen again next time you update.

Ok, I upgraded back HA to the newest version and everything works fine. I also tried to upgrade node-red but the error ‘cannot read properties of undefined’ had shown again. I downgrade it again, works now good but I don’t see any breaking changes in docs of node-red.

The breaking changes are the ones listed below Breaking changes (as in your screenshot).
Use the search function in Node red to see if you have one of those nodes.

I am running into the exact same issue after updating Node-RED to v11.0.0. I asked in the Home Assistant Discord, but as of now there are no replies.

If You find the solution, please post it here :slight_smile:

I am experiencing the same issue too… All my node-red flows are reporting the same error.

This is fix in v0.42.3

1 Like

As @Kermit mentioned, v.0.42.3 fixes this issue.
Go into Node-RED → Settings → Palette and look for node-red-contrib-home-assistant-websocket. There should be an update available. Update the package and restart Node-RED.

The issue is now resolved for me.

2 Likes

Awesome!
Thanks it worked!!!

1 Like