Gents and Ladies,
I thought it was about time I learned a bit more about Lua and played around a bit more with scripting.
I’ve created a virtual temp sensor on Domoticz and I have tested sending the values to it, this works correctly using the following from “test lua” and from a scene.
local url = require(“socket.url”)
luup.inet.wget(“http://192.168.1.66:8080/json.htm?type=command¶m=udevice&idx=3&nvalue=0&svalue=15”)
Now the Thermostat I want to take the current temp from is Vera device 49 (alt id for zwave 6).
I though I could use this code to extract the temp;
local CurrentTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 49)
The problem seems to be when I combine the two I am sending Zero, I guess I am reading Zero from the thermostat.
local CurrentTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 49)
local url = require(“socket.url”)
luup.inet.wget(“http://192.168.1.66:8080/json.htm?type=command¶m=udevice&idx=3&nvalue=0&svalue=[b]CurrentTemp[/b]”)
When I check the value in the device variables or check the value read into PLEG i was seeing a temp of 18.6 deg.
Can anyone see what I’m doing wrong?
For reference I use this code to read a temp from another sensor (child device) into a different thermostat and it works.
local CurrentTemp = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 256)
luup.variable_set(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, CurrentTemp, 225)