I was able to make it work successfully. Here is my code, which I adapted using a part of the code found in L_VirtualOutdoorTemperature.lua:
local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 128)
local tempFormat = "C"
local data = "0x31 0x05 0x01 0x"
temp = temp.gsub(temp, "%.", "")
local tempHex
local first, second
local tempSignBit = (string.lower(tempFormat) == "c") and "22" or "2A"
tempHex = string.format('%4X', temp)
if tonumber(temp) < 0 then
first = tempHex:sub(5,6)
second = tempHex:sub(7)
else
tempHex = tempHex.gsub(tempHex, "%s", "0")
first = tempHex:sub(1,2)
second = tempHex:sub(3,4)
end
data = data .. tempSignBit .." 0x".. first .." 0x".. second
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", { Node="27", Data=data }, 1)
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", { Node="28", Data=data }, 1)
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", { Node="29", Data=data }, 1)
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", { Node="30", Data=data }, 1)
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1", "SendData", { Node="31", Data=data }, 1)
My temp is in C, and I have 5 thermostats. PM me if you need help adapting this code to your situation, but I think it’s pretty straightforward.
Then I created a scene that runs every 30 minutes and executes that code. All 5 thermostats now display correct outdoor temperature from my backyard sensor.