Provoke a Notification or Alarm via NodeRED

Hi All,

I have a NodeRED flow monitoring a bunch of external conditions and disabling some things (generator autostart, for example).

I would ideally like to make that visible by posting a notification to the local interface (Cerbo etc)

Have tried tweaking these flags:

com.victronenergy.platform/Notifications/Alarm
com.victronenergy.platform/Notifications/Alert

and they pull up the Notifications screen (and turn on the beeper) but there is no obvious way to push a description. I’m working my way through Python code examples (because I could run a script from NodeRED) but nothing has jumped out so far.

1 Like

I have found a way to invoke custom alarm notifications locally on the Cerbo, but it requires sacrificing a Digital Input to use as the proxy for the alarm*

If you set a Digital Input to something like “Door alarm”, then you can trigger it using dbus. You do not have to physically wire it to anything - it will be an alarm that can programmatically be triggered like this:

dbus -y com.victronenergy.settings /Settings/DigitalInput/1/AlarmSetting SetValue %1

If you change its name first, that is then the name the notification will show:

dbus -y com.victronenergy.settings /Settings/DigitalInput/1/CustomName SetValue "Anchor"

As a bonus, these also send notifications through VRM as well - including the custom name.

Now if you want to do this in NodeRED, just use the Victron Custom Control to write to /Settings/DigitalInput/1/AlarmSetting and you can programmatically invoke an alarm with notifications. I have done this and it works.

Note: you might also be able to set these value over MQTT but I have not tried that.

But you are limited to one alarm for each Digital Pin you use as a proxy.

* Going even further, I think it might be possible to programmatically insert the right type of object into the dbus notification list directly and have that show up in the GUI as well, but I have not tried this. If that works, then it might be possible to have totally custom alarms/alerts that are not tied to hardware like a digital pin, etc… In theory it seems possible because that is all the various alarms in the Venus platform are doing from what I can tell.

And, using dbus to set com.victronenergy.platform/Notifications/Alarm only triggers the internal beeper and not the alarm relay, whereas the digital pin way triggers both (as long as the alarm relay is also set up).

1 Like

That’s a good solution (even with sacrificing the input). I have used NodeRED to enable or disable digital input and rename them etc so I know the wrinkles with that.
Next time I’m having some quality SSH time with a Venus device I might see if I can post something to dbus as you describe… it would “close the loop” somewhat with the NodeRED being able to “push” notifications back to the local screen and VRM.

I’ve been successful in using NodeRED to invoke an alarm with a custom name. The name changes then get passed off to the notification system and stay there, even if you trigger again with a new name. So the history is preserved. But you can’t fire off more than you have digital inputs to us unfortunately.

I’ve also done more poking around the Venus source code, and it seems there’s not a great way to insert new the notifications that are behind alarms from outside the Venus Platform process. You can manipulate them through dbus - even changing the details and adding a description, etc… but you cannot really insert new ones into the system other than by triggering an alarm.

There is also a defect when setting the notification alarm state through dbus and that only triggering the buzzer and not the alarm relay. I may log that as a code bug and see what happens. Ideally though, they would open up an API for creating notifications from other drivers and services.