i have an inside temp sensor but this one hase a humidity sensor as well.
i wanted a "switch"with only the temperature.so i created a virtual one.im not good with lua so i coppied a script to do that.
this is normally used to split weather underground, that is updated every 10 minutes.
Code: Select all
local sensorwu = 'temperatuur woonkamer' --name of the sensor that gets created when you add the WU device (and that contains multiple values like temperature, humidity, barometer etc)
local idxt = 114 --idx of the virtual temperature sensor you need to change this to your own Device IDx
commandArray = {}
if devicechanged[sensorwu] then
sWeatherTemp, sWeatherHumidity = otherdevices_svalues[sensorwu]:match("([^;]+);([^;]+);([^;]+)")
sWeatherTemp = tonumber(sWeatherTemp)
commandArray[1] = {['UpdateDevice'] = idxt .. '|0|' .. sWeatherTemp}
end
return commandArray
that is more then enough for my use.