Tuesday at 04:14 PM1 day Moved this post to Plugins > Polyglot v3(PG3x) > Notification area of the forum.Has anyone successfully used the PG3x Notification node server REST API from an external process?I'm working on a Raspberry Pi-based monitoring and control project for my water-well system. I'd like the Pi to be able to send alerts to my phone through UD Mobile, using the eisy Notification node server as the notification mechanism.I already receive multiple UD Mobile notifications each day that are triggered by code running on eisy itself. That part works reliably. What I'd like to establish is whether an external process running on the Pi can invoke the Notification node server to send notifications through the same mechanism.The Notification node server's Read Me describes a REST interface. I tried the following request from the Pi, using the eisy's configured address and REST port:curl -X POST \ -H "Content-Type: application/json" \ -d '{"node":"udmobile","message":"The Message","subject":"The Subject"}' \ http://192.168.7.241:8199/sendThe server responded:do_POST:Received: /send {}.Code: 200Command /send successHowever, no notification appeared in UD Mobile.Has anyone successfully sent UD Mobile notifications from a Raspberry Pi or another external process using the eisy Notification node server?If so, I'd appreciate a working example of the request, including the correct endpoint, HTTP method, payload format, and any required configuration or node-server-specific details.My objective is to have the Pi send alerts about significant abnormal water-well system conditions to UD Mobile, while keeping the Pi responsible for its monitoring and control-support functions.I'm particularly interested in a solution that works over the local network, without having to implement a separate push-notification mechanism.Thanks. Edited Tuesday at 08:08 PM1 day by Michaelco Moved this post to Plugins > Polyglot v3(PG3x) > Notification area of the for - Looks like a more appropriate location
Yesterday at 03:42 AM1 day If you don't need the PI to generate the text there is an easy way to accomplish what you want. Make a list of all the conditions you want the be alerted about. Set up a state variable in IoX. Have the PI set the state variable via the IoX REST interface to a value coding for the needed alert. Set up a program for each alert condition that sends the desired notification when the state variable takes on the coded value. (I am assuming it is possible to trigger the Notification node server via a program - I am not familiar with it). Edited 18 hours ago18 hr by stillwater clarity
8 hours ago8 hr Author 23 hours ago, stillwater said:If you don't need the PI to generate the text there is an easy way to accomplish what you want. Make a list of all the conditions you want the be alerted about. Set up a state variable in IoX. Have the PI set the state variable via the IoX REST interface to a value coding for the needed alert. Set up a program for each alert condition that sends the desired notification when the state variable takes on the coded value. (I am assuming it is possible to trigger the Notification node server via a program - I am not familiar with it).Thank you - that's a good solution. I've used that approach successfully for another application: when the Shelly BLU Gateway detects a button press, which ultimately sets an IoX state variable, triggering an IoX program to open the entrance gate.For the well system, however, there are dozens of conditions that could trigger notifications, and I expect that number may grow as I expand the monitoring.Javi suggested using the UD Portal API directly, which I tested successfully. This lets the Pi send notifications directly, with the notification text generated by the Pi. I can add or modify alerts in the Python monitoring code without having to create or maintain a corresponding IoX program for each condition.For this application, I wanted a more scalable and flexible approach. Thanks again - sorry for not responding sooner. After posting here, I found there was a Notification subtopic, which seemed like a better place to post - didn't see a good way to move the post, so thought I'd hide this post and repost there. Had clicked on Hide, and it looked like it had successfully hidden the topic, but I see that wasn't the case. I'll try hiding this post tomorrow - the thread with Javi's recommendation is https://forum.universal-devices.com/topic/47313-using-notification-node-server-from-external-process/
Create an account or sign in to comment