Ajoute
Code : Tout sélectionner
print ("valeur de Lux :"..otherdevices_svalues['Lux'])Code : Tout sélectionner
print ("valeur de Lux :"..otherdevices_svalues['Lux'])Code : Tout sélectionner
2016-04-20 15:25:01.154 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua: /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua:202: attempt to concatenate field 'Lux' (a nil value)Code : Tout sélectionner
tonumber(otherdevices_svalues['Lux']Code : Tout sélectionner
tonumber(otherdevices_svalues['luminosite']Code : Tout sélectionner
print ("valeur de Lux :"..otherdevices_svalues['luminosite'])2016-04-20 16:40:01.364 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua: /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua:202: attempt to concatenate field 'luminosite' (a nil value)
Code : Tout sélectionner
http://192.168.1.101:8080/json.htm?type=command¶m=udevice&idx=122&svalue=5OK il est updaté...{
"status" : "OK",
"title" : "Update Device"
}
Le code dans cette partie :2016-04-21 20:00:00.586 LUA: Lat: 48.29999924Long: -70.93000031Alt: 135.00000000
2016-04-21 20:00:00.586 LUA:
2016-04-21 20:00:00.587 LUA: 2016-04-21 20:00:00
2016-04-21 20:00:00.587 LUA: la_baie, latitude:48.31881, longitude:-70.90116
2016-04-21 20:00:00.587 LUA: Home altitude = 117 m
2016-04-21 20:00:00.587 LUA: number Of Day = 112
2016-04-21 20:00:00.587 LUA: 2016 is a leap year !
2016-04-21 20:00:00.587 LUA: Angular Speed = 0.98562628336756 per day
2016-04-21 20:00:00.587 LUA: Declinaison = 12.315610455635°
2016-04-21 20:00:00.587 LUA: Universel Coordinated Time (UTC)0 H.dd
2016-04-21 20:00:00.587 LUA: Solar Hour -4.726744 H.dd
2016-04-21 20:00:00.587 LUA: Altitude of the sun = -3.053779759848°
2016-04-21 20:00:00.587 LUA: Angular hourly = 250.90116°
2016-04-21 20:00:00.587 LUA: Azimuth of the sun = 292.40352397259°
2016-04-21 20:00:00.587 LUA: Duration of the sunstroke of the day = 13.89 H.dd
2016-04-21 20:00:00.587 LUA: Radiation max en atmosphere = 1345.05 W/m²
2016-04-21 20:00:00.587 LUA: Local relative pressure = 1011 hPa
2016-04-21 20:00:00.588 LUA: Absolute pressure in atmosphere = 996.9 hPa
2016-04-21 20:00:00.588 LUA: Coefficient of mitigation M = 81.797758971885 M0:80.656959366046
2016-04-21 20:00:00.588 LUA: curl "http://www.ogimet.com/cgi-bin/getsynop? ... 160421-100"
2016-04-21 20:00:00.937 LUA: ogimet: S07145,2016,04,21,22,00,AAXX 21224 07145 22970 70000 10137 20085 39988 40196 53006 83032 333 60005 83365 87076 90710 91102 93100=
2016-04-21 20:00:00.937 LUA: Station SYNOP = 07145
2016-04-21 20:00:00.938 LUA: 7 Octa
2016-04-21 20:00:00.938 LUA: Kc = 0.52369115797991
2016-04-21 20:00:00.938 LUA: Direct Radiation = 0 W/m²
2016-04-21 20:00:00.938 LUA: Scattered Radiation = 0 W/m²
2016-04-21 20:00:00.938 LUA: Total radiation = 2 W/m²
2016-04-21 20:00:00.938 LUA: Total Radiation in lux = 252.53 Lux
2016-04-21 20:00:00.938 LUA: and at last, Total weighted lux = 132.25 Lux
2016-04-21 20:00:00.938 LUA: valeur de Lux :5
2016-04-21 20:00:00.938 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua: /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua:204: attempt to perform arithmetic on a nil value
Code : Tout sélectionner
if (DEBUG == 1) then
print("Station SYNOP = " .. WMOID)
print( Octa .. " Octa")
print("Kc = " .. Kc)
print("Direct Radiation = ".. round(directRadiation,2) .." W/m²")
print("Scattered Radiation = ".. round(scatteredRadiation,2) .." W/m²")
print("Total radiation = " .. round(totalRadiation,2) .." W/m²")
print("Total Radiation in lux = ".. round(Lux,2).." Lux")
print("and at last, Total weighted lux = ".. round(weightedLux,2).." Lux")
end
print ("valeur de Lux :"..otherdevices_svalues['luminosite'])
if tonumber(otherdevices_svalues['Lux'])+round(weightedLux,0)>0 -- No update if Lux is already 0. So lastUpdate of the sensor switch w$
then
commandArray[indexArray] = {['UpdateDevice'] = idxLux..'|0|'..tostring(round(weightedLux,0))}
indexArray=indexArray+1
end
commandArray[indexArray] = {['UpdateDevice'] = idxSolarAzimuth..'|0|'..tostring(round(azimuth,0))}
indexArray=indexArray+1
commandArray[indexArray] = {['UpdateDevice'] = idxSolarAltitude..'|0|'..tostring(round(sunAltitude,0))}
indexArray=indexArray+1