Read text value from one sensor and send to another
Posted: Thursday 29 June 2017 18:37
I have two sensors in domoticz that are of the type "General/Text" (based on MySensor nodes). I am trying to write a script that reads the text from sensor1, checks if its part of a list of values and then sends it to sensor 2. This is my code for now:
The text value seems to be in rawData[1], in _sValues and in state. I tried to use setState() but that doesn't seem to be working. The text in the domoticz frontend isn't updated and no message is send to the sensor.
Any help would be great! How can I change and read text sensors?
PS I am using dzVents 1.1.1 I think, haven't updated to 2 yet
Code: Select all
return {
active = true,
on = {
'433Receiver'
},
execute = function(domoticz, sensor)
domoticz.log("Received from gateway " .. sensor.state)
-- check sensor values
domoticz.devices['433Sender'].setState(sensor.state)
end
}
Any help would be great! How can I change and read text sensors?
PS I am using dzVents 1.1.1 I think, haven't updated to 2 yet