j'ai une erreur depuis quelques jours depuis que les conditions météo ont changé :
Code : Tout sélectionner
2018-11-02 08:00:12.780 Status: dzVents: Error (2.4.6): :Meteo: An error occured when calling event handler DarkSky2
2018-11-02 08:00:12.780 Status: dzVents: Error (2.4.6): :Meteo: /home/pi/domoticz/scripts/dzVents/scripts/DarkSky2.lua:112: attempt to perform arithmetic on global 'Pow_WindSpeed' (a nil value)Code : Tout sélectionner
local function TempChill_calc(Temp_val, WindSpeed_kmh_val) -- https://fr.wikipedia.org/wiki/Temp%C3%A9rature_ressentieFroid_ressenti
local TempChill_val = Temp_val
if (Temp_val ~= nil and WindSpeed_kmh_val ~= nil and Temp_val <= 10) then
if (WindSpeed_kmh_val > 4.8) then
local Pow_WindSpeed = math.pow(WindSpeed_kmh_val, 0.16)
TempChill_val = 13.12 + 0.6215 * Temp_val + (0.3965 * Temp_val - 11.37) * Pow_WindSpeed
elseif WindSpeed_kmh_val >= 0 then
TempChill_val = Temp_val + 0.2 * (0.1345 * Temp_val - 1.59) * Pow_WindSpeed
end
end
return round(TempChill_val,1)
-- apparentTemperature from Dark Sky could be used...
end
Code : Tout sélectionner
local function TempChill_calc(Temp_val, WindSpeed_kmh_val) -- https://fr.wikipedia.org/wiki/Temp%C3%A9rature_ressentieFroid_ressenti
local TempChill_val = Temp_val
if (Temp_val ~= nil and WindSpeed_kmh_val ~= nil and Temp_val <= 10) then
local Pow_WindSpeed = math.pow(WindSpeed_kmh_val, 0.16)
if (WindSpeed_kmh_val > 4.8) then
TempChill_val = 13.12 + 0.6215 * Temp_val + (0.3965 * Temp_val - 11.37) * Pow_WindSpeed
elseif WindSpeed_kmh_val >= 0 then
TempChill_val = Temp_val + 0.2 * (0.1345 * Temp_val - 1.59) * Pow_WindSpeed
end
end
return round(TempChill_val,1)
-- apparentTemperature from Dark Sky could be used...
end