Understanding the UV value from Weather
Posted: Friday 15 September 2023 13:04
I'm retrieving several values from Domoticz and saving to files for my own Python programs to handle.
However the UV value from Weather seems to be different.
On the devices page the UVI value shows 4.0.
If use the code below
I get the error "scripts/dzVents/generated_scripts/Ext_Temp_For_Python.lua:32: bad argument #1 to 'write' (string expected, got table)".
If I use the following line
"local outside_solar=tostring(outside_solar)"
the file created contains "table: 0x696f6a28" rather than the 4 I see on the Domoticz page.
I'm obviously missing something. Can anyone help out please.
However the UV value from Weather seems to be different.
On the devices page the UVI value shows 4.0.
If use the code below
Code: Select all
local outside_solar=domoticz.devices(2219)
domoticz.log('get value for solar device 2219 ')
local outside_solar=outside_solar
local file = io.open('/home/pi/Documents/SandeSolar.txt','w')
file:write(outside_solar, "\n")
file:close()
os.execute("chmod a+rw /home/pi/Documents/SandeSolar.txt")If I use the following line
"local outside_solar=tostring(outside_solar)"
the file created contains "table: 0x696f6a28" rather than the 4 I see on the Domoticz page.
I'm obviously missing something. Can anyone help out please.