How to send message from one sensor to other or send message with different node and sensor ID?
-
Hello all,
I have pH sensor on node ID 1 and valve that controls pH on node ID 2. Now when the pH level falls below some value I want to open the valve. How can I send message from one node to other to open the valve
OR
How can I send message to domoticz from node ID 1 to open the valve on node ID 2?
Thank You,
Vaibhav
-
Got it after some trial and error with getters and setters.
In case someone needs. I did following.
MyMessage msg(); //Create a blank MyMessage instance. Do this before void setup()
then when you want to send the message. Create a message on the fly like following.
1. msg.setType(2); 2. msg.setSensor(1); 3. msg.setDestination(2); 4. send(msg.set(1));
This is what I am doing above:
- set message type ex. V_LIGHT is 2. Look at API for more
- Set sensor child ID of the sensor you want to change status of
- This is the destination node ID which has the sensor you are trying to reach
- Send the message just like you would usually.
Hope this helps someone
1 out of 2
Suggested Topics
-
Day 1 - Status report
Announcements • 23 Mar 2014, 22:45 • hek 24 Mar 2014, 20:12 -
JSN SR04T - Temperature Influencing Readings
Troubleshooting • 6 Sept 2019, 07:51 • Timbergetter 11 days ago -
JSN-SR04T-V3.0 Coax cable extended
Troubleshooting • 20 days ago • bocalexandru 18 days ago -
Getting system time from the controller
Troubleshooting • 27 Feb 2025, 01:39 • dpcons 3 Mar 2025, 01:00 -
Forum Search not working?
Troubleshooting • 4 Oct 2023, 23:33 • Gibber 2 Sept 2024, 20:28 -
NODs stop responding, but ping works.
Troubleshooting • 8 Mar 2025, 19:47 • Marcin 8 Mar 2025, 19:47