UV Data from Meteorologisk institutt Norway (Weather Lookup)
Posted: Saturday 04 May 2024 13:11
I have an odd problem getting the value for UV data.
local solar_value = domoticz.devices(3444)
domoticz.log('Solar Shade device' .. solar_value )
throws this error
Script #4 lua:22: attempt to concatenate a table value (local 'solar_value')
so probably have to use RawData and it's probably text
so let's try
local solar_value0 = tonumber((domoticz.devices(3444).rawData[0]))
domoticz.log('Solar Shade Trigger value 0' .. solar_value0)
throws this error
#4.lua:26: attempt to concatenate a nil value (local 'solar_value0')
so try the next part of the data
local solar_value1 = tonumber((domoticz.devices(3444).rawData[1]))
domoticz.log('Solar Shade Trigger value 1' .. solar_value1)
and this gives me this in the log
Status: dzVents: Info: Solar Shade: Solar Shade Trigger value 14.7
but the UV value in Weather is 4.7
If I multiply the solar_value1 by 2 I get this
Status: dzVents: Info: Solar Shade: Solar Shade Trigger value 19.4
========================
New maths 2 x 4.7 =19.4 !
========================
Anyhow I also tried tonumber((domoticz.devices(3444).rawData[2]))
which gave me 10.0
and tonumber((domoticz.devices(3444).rawData[3]))
#4.lua:32: attempt to concatenate a nil value (local 'solar_value1')
What have I missed?
local solar_value = domoticz.devices(3444)
domoticz.log('Solar Shade device' .. solar_value )
throws this error
Script #4 lua:22: attempt to concatenate a table value (local 'solar_value')
so probably have to use RawData and it's probably text
so let's try
local solar_value0 = tonumber((domoticz.devices(3444).rawData[0]))
domoticz.log('Solar Shade Trigger value 0' .. solar_value0)
throws this error
#4.lua:26: attempt to concatenate a nil value (local 'solar_value0')
so try the next part of the data
local solar_value1 = tonumber((domoticz.devices(3444).rawData[1]))
domoticz.log('Solar Shade Trigger value 1' .. solar_value1)
and this gives me this in the log
Status: dzVents: Info: Solar Shade: Solar Shade Trigger value 14.7
but the UV value in Weather is 4.7
If I multiply the solar_value1 by 2 I get this
Status: dzVents: Info: Solar Shade: Solar Shade Trigger value 19.4
========================
New maths 2 x 4.7 =19.4 !
========================
Anyhow I also tried tonumber((domoticz.devices(3444).rawData[2]))
which gave me 10.0
and tonumber((domoticz.devices(3444).rawData[3]))
#4.lua:32: attempt to concatenate a nil value (local 'solar_value1')
What have I missed?