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 -
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,
VaibhavGot 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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login