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.
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:
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).
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.
I was able to make this work using NodeRed without a script or invoking dbus. The key was to setup the Digital Input in the Cerbo GX for all the values (including custom name) to appear properly in NodeRED.
First, as noted above use the Victron Custom Control.
In the custom control you select under the “Custom” dropdown “com.victronenergy.settings” then “/Settings/DigitalInput/1/AlarmSetting” under the next dropdown.
You then need to send a value of “1” to the node on “msg.paylod”.
From there you create another Custom Control to send the text for the alarm. In that node you select your Digital Input you are using for this. Keep in mind it will be the custom name you choose in the Cerbo GX UI, but it will also change to show the last alarm message you sent. Again, I sent the alarm message on msg.payload.
One observation, once the alarm is sent it will not send it again even if cleared. To make that work I had to reset the Alarm Setting back to “0” .