Requesting value from Domoticz
-
You can use that though to set the value that the node can grab. Are you wondering how to grab the value?
@dbemowsk said:
You can use that though to set the value that the node can grab. Are you wondering how to grab the value?
I am trying to figure what values to pass to
void request(uint8_t childSensorId, uint8_t variableType, uint8_t destination);
Where are the corresponding values show up in Domoticz UI? -
I pull the thermostat mode from my thermostat bridge node like this:
request( CHILD_ID_MODE, V_TEXT );I have never used the destination attribute, so I can't speak to it's use, but using the childSensorId and variableType works for me. You still need to use the technique I described to set the MySensors child node from the dummy sensor though.
-
I pull the thermostat mode from my thermostat bridge node like this:
request( CHILD_ID_MODE, V_TEXT );I have never used the destination attribute, so I can't speak to it's use, but using the childSensorId and variableType works for me. You still need to use the technique I described to set the MySensors child node from the dummy sensor though.
-
You are going to use 2 things. message.type and message.data. The message.type in my scenario is V_TEXT, and message.data is the payload, which in my case is O, H, C or A, but can be whatever you pass from Domoticz. The code in your receive function would look something like this:
if (message.type == V_TEXT) { Serial.println("Received data" + String(message.data)); //Here you would do something with message.data }If you have more than one child sensor sending V_TEXT data, you would then use an if statement or a switch/case to check message.sensor for the child ID of the sensor and process each as above.
if (message.type == V_TEXT) { if (message.sensor == 1) { Serial.println("Received data from child 1" + String(message.data)); //Here you would do something with message.data for the first child } else if (message.sensor == 2) { Serial.println("Received data from child 2" + String(message.data)); //Here you would do something with message.data for the second child } }Let us know if you have trouble.
-
You are going to use 2 things. message.type and message.data. The message.type in my scenario is V_TEXT, and message.data is the payload, which in my case is O, H, C or A, but can be whatever you pass from Domoticz. The code in your receive function would look something like this:
if (message.type == V_TEXT) { Serial.println("Received data" + String(message.data)); //Here you would do something with message.data }If you have more than one child sensor sending V_TEXT data, you would then use an if statement or a switch/case to check message.sensor for the child ID of the sensor and process each as above.
if (message.type == V_TEXT) { if (message.sensor == 1) { Serial.println("Received data from child 1" + String(message.data)); //Here you would do something with message.data for the first child } else if (message.sensor == 2) { Serial.println("Received data from child 2" + String(message.data)); //Here you would do something with message.data for the second child } }Let us know if you have trouble.
-
I pull the thermostat mode from my thermostat bridge node like this:
request( CHILD_ID_MODE, V_TEXT );I have never used the destination attribute, so I can't speak to it's use, but using the childSensorId and variableType works for me. You still need to use the technique I described to set the MySensors child node from the dummy sensor though.
At the moment I'm trying to send a text value from Domoticz with MySensors Gateway to one of my nodes.
I need to implement the "request" function in this node. So here's my question: what value did you assign to "CHILD_ID_MODE". I presume that's the ID of the dummy selector described in another topic on this forum? How did you obtain this value? Is it available somewhere in Domoticz UI?
Now I request a text value, but all I get is a blank message, cause I don't know what I should insert as "uint8_t childSensorId".
-
@gohan Yes, I understand, but when I create a dummy text sensor I can't define its child ID. Can I find it somewhere?
-
You have to create a sensor in the sensor node sketch, assign a child ID to it and present it like the others sensors during setup, then it should show on the controller. I can't be more specific because I haven't worked on text sensors yet
@gohan Dummy sensors are created in Domoticz, they don't use the MySensors library, so one doesn't upload any sketches to Arduino :)
What I want to achieve specifically is to send outside temperature received from WeatherUnderground to one of my MySensors nodes.
-
I know, but if you don't create a sensor able to receive the value, you can't send anything to it through the mysensors network
@gohan hey, now I get it!
got it working the way I wanted, thank you so much :D
-
Just for my curiosity, why are you using the temperature from weather underground? Is it just displayed on a screen?
@gohan I'm doing a project for my master's thesis.
There's a mathematical thermal model of a building running on MySensors node. I wanted to supply it with an information about actual outside temperature to have accurate results.
-
A real mysensors project would require an external node with temperature and humidity sensor 😁
@gohan This model is just a small part of my project. But I get your concept.
There's already a DHT11 node running inside my house, measuring quantities that you've mentioned.
-
@gohan hey, now I get it!
got it working the way I wanted, thank you so much :D
-
@tomek_olo
Sorry what is the way for send from domoticz child -node to other node through lua script for example Tanks@mar.conte I don't understand your question. Can you clarify, please?