[FIXED] OWM temperature to dummy device Topic is solved

Moderator: leecollings

Post Reply
User avatar
HansieNL
Posts: 964
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

[FIXED] OWM temperature to dummy device

Post by HansieNL »

I'm using a dummy temperature sensor which data is retrieved from the OWM TempHumBaro device. I use a LUA script, but that doesn't fill the dummy with data anymore. Looks like it stopped working after update to 2021.1.
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
Blah blah blah
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest