Copprhead - My alarm flows are working almost f...

My alarm flows are working almost fine now using polling notifications every 2 secs in a loop that is started by an inject node ("once after .1 s"). The following "change node" initializes the global alarm state variable, then the polling happens (which changes the alarm state variable if an alarm notification was found) and this gets repeated after a delay of 2s. Unfortunately the polling loop is not started when I restart the SK server. I can tell because the alarm is not triggered when necessary and in NR editor I don't see the debug output from the poll loop. If I then move one of the nodes and redeploy (no code changes), the loop is started and the alarm is triggered. Restart SK and again it's not working until I redeploy. As if this wouldn't be strange enough, another loop which is started the same way and makes an "alive" blink every 4s is working after restarts.
1 Reply
Copprhead
Copprhead2mo ago
Ok I found something in the log: Mar 27 17:19:21 27 Mar 17:19:21 - [error] [function:poll all alarms] TypeError: Cannot convert undefined or null to object app.getSelfPath('notifications') returns undefined, but this only happens on first start or restart. After I redeploy in NR it works. Still couldn't solve this, tried many different ways of triggering my notifications polling loop (delayed, by using signalk-specific nodes...), but always get undefined from app.getSelfPath('notifications') after the server is freshly restarted.