Can someone tell me how to get the data to virtual temperature sensor again?
Thanks in advance.
EDIT: Sensor is updating now with the script as posted.
Code: Select all
local sensorwu = 'TempHumBaro' --Device name of the Open Weather Map sensor
local idxt = 354 --Idx of the virtual temperature sensor
commandArray = {}
if devicechanged[sensorwu] then
sTemp, sHumidity, sNull, sBarometer, sNull = otherdevices_svalues[sensorwu]:match("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)")
sTemp = tonumber(sTemp)
parseDebug = ('(Open Weather Map) Buitentemperatuur ' .. sTemp .. ' C')
print(parseDebug)
commandArray ['UpdateDevice'] = idxt.. '|0|' ..sTemp
end
return commandArray