DZVents : DarkSky et probabilité de pluie

Vous avez crée un script lua dont vous êtes fier, un .sh génial, un programme python hors du commun, un tuto , c'est ici que vous pouvez les partager.
Soyez précis quant aux prérequis, les manips à faire pour que votre bijou fonctionne (des chmod ?, un apt-get à faire ...)
Décrivez précisément son fonctionnement
Placez votre code entre [Quote] et {/Quote]
papoo
Messages : 1381
Enregistré le : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

DZVents : DarkSky et probabilité de pluie

Message par papoo » 17 sept. 2018, 17:58

J'anticipe une éventuelle disparation définitive de l'API Weather underground en me tournant vers une autre API celle de DarkSky
2018-09-16 20_44_38-Domoticz.png
2018-09-16 20_44_38-Domoticz.png (27.93 Kio) Vu 1406 fois
Ce script nécessite l'inscription préalable à l'API DarkSky
pour les prévisions horaires, Darsky ne fourni pas le type de précipitation seulement la probabilité et l'intensité
pour ce script je ne prendrais en compte que la probabilité (precipProbability)
2018-09-16 21_12_30.png
2018-09-16 21_12_30.png (9.05 Kio) Vu 1406 fois
Ce script peut potentiellement récupérer les 48 prévisions horaires disponible. Créez autant de capteurs virtuels pourcentage correspondant aux prévisions horaires que vous souhaitez.
pour ma part, je ne récupère que les prévisions à 1 heure, 2 heures, 4 heures, 6 heures, 12 heures et 24 heures.
Pour cela Ajoutez, modifiez ou supprimez les variables proba_pluie_h[] en changeant le nombre (heure) entre []
Renseigner ensuite le nom "entre guillemets" ou l'idx sans guillemets (évitez les accents) du device pourcentage probabilité pluie à [x] heure associé, nil si non utilisé.
Le script est exécuté toutes les 30 minutes mais vous pouvez changer ce delai, attention toutefois à ne pas dépasser les 1000 requêtes par jour de l'api gratuite.
Ma clé secrète DarkSky, la latitude et la longitude de mon domicile sont contenus dans 3 variables utilisateurs

Code : Tout sélectionner

        local DarkSkyAPIkey = domoticz.variables('api_forecast_io').value
        local geolocalisation = domoticz.variables('Latitude').value..","..domoticz.variables('Longitude').value 
si vous souhaitez inscrire ces informations dans le script, commentez les deux lignes ci-dessus, décommentez les deux lignes suivantes :

Code : Tout sélectionner

        --local DarkSkyAPIkey = "1a2bf34bf56c78901f2345f6d7890f12"
        --local geolocalisation = "45.87,1.30" -- latitude,longitude
en les personnalisant avec vos données personnelles
Enfin vous pouvez choisir le niveau de "verbiage" des logs, seulement un niveau peut être actif; commenter les autres dans la section logging

Code : Tout sélectionner

  logging =   { 
                -- level    =   domoticz.LOG_INFO,
                -- level    =   domoticz.LOG_ERROR,
                   level    =   domoticz.LOG_DEBUG,
                -- level    =   domoticz.LOG_MODULE_EXEC_INFO,

le script complet

Code : Tout sélectionner

--[[ darksky.lua for [ domoticzVents >= 2.4 ]
author/auteur = papoo
update/mise à jour = 15/09/2018
creation = 15/09/2018
https://pon.fr/dzvents-darksky-et-probabilite-de-pluie/
This script requires prior registration to the DarkSky API
Ce script nécessite l'inscription préalable à l'API DarkSky
Enter the URL and request a free API key
Entrez l'URL et demandez une clé API gratuite
https://darksky.net/dev
]]--               
local proba_pluie_h = {}
--[[
    Add, modify or delete variables proba_pluie_h [] by changing the number (hour) between []
    the name "in quotation marks" or the idx without quotes (avoid accents) of the device of percentage of rain at [x] associated time, nil if not used
    This script can potentially retrieve the 48 available time forecasts. Create as many percent virtual sensors as you would expect from the hourly forecasts.
    for my part, I only get the forecasts at 1 hour, 2 hours, 4 hours, 6 hours, 12 hours and 24 hours.
    Only 48 possible forecasts
    Ajoutez, modifiez ou supprimez les variables proba_pluie_h[] en changeant le nombre (heure) entre []
    renseigner ensuite le nom "entre guillemets" ou l'idx sans guillemets (évitez les accents) du device pourcentage probabilité pluie à [x] heure associé, nil si non utilisé
    Ce script peut potentiellement récupérer les 48 prévisions horaires disponible. Créez autant de capteurs virtuels pourcentage correspondant aux prévisions horaires que vous souhaitez.
    pour ma part, je ne récupère que les prévisions à 1 heure, 2 heures, 4 heures, 6 heures, 12 heures et 24 heures.
    Seulement 48 prévisions possible
    My DarkSky secret key, the latitude and longitude of my home are contained in 3 user variables
    Ma clé secrète DarkSky, la latitude et la longitude de mon domicile sont contenus dans 3 variables utilisateurs
    
    local DarkSkyAPIkey = domoticz.variables('api_forecast_io').value
    local geolocalisation = domoticz.variables('Latitude').value..","..domoticz.variables('Longitude').value

    If you want to enter this information directly into the script, comment on the two lines above, uncomment the following two lines
    Si vous souhaitez inscrire ces informations dans le script, commentez les deux lignes ci-dessus, décommentez les deux lignes suivantes
    
    --local DarkSkyAPIkey = "1a2bf34bf56c78901f2345f6d7890f12"
    --local geolocalisation = "45.87,1.30" -- latitude,longitude 
    
    by personalizing them with your personal data
    finally, you can choose the level of logs, only one level can be active; comment on others in the section
    en les personnalisant avec vos données personnelles. 
    enfin vous pouvez choisir le niveau de "verbiage" des logs, seulement un niveau peut être actif; commenter les autres dans la section logging
]]--
proba_pluie_h[1]= "Proba Pluie 1h"     			
proba_pluie_h[2]= "Proba Pluie 2h"     			 
proba_pluie_h[3]= nil    			            
proba_pluie_h[4]= "Proba Pluie 4h"    			
proba_pluie_h[5]= nil    			            
proba_pluie_h[6]= "Proba Pluie 6h"   			
proba_pluie_h[12]= "Proba Pluie 12h"    		
proba_pluie_h[24]= 508   			
proba_pluie_h[36]= nil   			            
proba_pluie_h[48]= nil   			            
                                                     
return {
    active = true,
    on      =   {   timer           =   { 'every 30 minutes' },  -- remember only 1000 requests by day, 30mn = 48 requests
                    httpResponses   =   { "trigger" }    -- Trigger the handle Json part
                },

  logging =   { -- level    =   domoticz.LOG_INFO,                                             -- Seulement un niveau peut être actif; commenter les autres
                -- level    =   domoticz.LOG_ERROR,                                            -- Only one level can be active; comment others
                level    =   domoticz.LOG_DEBUG,
                -- level    =   domoticz.LOG_MODULE_EXEC_INFO,
                marker    =   "Darksky Rain Probability v1.0 "      },

   data    =   {   rainForecast     = {initial = {} },             -- Keep a copy of last json just in case
   },
    execute = function(domoticz, item)
        local DarkSkyAPIkey = domoticz.variables('api_forecast_io').value
        local geolocalisation = domoticz.variables('Latitude').value..","..domoticz.variables('Longitude').value 
        --local DarkSkyAPIkey = "1a2bf34bf56c78901f2345f6d7890f12"
        --local geolocalisation = "45.87,1.30" -- latitude,longitude

        local Forecast_url  = "https://api.darksky.net/forecast/"  -- url
        local extraData = "?units=ca&exclude=currently,minutely,daily,alerts,flags" 

        local function debugMessage(message)
            domoticz.log(message,domoticz.LOG_DEBUG)
        end
        
        if (item.isTimer) then
            domoticz.openURL({
                url = Forecast_url..DarkSkyAPIkey.."/"..geolocalisation..extraData,
                callback = 'trigger'
            })

        end
        if (item.isHTTPResponse and item.ok) then
            -- we know it is json but dzVents cannot detect this
            -- convert to Lua
            local json = domoticz.utils.fromJSON(item.data)
            -- json is now a Lua table
            if #item.data > 0 then
                domoticz.data.rainForecast    = domoticz.utils.fromJSON(item.data)
                rt = domoticz.utils.fromJSON(item.data)
            else
                domoticz.log("Problem with response from DarkSky (no data) using data from earlier run",domoticz.LOG_ERROR)
                rt  = domoticz.data.rainForecast                        -- json empty. Get last valid from domoticz.data
                if #rt < 1 then                                         -- No valid data in domoticz.data either
                    domoticz.log("No previous data. are DarkSkyAPIkey and geolocalisation ok?",domoticz.LOG_ERROR)
                    return false
                end
            end    
            debugMessage("heure systeme")
            debugMessage(os.date('%Y-%m-%d %H:%M:%S', time))
            
            local now = tonumber(os.time(os.date("*t")))
            j = 1
            for i = 1,48 do

                 if now > tonumber(json.hourly.data[j].time) then 
                    local h = domoticz.utils.round((now - tonumber(json.hourly.data[j].time)) / 3600,0)
                    j = j+h
                    debugMessage("j : "..j)
                     
                end 
                 
                    if proba_pluie_h[i] then  
                            debugMessage("heure "..i)
                            debugMessage(os.date('%Y-%m-%d %H:%M:%S', json.hourly.data[j].time))
                            debugMessage(json.hourly.data[j].time)
                            debugMessage(json.hourly.data[j].precipProbability)
                            domoticz.devices(proba_pluie_h[i]).updatePercentage(json.hourly.data[j].precipProbability*100)
                    end
                if j == 48 then break end    
                j = j +1
                
            end    
        end
    end   
}
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Tonio16
Messages : 248
Enregistré le : 13 oct. 2017, 17:00

Re: DZVents : DarkSky et probabilité de pluie

Message par Tonio16 » 17 sept. 2018, 21:37

Papoo

Quelques questions...

Les variables utilisateur pour la clé APi et les coordonnées géographiques, de quels types sont elles ?
Le script est-il bien du type timer?
Les devices a ajouter sont de quel type?

Merci

Antoine
Domoticz V4.9700 sous raspbian-Stretch
Raspberry Pi B+ avec Clé Z-Wave Plus Z-Stick GEN5 - Aeon Labs
Raspberry Pi 3B+ avec RFLink

papoo
Messages : 1381
Enregistré le : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

Re: DZVents : DarkSky et probabilité de pluie

Message par papoo » 17 sept. 2018, 21:45

Les variables utilisateurs sont de type chaine
c'est un script dzvents à placer dans le répertoire /home/pi/domoticz/scripts/dzVents/scripts/
pas besoin de mettre script_time dans le nom dzvents réagit selon le contenu du script pas de son nom.
les dummy devices sont de type pourcentage
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github

Tonio16
Messages : 248
Enregistré le : 13 oct. 2017, 17:00

Re: DZVents : DarkSky et probabilité de pluie

Message par Tonio16 » 18 sept. 2018, 08:20

Je l'ai mis directement dans événement sous Dzevent en timer. Cela semble être ok ce matin.

Antoine
Domoticz V4.9700 sous raspbian-Stretch
Raspberry Pi B+ avec Clé Z-Wave Plus Z-Stick GEN5 - Aeon Labs
Raspberry Pi 3B+ avec RFLink

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Doudy
Messages : 137
Enregistré le : 07 mai 2016, 17:23

Re: DZVents : DarkSky et probabilité de pluie

Message par Doudy » 24 sept. 2018, 08:35

question pratique : C'est gratuit l'utilisation sur Darksky?

Pay-as-you-go ?
Ca veux dire quoi ?

;)
PI 1
PI 2 = RFXCOM
PI 3 + Touchscreen 7" = Domoticz
RFXCOM 433

papoo
Messages : 1381
Enregistré le : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

Re: DZVents : DarkSky et probabilité de pluie

Message par papoo » 24 sept. 2018, 13:12

Doudy a écrit :
24 sept. 2018, 08:35
question pratique : C'est gratuit l'utilisation sur Darksky?

Pay-as-you-go ?
Ca veux dire quoi ?

;)
Pay-as-you-go = Payez au fur et à mesure
L'utilisation de l'API Darksky est gratuite jusqu’à 1000 requêtes par jour, si ton besoin est supérieur à cela tu as la possibilité de payer le service que tu souhaites en fonction de ton besoin. mais pour revenir à ce qui nous intéresse ici, en ne faisant que 2 requêtes par heure on est loin de dépasser les 1000 requêtes gratuites
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github

Doudy
Messages : 137
Enregistré le : 07 mai 2016, 17:23

Re: DZVents : DarkSky et probabilité de pluie

Message par Doudy » 24 sept. 2018, 13:18

Merci
;)
PI 1
PI 2 = RFXCOM
PI 3 + Touchscreen 7" = Domoticz
RFXCOM 433

hestia
Messages : 18
Enregistré le : 12 sept. 2018, 22:36

Re: DZVents : DarkSky et probabilité de pluie

Message par hestia » 07 oct. 2018, 23:27

Bonjour
dans la même idée j'ai repris toute la météo Darsky en dzVents en ajoutant les probabilités de pluie, en prenant plutôt l'espérance de pluie au sens proba: proba x quantité.
Cela permet de s'affranchir de DarkSky (Weather Lookup) de base de Domoticz qui est bien, mais lorsque l'on veut avoir d'autres infos, cela augmente le nombre de requêtes. En ayant tout dans la même requête, le nombre d'accès est maîtrisé: 250 par jour pour une mise à jour toutes les 5 minutes.
Il reste quelques finitions à faire dans le script (voir les commentaires...) mais le script est opérationnel. Les résultats sont mis dans des sensors.
Possible d'ajouter les valeurs que l'on veut...

Code : Tout sélectionner

--[[ Script to get some values from darksky API and calculate rain expectation for next hours

from https://www.domoticz.com/forum/viewtopic.php?t=22090 (Cloud cover from darksky by aleph0)

to read: https://darksky.net/dev/docs
]]--
local debug=0
local DOMAIN = ':Meteo'
local TIME_INTERVAL = 'every 5 minutes' -- 'every ...'
local coord='43.810521,3.280379' -- latitude,longitude
local api_key='4fc221xxxxxxxxxxxxxeda13ae30b6c' -- darkSky secret key

-- Devices to update with API result
local dev_temp_hum_baro = 299 -- dummy receive Temp+Hum+Baro / Type Temp + Humidity + Baro
local dev_temperature = 300 -- dummy receive temperature / Type Temp
local dev_rain = 301 -- dummy receive rain in mm / Type Rain
local dev_humidity = 302 -- dummy receive humidity / Type Humidity
local dev_barometer = 303 -- dummy receive pressure / SubType Barometer
local dev_wind = 298 -- dummy receive wind measures (Vent+Temp+Ressentie) / Type Wind
local dev_cloudCover = 309 -- dummy receive cloudCover / SubType Custom Sensor
local dev_uvIndex = 306 -- dummy receive uvIndex / Type UV
local dev_visibility = 310 -- dummy receive visibility / SubType Visibility
local dev_ozone = 308 -- dummy receive ozone / SubType Custom Sensor

-- Devices to update with calculation with API result
local dev_Rain1h = 297 -- dummy receive 1h expected rain in mm / Type Rain
local dev_Rain12h = 295 -- dummy receive 12h expected rain in mm / Type Rain
local dev_Rain24h = 296 -- dummy receive 24h expected rain in mm / Type Rain

return {
	active = true,
	logging = {
		level = domoticz.LOG_ERROR, -- Select one of LOG_DEBUG, LOG_INFO, LOG_ERROR, LOG_FORCE to override system log level
		marker = DOMAIN},
	on = {
--		devices = {203},   -- a switch for testing w/o waiting minutes
		timer = {TIME_INTERVAL},
		httpResponses = {'getDarkSkyForecast'}
	},
	execute = function(dz, triggerObject)
	    
	    -- /// Functions start \\\
    	local function string2Epoch(dateString) -- seconds from epoch based on stringdate (used by string2Date) -- Assuming a date pattern like: yyyy-mm-dd
    		local pattern = '(%d+)-(%d+)-(%d+)'
    		local runyear, runmonth, runday= dateString:match(pattern)
    		local convertedTimestamp = os.time({year = runyear, month = runmonth, day = runday})
    		return convertedTimestamp
    	end
    	
    	local function string2Date(str,fmt) -- convert string from json into datevalue
    		if fmt then
    			return os.date(fmt,string2Epoch(str))
    		end
    		return os.date(' %A %d %B, %Y',string2Epoch(str)):gsub(' 0',' ')
    	end
    	
    	local function round(num, dec)
    		if num == 0 then
    			return 0
    		else
    			local mult = 10^(dec or 0)
    			return math.floor(num * mult + 0.5) / mult
    		end
    	end
    	
    	local function humidity_status(humidity_val) -- humidity in %
    		local status = dz.HUM_NORMAL
    		if humidity_val > 69 then status = dz.HUM_WET
    			elseif humidity_val < 30 then status = dz.HUM_DRY
    			elseif humidity_val < 45 then status = dz.HUM_NORMAL
    			else status = dz.HUM_COMFORTABLE
    		end
    		return status
    	end
    	
        local function THBForecast_calc(icon_val)
            local THBForecast_val = dz.BARO_NOINFO
            if icon_val == "" or icon_val == "wind" then THBForecast_val = dz.BARO_NOINFO
            	elseif icon_val == "clear-day" or icon_val == "clear-night" then THBForecast_val = dz.BARO_SUNNY
            	elseif icon_val == "partly-cloudy-day" or icon_val == "partly-cloudy-night" then THBForecast_val = dz.BARO_PARTLYCLOUDY
            	elseif icon_val == "sleet" or icon_val == "fog"  or  icon_val == "cloudy" then THBForecast_val = dz.BARO_CLOUDY
	          	elseif icon_val == "rain" or icon == "snow" then THBForecast_val=dz.BARO_RAIN
            end
            if debug == 1 then
                print('icon_val: ' .. icon_val)
                print('THBForecast_val: ' .. THBForecast_val)
            end
            return THBForecast_val
        end
        
        local function baroForecast_calc(icon_val) -- to improve
            local baroForecast_val = dz.BARO_NOINFO
            if icon_val == "wind" then baroForecast_val = dz.BARO_UNSTABLE
            	elseif icon_val == "clear-day" or icon_val == "clear-night" then baroForecast_val = dz.BARO_SUNNY
            	elseif icon_val == "partly-cloudy-day" or icon_val == "partly-cloudy-night" then baroForecast_val = dz.BARO_STABLE
            	elseif icon_val == "sleet" or icon_val == "fog"  or  icon_val == "cloudy" then baroForecast_val = dz.BARO_CLOUDY
	          	elseif icon_val == "rain" or icon == "snow" then baroForecast_val=dz.BARO_UNSTABLE
            end
            if debug == 1 then
                print('icon_val: ' .. icon_val)
                print('baroForecast_val: ' .. baroForecast_val)
            end
            return baroForecast_val
        end   
  
    	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
    	
    	local function windDirection_calc(windBearing_val) -- Wind direction calculation
    		if (windBearing_val < 11.25) then wind_direction_val = 'N'
    			elseif (windBearing_val >= 11.25 and windBearing_val < 33.75) then wind_direction_val = 'NNE'
    			elseif (windBearing_val >= 33.75 and windBearing_val < 56.25) then wind_direction_val = 'NE'
    			elseif (windBearing_val >= 56.25 and windBearing_val < 78.75) then wind_direction_val = 'ENE'
    			elseif (windBearing_val >= 78.75 and windBearing_val < 101.25) then wind_direction_val = 'E'
    			elseif (windBearing_val >= 101.25 and windBearing_val < 123.75) then wind_direction_val = 'ESE'
    			elseif (windBearing_val >= 123.75 and windBearing_val < 146.25) then wind_direction_val = 'SE'
    			elseif (windBearing_val >= 146.25 and windBearing_val < 168.75) then wind_direction_val = 'SSE'
    			elseif (windBearing_val >= 168.75 and windBearing_val < 191.25) then wind_direction_val = 'S'
    			elseif (windBearing_val >= 191.25 and windBearing_val < 213.75) then wind_direction_val = 'SSW'
    			elseif (windBearing_val >= 213.75 and windBearing_val < 236.25) then wind_direction_val = 'SW'
    			elseif (windBearing_val >= 236.25 and windBearing_val < 258.75) then wind_direction_val = 'WSW'
    			elseif (windBearing_val >= 258.75 and windBearing_val < 281.25) then wind_direction_val = 'W'
    			elseif (windBearing_val >= 281.25 and windBearing_val < 303.75) then wind_direction_val = 'WNW'
    			elseif (windBearing_val >= 303.75 and windBearing_val < 326.25) then wind_direction_val = 'NW'
    			elseif (windBearing_val >= 326.25 and windBearing_val < 348.75) then wind_direction_val = 'NNW'
    			else wind_direction_val = 'N'
    		end
    		return wind_direction_val
    	end
    	-- \\\ Functions end ///
    	
    	
        if (triggerObject.isDevice or triggerObject.isTimer) then   -- triggerObject.isDevic for testing only
    		local darkSkyUrl = 'https://api.darksky.net/forecast/'..api_key..'/'..coord..'?lang=fr&units=ca&exclude=minutely,daily,alerts,flags'
    		dz.log('*** Request url', dz.LOG_FORCE)
			if debug==1 then
			    print('url: ' .. darkSkyUrl)
		    end
    		dz.openURL({url = darkSkyUrl, method = 'GET', callback = 'getDarkSkyForecast'})
    	elseif (triggerObject.isHTTPResponse) then
    	   	dz.log('*** Response...', dz.LOG_FORCE)
    	   	if (triggerObject.ok) then
    		    if debug==1 then
        			print('triggerObject ok')
        			print('trigger: ' .. triggerObject.trigger)
        			print('callback: ' .. triggerObject.callback)
        			print('statusCode: ' .. triggerObject.statusCode)
        		end
    			if (triggerObject.isJSON) then
    				local currently_time = os.date('%x %X', triggerObject.json.currently.time)
    				if debug==1 then
        				print ('JSON :-)')
        				print ('latitude: ' ..triggerObject.json.latitude)
        				print ('longitude: ' ..triggerObject.json.longitude)
        				print ('timezone: ' ..triggerObject.json.timezone)
        				print('time UNIX: '.. triggerObject.json.currently.time)
        				print('time: '.. currently_time)
    				end
    				-- triggerObject.json.flags.nearest-station) -- to add, but how to do with '-' in the json attributes?????
    		
                	local nillCount = 0 -- to count nill values from dark Sky
                	local nillCountH = 0 -- to count nill values from dark Sky (hourly data)
                	-- Variables to calcule rain forecast
                	local hourlyPrecipIntensity = {initial={}}
                	local hourlyPrecipProbability = {initial={}}
                	local hourlyPrecipExpectation = {initial={}}
                	local hourlyTime= {initial={}}
                	local h1PrecipExpectation = 0
                	local h12PrecipExpectation = 0
                	local h24PrecipExpectation = 0
                	local h1PrecipMax = 0
                	local h12PrecipMax = 0
                	local h24PrecipMax = 0

                	-- Retrieve values from dz in case of nill values from json
                	local dz_rainRate = dz.devices(dev_rain).rainRate
                	local dz_rain = dz.devices(dev_rain).rain
                	local dz_humidity = dz.devices(dev_humidity).humidity
                	local dz_temperature = dz.devices(dev_temperature).temperature
                	local dz_dewPoint = dz.devices(dev_temp_hum_baro).dewPoint
                	local dz_pressure = dz.devices(dev_barometer).barometer
                	local dz_baroForecast = dz.devices(dev_barometer).forecast
                	local dz_THBForecast = dz.devices(dev_barometer).forecast
                	local dz_windBearing = dz.devices(dev_wind).direction
                	local dz_windSpeed_ms = dz.devices(dev_wind).speed
                	local dz_windGust_ms = dz.devices(dev_wind).gust
                	
                	if debug==1 then
                	    print'dz values'
                		print('dz_rainRate: ' .. dz_rainRate)
                		print('dz_rain: ' .. dz_rain)
                		print('dz_humidity: ' .. dz_humidity)
                		print('dz_temperature: ' .. dz_temperature)
                		print('dz_dewPoint: ' .. dz_dewPoint)
                		print('dz_pressure: ' .. dz_pressure)
                		print('dz_baroForecast: ' .. dz_baroForecast)
                		print('dz_THBForecast: ' .. dz_THBForecast)
                		print('dz_windBearing: ' .. dz_windBearing)
                		print('dz_windSpeed_ms: ' .. dz_windSpeed_ms)
                		print('dz_windGust_ms: ' .. dz_windGust_ms)
                		print('Dark Sky values')
                		print('precipIntensity: ' ..  triggerObject.json.currently.precipIntensity)
                        print('precipProbability: ' ..  triggerObject.json.currently.precipProbability)
                        print('humidity: ' ..  triggerObject.json.currently.humidity)
                        print('temperature: ' ..  triggerObject.json.currently.temperature)
                        print('pressure: ' ..  triggerObject.json.currently.pressure)
                        print('icon: ' ..  triggerObject.json.currently.icon)
                        print('windSpeed: ' ..  triggerObject.json.currently.windSpeed)
                        print('windBearing: ' ..  triggerObject.json.currently.windBearing)
                        print('windGust: ' ..  triggerObject.json.currently.windGust)
                        print('dewPoint : ' ..  triggerObject.json.currently.dewPoint)
                        print('cloudCover: ' ..  triggerObject.json.currently.cloudCover)
                        print('uvIndex: ' ..  triggerObject.json.currently.uvIndex)
                        print('visibility: ' ..  triggerObject.json.currently.visibility)
                        print('ozone: ' ..  triggerObject.json.currently.ozone)
                	end
    	
    				-- get with values from json and if not nill, update the devices with Dark Sky values ; if nill keep dz values
    				local hum_status = '' --
    				if triggerObject.json.currently.precipIntensity ~= nill then
    				dz_rainRate = round(triggerObject.json.currently.precipIntensity*100,-1)
    					if triggerObject.json.currently.precipProbability ~= nill then
    					dz_rain = round(triggerObject.json.currently.precipIntensity * triggerObject.json.currently.precipProbability,1)
    					else nillCount = nillCount + 1
    					end
    				end -- else dz value is kept
    				dz.devices(dev_rain).updateRain(dz_rainRate,dz_rain)
    			
    				if triggerObject.json.currently.humidity ~= nill then
    					dz_humidity = triggerObject.json.currently.humidity*100
    					local hum_status = humidity_status(dz_humidity) dz.devices(dev_humidity).updateHumidity(dz_humidity, hum_status)
    					else nillCount = nillCount + 1
    				end
    			
    				if triggerObject.json.currently.temperature ~= nill then
    					dz_temperature = round(triggerObject.json.currently.temperature,1) dz.devices(dev_temperature).updateTemperature(dz_temperature)
    					else nillCount = nillCount + 1
    				end
    				
    				if triggerObject.json.currently.pressure ~= nill then
    					dz_pressure = round(triggerObject.json.currently.pressure,0)
    					else nillCount = nillCount + 1
    				end
    				
    				if triggerObject.json.currently.icon ~= nill then
    					dz_baroForecast = baroForecast_calc(triggerObject.json.currently.icon)
    					else nillCount = nillCount + 1
    				end
    				dz.devices(dev_barometer).updateBarometer(dz_pressure, dz_baroForecast)
    				
    				local tempChill = 0
    				if triggerObject.json.currently.windSpeed ~= nill then
    					tempChill = TempChill_calc(dz_temperature, triggerObject.json.currently.windSpeed)
    					dz_windSpeed_ms = round(triggerObject.json.currently.windSpeed/3.6,1) -- convert km/h in m/s
					else tempChill = TempChill_calc(dz_temperature, dz_windSpeed_ms*3,6) -- convert m/s in km/h
					    nillCount = nillCount + 1
    				end
    				
    				if triggerObject.json.currently.windBearing ~= nill then
    					dz_windBearing = triggerObject.json.currently.windBearing
    					else nillCount = nillCount + 1
    				end
    				
    				local wind_direction = windDirection_calc(dz_windBearing)
    					if debug==1 then
    					print ('dz_windBearing: ' .. dz_windBearing)
    					print('wind_direction: ' .. wind_direction)
    				end
    				
    				if triggerObject.json.currently.windGust ~= nill then
    					dz_windGust_ms = round(triggerObject.json.currently.windGust/3.6,1)
    					else nillCount = nillCount + 1
    				end
    				
    				if triggerObject.json.currently.icon ~= nill then
    					dz_THBForecast = THBForecast_calc(triggerObject.json.currently.icon)
    					else nillCount = nillCount + 1
    				end
    				dz.devices(dev_wind).updateWind(dz_windBearing, wind_direction, dz_windSpeed_ms, dz_windGust_ms, dz_temperature,tempChill)
    				dz.devices(dev_temp_hum_baro).updateTempHumBaro(dz_temperature,dz_humidity,hum_status,dz_pressure,dz_THBForecast)
    				
    				if triggerObject.json.currently.dewPoint ~= nill then
    					dz_dewPoint = triggerObject.json.currently.dewPoint
    					dz.devices(dev_temp_hum_baro).dewPoint = triggerObject.json.currently.dewPoint -- doesn't work !? :-(
    					else nillCount = nillCount + 1
    				end
    
    				if triggerObject.json.currently.cloudCover ~= nill then
    					dz.devices(dev_cloudCover).updateCustomSensor(triggerObject.json.currently.cloudCover)
    					else nillCount = nillCount + 1
    				end
    
    				if triggerObject.json.currently.uvIndex ~= nill then
    					dz.devices(dev_uvIndex).updateUV(triggerObject.json.currently.uvIndex)
    					else nillCount = nillCount + 1
    				end
    
    				if triggerObject.json.currently.visibility ~= nill then
    					dz.devices(dev_visibility).updateVisibility(triggerObject.json.currently .visibility)
    					else nillCount = nillCount + 1
    				end
    
    				if triggerObject.json.currently.ozone ~= nill then
    					dz.devices(dev_ozone).updateCustomSensor(round(triggerObject.json.currently.ozone))
    					else nillCount = nillCount + 1
    				end
    
    				-- Rain forecast calculation --
    				for i = 1, 25 do -- walk the hourly result for 24 hours (maxi = 49)
    				    if triggerObject.json.hourly.data[i].precipIntensity ~= nill then
    				    	hourlyPrecipIntensity[i] = triggerObject.json.hourly.data[i].precipIntensity
        					if triggerObject.json.hourly.data[i].precipProbability ~= nill then
        					    hourlyPrecipProbability[i] = triggerObject.json.hourly.data[i].precipProbability
        					    hourlyPrecipExpectation[i] = hourlyPrecipIntensity[i] * hourlyPrecipProbability[i]
            					if i == 1 then -- for the next hour
            						h1PrecipExpectation = hourlyPrecipExpectation[i]
            						h1PrecipMax = triggerObject.json.hourly.data[i].precipIntensity
            					end
            					if i < 13 then -- for the next 12 hours
            						h12PrecipExpectation = h12PrecipExpectation + hourlyPrecipExpectation[i]
            						if h12PrecipMax < triggerObject.json.hourly.data[i].precipIntensity then
            							h12PrecipMax = triggerObject.json.hourly.data[i].precipIntensity
            						end
            					end
            					h24PrecipExpectation = h24PrecipExpectation + hourlyPrecipExpectation[i]
            					if h24PrecipMax < triggerObject.json.hourly.data[i].precipIntensity then
            						h24PrecipMax = triggerObject.json.hourly.data[i].precipIntensity
            					end
            					if triggerObject.json.hourly.data[i] ~= nill then
            					    hourlyTime[i] = os.date('%x %X', triggerObject.json.hourly.data[i].time)
        					    else  hourlyTime[i] = 0
            					end
          					else nillCountH = nillCountH + 1
              					hourlyPrecipProbability[i] = 0
              					hourlyPrecipExpectation[i] = 0
        					end
    					else nillCountH = nillCountH + 1
    					    hourlyPrecipIntensity[i] = 0
    					    hourlyPrecipProbability[i] = 0
    					    hourlyPrecipExpectation[i] = 0
    					end
    				    if debug==1 then
    					    print( i .. ' ' .. hourlyTime[i] .. ' precipIntensity: ' .. hourlyPrecipIntensity[i] .. ' precipProbability: ' .. hourlyPrecipProbability[i] .. ' expectation: ' .. hourlyPrecipExpectation[i])
    				    end
    				end
    				h1PrecipMax = round((h1PrecipMax*100),-2)
    				h12PrecipMax = round((h12PrecipMax*100),-2)
    				h24PrecipMax = round((h24PrecipMax*100),-2)
    				dz.devices(dev_Rain1h).updateRain(h1PrecipMax, round(h1PrecipExpectation,1)) dz.devices(dev_Rain12h).updateRain(h12PrecipMax, round(h12PrecipExpectation,1))
    				dz.devices(dev_Rain24h).updateRain(h24PrecipMax, round(h24PrecipExpectation,1))
    
            		if nillCount == 0 and nillCountH == 0 then
                        dz.log('Meteo Dark Sky end OK', dz.LOG_FORCE)
                    else dz.log('Meteo Dark Sky end KO : ' .. nillCount .. ' / ' .. nillCountH, dz.LOG_ERROR)
                    end
    
                else dz.log('NO JSON ???' , dz.LOG_ERROR)
        		end
        		
    	    else dz.log('Response KO !!!' , dz.LOG_ERROR)
            end
        else dz.log('Error triggerObject !!!' , dz.LOG_ERROR)
        end
    end
}
Je mettrais bien quelques images des sensors, mais je ne sais pas comment :-(

cyberbob
Messages : 365
Enregistré le : 28 nov. 2016, 19:43
Localisation : Belgique

Re: DZVents : DarkSky et probabilité de pluie

Message par cyberbob » 08 oct. 2018, 22:06

papoo a écrit :
17 sept. 2018, 17:58
J'anticipe une éventuelle disparation définitive de l'API Weather underground en me tournant vers une autre API celle de DarkSky
Salut,
Merci pour ton script, je vais tester, et comparer par la suite les valeurs proba pluie en fonction de ce qui est indiqué sur le site https://darksky.net

A propos des probabilité, je suppose que pluie/neige/grêle sont tous repris dans pluie ?
Peut-on mettre d'autres probabilité dans le script comme mettre un seuil pour le vent, la température ?
Domoticz Stable V4.9700 sur Synology DSM 6.2 / 2 x RFlink V48.4 - 433.92MHz & 433.42MHz / Script en LUA & Blocky

papoo
Messages : 1381
Enregistré le : 10 janv. 2016, 11:29
Localisation : Limoges (87)
Contact :

Re: DZVents : DarkSky et probabilité de pluie

Message par papoo » 10 oct. 2018, 22:44

oui les prévisions sont pour toutes les précipitations
voici un exemple des infos contenues dans une requête

Code : Tout sélectionner

hourly: {
summary: "Partly cloudy tomorrow morning.",
icon: "partly-cloudy-night",
data: [
{
time: 1537002000,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0.012,
temperature: 18.31,
apparentTemperature: 18.31,
dewPoint: 8.93,
humidity: 0.54,
pressure: 1024.47,
windSpeed: 14.58,
windGust: 15.05,
windBearing: 60,
cloudCover: 0,
uvIndex: 3,
visibility: 12.2,
ozone: 289.81
},
{
time: 1537005600,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0.12,
temperature: 19.92,
apparentTemperature: 19.92,
dewPoint: 8.97,
humidity: 0.49,
pressure: 1024.09,
windSpeed: 13.12,
windGust: 14.37,
windBearing: 54,
cloudCover: 0,
uvIndex: 5,
visibility: 16.09,
ozone: 290.56
},
{
time: 1537009200,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0.9,
temperature: 21.07,
apparentTemperature: 21.07,
dewPoint: 8.57,
humidity: 0.45,
pressure: 1023.61,
windSpeed: 11.75,
windGust: 12.65,
windBearing: 44,
cloudCover: 0,
uvIndex: 6,
visibility: 16.09,
ozone: 291.38
},
{
time: 1537012800,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 22.37,
apparentTemperature: 22.37,
dewPoint: 8.29,
humidity: 0.41,
pressure: 1023.09,
windSpeed: 11.47,
windGust: 11.72,
windBearing: 37,
cloudCover: 0,
uvIndex: 6,
visibility: 16.09,
ozone: 291.85
},
{
time: 1537016400,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 23.41,
apparentTemperature: 23.41,
dewPoint: 8.36,
humidity: 0.38,
pressure: 1022.54,
windSpeed: 11.86,
windGust: 12.23,
windBearing: 37,
cloudCover: 0,
uvIndex: 5,
visibility: 16.09,
ozone: 291.91
},
{
time: 1537020000,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 23.87,
apparentTemperature: 23.87,
dewPoint: 8.51,
humidity: 0.38,
pressure: 1021.99,
windSpeed: 11.99,
windGust: 13.39,
windBearing: 38,
cloudCover: 0,
uvIndex: 4,
visibility: 16.09,
ozone: 291.69
},
{
time: 1537023600,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 23.59,
apparentTemperature: 23.59,
dewPoint: 8.61,
humidity: 0.38,
pressure: 1021.59,
windSpeed: 11.91,
windGust: 14.56,
windBearing: 40,
cloudCover: 0,
uvIndex: 2,
visibility: 16.09,
ozone: 291.5
},
{
time: 1537027200,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 22.14,
apparentTemperature: 22.14,
dewPoint: 8.62,
humidity: 0.42,
pressure: 1021.43,
windSpeed: 11.49,
windGust: 15.11,
windBearing: 38,
cloudCover: 0,
uvIndex: 1,
visibility: 16.09,
ozone: 291.44
},
{
time: 1537030800,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 19.69,
apparentTemperature: 19.69,
dewPoint: 8.51,
humidity: 0.48,
pressure: 1021.43,
windSpeed: 10.91,
windGust: 15.63,
windBearing: 36,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 291.48
},
{
time: 1537034400,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 17.86,
apparentTemperature: 17.86,
dewPoint: 8.22,
humidity: 0.53,
pressure: 1021.51,
windSpeed: 10.56,
windGust: 17.22,
windBearing: 38,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 291.57
},
{
time: 1537038000,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 16.38,
apparentTemperature: 16.38,
dewPoint: 7.64,
humidity: 0.56,
pressure: 1021.77,
windSpeed: 10.64,
windGust: 21.71,
windBearing: 45,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 291.86
},
{
time: 1537041600,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 15.19,
apparentTemperature: 15.19,
dewPoint: 6.92,
humidity: 0.58,
pressure: 1022.1,
windSpeed: 10.9,
windGust: 27.25,
windBearing: 56,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 292.25
},
{
time: 1537045200,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 14.12,
apparentTemperature: 14.12,
dewPoint: 6.38,
humidity: 0.6,
pressure: 1022.25,
windSpeed: 10.75,
windGust: 29.15,
windBearing: 67,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 292.48
},
{
time: 1537048800,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 13.14,
apparentTemperature: 13.14,
dewPoint: 6.18,
humidity: 0.63,
pressure: 1022.04,
windSpeed: 9.78,
windGust: 23.88,
windBearing: 72,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 292.49
},
{
time: 1537052400,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 12.27,
apparentTemperature: 12.27,
dewPoint: 6.16,
humidity: 0.66,
pressure: 1021.64,
windSpeed: 8.4,
windGust: 15,
windBearing: 76,
cloudCover: 0,
uvIndex: 0,
visibility: 16.09,
ozone: 292.37
},
{
time: 1537056000,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 11.51,
apparentTemperature: 11.51,
dewPoint: 6.07,
humidity: 0.69,
pressure: 1021.28,
windSpeed: 7.13,
windGust: 8.29,
windBearing: 83,
cloudCover: 0.01,
uvIndex: 0,
visibility: 16.09,
ozone: 292.37
},
{
time: 1537059600,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 10.73,
apparentTemperature: 10.73,
dewPoint: 5.85,
humidity: 0.72,
pressure: 1021.05,
windSpeed: 6.2,
windGust: 6.68,
windBearing: 96,
cloudCover: 0.11,
uvIndex: 0,
visibility: 16.09,
ozone: 292.43
},
{
time: 1537063200,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 10.02,
apparentTemperature: 10.02,
dewPoint: 5.59,
humidity: 0.74,
pressure: 1020.86,
windSpeed: 5.41,
windGust: 6.58,
windBearing: 113,
cloudCover: 0.25,
uvIndex: 0,
visibility: 16.09,
ozone: 292.55
},
{
time: 1537066800,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 9.31,
apparentTemperature: 9.02,
dewPoint: 5.36,
humidity: 0.76,
pressure: 1020.75,
windSpeed: 4.88,
windGust: 6.94,
windBearing: 126,
cloudCover: 0.37,
uvIndex: 0,
visibility: 16.09,
ozone: 292.78
},
{
time: 1537070400,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 8.31,
apparentTemperature: 8.31,
dewPoint: 5.02,
humidity: 0.8,
pressure: 1020.71,
windSpeed: 4.67,
windGust: 6.63,
windBearing: 132,
cloudCover: 0.46,
uvIndex: 0,
visibility: 16.09,
ozone: 293.19
},
{
time: 1537074000,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 7.38,
apparentTemperature: 7.38,
dewPoint: 4.71,
humidity: 0.83,
pressure: 1020.73,
windSpeed: 4.65,
windGust: 6.47,
windBearing: 134,
cloudCover: 0.52,
uvIndex: 0,
visibility: 16.09,
ozone: 293.64
},
{
time: 1537077600,
summary: "Partly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 7.87,
apparentTemperature: 7.39,
dewPoint: 4.91,
humidity: 0.82,
pressure: 1020.77,
windSpeed: 4.89,
windGust: 6.92,
windBearing: 140,
cloudCover: 0.51,
uvIndex: 0,
visibility: 16.09,
ozone: 294.24
},
{
time: 1537081200,
summary: "Partly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 10.84,
apparentTemperature: 10.84,
dewPoint: 6.14,
humidity: 0.73,
pressure: 1020.79,
windSpeed: 5.36,
windGust: 8.53,
windBearing: 152,
cloudCover: 0.39,
uvIndex: 0,
visibility: 16.09,
ozone: 295.02
},
{
time: 1537084800,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 15.6,
apparentTemperature: 15.6,
dewPoint: 7.92,
humidity: 0.6,
pressure: 1020.83,
windSpeed: 6.05,
windGust: 10.73,
windBearing: 168,
cloudCover: 0.2,
uvIndex: 1,
visibility: 16.09,
ozone: 295.89
},
{
time: 1537088400,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 19.47,
apparentTemperature: 19.47,
dewPoint: 9.17,
humidity: 0.51,
pressure: 1020.78,
windSpeed: 6.89,
windGust: 12.28,
windBearing: 183,
cloudCover: 0.06,
uvIndex: 3,
visibility: 16.09,
ozone: 296.46
},
{
time: 1537092000,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 21.88,
apparentTemperature: 21.88,
dewPoint: 9.28,
humidity: 0.45,
pressure: 1020.57,
windSpeed: 8.06,
windGust: 12.62,
windBearing: 197,
cloudCover: 0.03,
uvIndex: 4,
visibility: 16.09,
ozone: 296.32
},
{
time: 1537095600,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 23.52,
apparentTemperature: 23.52,
dewPoint: 8.77,
humidity: 0.39,
pressure: 1020.26,
windSpeed: 9.3,
windGust: 12.3,
windBearing: 209,
cloudCover: 0.02,
uvIndex: 5,
visibility: 16.09,
ozone: 295.86
},
{
time: 1537099200,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 24.96,
apparentTemperature: 24.96,
dewPoint: 8.28,
humidity: 0.35,
pressure: 1019.94,
windSpeed: 9.9,
windGust: 11.76,
windBearing: 221,
cloudCover: 0.07,
uvIndex: 6,
visibility: 16.09,
ozone: 295.42
},
{
time: 1537102800,
summary: "Partly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 26,
apparentTemperature: 26,
dewPoint: 8.02,
humidity: 0.32,
pressure: 1019.54,
windSpeed: 9.5,
windGust: 11.2,
windBearing: 238,
cloudCover: 0.26,
uvIndex: 5,
visibility: 16.09,
ozone: 295.3
},
{
time: 1537106400,
summary: "Partly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 26.43,
apparentTemperature: 26.43,
dewPoint: 7.84,
humidity: 0.31,
pressure: 1019.09,
windSpeed: 8.48,
windGust: 10.43,
windBearing: 252,
cloudCover: 0.51,
uvIndex: 3,
visibility: 16.09,
ozone: 295.21
},
{
time: 1537110000,
summary: "Mostly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 26.04,
apparentTemperature: 26.04,
dewPoint: 7.91,
humidity: 0.32,
pressure: 1018.82,
windSpeed: 7.26,
windGust: 9.37,
windBearing: 247,
cloudCover: 0.71,
uvIndex: 2,
visibility: 16.09,
ozone: 295.39
},
{
time: 1537113600,
summary: "Mostly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 24.49,
apparentTemperature: 24.49,
dewPoint: 8.53,
humidity: 0.36,
pressure: 1018.83,
windSpeed: 5.62,
windGust: 7.66,
windBearing: 191,
cloudCover: 0.77,
uvIndex: 1,
visibility: 16.09,
ozone: 296.2
},
{
time: 1537117200,
summary: "Mostly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 21.66,
apparentTemperature: 21.66,
dewPoint: 9.41,
humidity: 0.46,
pressure: 1019.02,
windSpeed: 3.6,
windGust: 5.65,
windBearing: 111,
cloudCover: 0.8,
uvIndex: 0,
visibility: 16.09,
ozone: 297.27
},
{
time: 1537120800,
summary: "Mostly Cloudy",
icon: "partly-cloudy-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 19.34,
apparentTemperature: 19.34,
dewPoint: 9.78,
humidity: 0.54,
pressure: 1019.29,
windSpeed: 2.03,
windGust: 4.35,
windBearing: 42,
cloudCover: 0.82,
uvIndex: 0,
visibility: 16.09,
ozone: 298.04
},
{
time: 1537124400,
summary: "Mostly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 17.43,
apparentTemperature: 17.43,
dewPoint: 9.18,
humidity: 0.58,
pressure: 1019.73,
windSpeed: 2.24,
windGust: 4.28,
windBearing: 33,
cloudCover: 0.87,
uvIndex: 0,
visibility: 16.09,
ozone: 298.19
},
{
time: 1537128000,
summary: "Mostly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 15.83,
apparentTemperature: 15.83,
dewPoint: 8.11,
humidity: 0.6,
pressure: 1020.27,
windSpeed: 3.03,
windGust: 4.92,
windBearing: 63,
cloudCover: 0.93,
uvIndex: 0,
visibility: 16.09,
ozone: 298.1
},
{
time: 1537131600,
summary: "Overcast",
icon: "cloudy",
precipIntensity: 0,
precipProbability: 0,
temperature: 14.57,
apparentTemperature: 14.57,
dewPoint: 7.22,
humidity: 0.61,
pressure: 1020.62,
windSpeed: 3.67,
windGust: 5.55,
windBearing: 82,
cloudCover: 0.95,
uvIndex: 0,
visibility: 16.09,
ozone: 298.11
},
{
time: 1537135200,
summary: "Overcast",
icon: "cloudy",
precipIntensity: 0,
precipProbability: 0,
temperature: 13.78,
apparentTemperature: 13.78,
dewPoint: 6.77,
humidity: 0.63,
pressure: 1020.61,
windSpeed: 4.1,
windGust: 5.99,
windBearing: 87,
cloudCover: 0.94,
uvIndex: 0,
visibility: 16.09,
ozone: 298.37
},
{
time: 1537138800,
summary: "Mostly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 13.35,
apparentTemperature: 13.35,
dewPoint: 6.47,
humidity: 0.63,
pressure: 1020.41,
windSpeed: 4.51,
windGust: 6.42,
windBearing: 90,
cloudCover: 0.89,
uvIndex: 0,
visibility: 16.09,
ozone: 298.79
},
{
time: 1537142400,
summary: "Mostly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 12.99,
apparentTemperature: 12.99,
dewPoint: 6.23,
humidity: 0.64,
pressure: 1020.23,
windSpeed: 4.81,
windGust: 6.74,
windBearing: 94,
cloudCover: 0.81,
uvIndex: 0,
visibility: 16.09,
ozone: 299.4
},
{
time: 1537146000,
summary: "Mostly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 12.54,
apparentTemperature: 12.54,
dewPoint: 6.01,
humidity: 0.64,
pressure: 1020.05,
windSpeed: 4.89,
windGust: 6.82,
windBearing: 101,
cloudCover: 0.65,
uvIndex: 0,
visibility: 16.09,
ozone: 300.54
},
{
time: 1537149600,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 12.16,
apparentTemperature: 12.16,
dewPoint: 5.82,
humidity: 0.65,
pressure: 1019.88,
windSpeed: 4.88,
windGust: 6.78,
windBearing: 108,
cloudCover: 0.44,
uvIndex: 0,
visibility: 16.09,
ozone: 301.83
},
{
time: 1537153200,
summary: "Partly Cloudy",
icon: "partly-cloudy-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 11.74,
apparentTemperature: 11.74,
dewPoint: 5.8,
humidity: 0.67,
pressure: 1019.74,
windSpeed: 4.92,
windGust: 6.82,
windBearing: 115,
cloudCover: 0.28,
uvIndex: 0,
visibility: 16.09,
ozone: 302.55
},
{
time: 1537156800,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 11.03,
apparentTemperature: 11.03,
dewPoint: 5.8,
humidity: 0.7,
pressure: 1019.71,
windSpeed: 5.09,
windGust: 6.78,
windBearing: 121,
cloudCover: 0.21,
uvIndex: 0,
visibility: 16.09,
ozone: 302.02
},
{
time: 1537160400,
summary: "Clear",
icon: "clear-night",
precipIntensity: 0,
precipProbability: 0,
temperature: 10.32,
apparentTemperature: 10.32,
dewPoint: 5.95,
humidity: 0.74,
pressure: 1019.76,
windSpeed: 5.29,
windGust: 6.79,
windBearing: 128,
cloudCover: 0.18,
uvIndex: 0,
visibility: 16.09,
ozone: 300.88
},
{
time: 1537164000,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 10.89,
apparentTemperature: 10.89,
dewPoint: 6.65,
humidity: 0.75,
pressure: 1019.7,
windSpeed: 5.65,
windGust: 7.55,
windBearing: 135,
cloudCover: 0.16,
uvIndex: 0,
visibility: 16.09,
ozone: 299.94
},
{
time: 1537167600,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 13.86,
apparentTemperature: 13.86,
dewPoint: 8.45,
humidity: 0.7,
pressure: 1019.56,
windSpeed: 6.23,
windGust: 9.85,
windBearing: 141,
cloudCover: 0.1,
uvIndex: 0,
visibility: 16.09,
ozone: 299.5
},
{
time: 1537171200,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 18.5,
apparentTemperature: 18.5,
dewPoint: 10.92,
humidity: 0.61,
pressure: 1019.32,
windSpeed: 6.94,
windGust: 12.89,
windBearing: 148,
cloudCover: 0.04,
uvIndex: 1,
visibility: 16.09,
ozone: 299.38
},
{
time: 1537174800,
summary: "Clear",
icon: "clear-day",
precipIntensity: 0,
precipProbability: 0,
temperature: 22.44,
apparentTemperature: 22.44,
dewPoint: 12.86,
humidity: 0.55,
pressure: 1018.99,
windSpeed: 7.77,
windGust: 14.89,
windBearing: 156,
cloudCover: 0,
uvIndex: 3,
visibility: 16.09,
ozone: 299.29
}
]
},
daily: {
summary: "Light rain on Tuesday, with high temperatures peaking at 29°C on Monday.",
icon: "rain",
data: [
{
time: 1536962400,
summary: "Clear throughout the day.",
icon: "clear-day",
sunriseTime: 1536989660,
sunsetTime: 1537034907,
moonPhase: 0.2,
precipIntensity: 0,
precipIntensityMax: 0.0051,
precipIntensityMaxTime: 1536976800,
precipProbability: 0,
temperatureHigh: 23.87,
temperatureHighTime: 1537020000,
temperatureLow: 7.38,
temperatureLowTime: 1537074000,
apparentTemperatureHigh: 23.87,
apparentTemperatureHighTime: 1537020000,
apparentTemperatureLow: 7.38,
apparentTemperatureLowTime: 1537074000,
dewPoint: 7.94,
humidity: 0.56,
pressure: 1023.28,
windSpeed: 11.15,
windGust: 29.15,
windGustTime: 1537045200,
windBearing: 38,
cloudCover: 0.05,
uvIndex: 6,
uvIndexTime: 1537009200,
visibility: 16.09,
ozone: 289.39,
temperatureMin: 12.3,
temperatureMinTime: 1536987600,
temperatureMax: 23.87,
temperatureMaxTime: 1537020000,
apparentTemperatureMin: 12.3,
apparentTemperatureMinTime: 1536987600,
apparentTemperatureMax: 23.87,
apparentTemperatureMaxTime: 1537020000
},
{
time: 1537048800,
summary: "Mostly cloudy throughout the day.",
icon: "partly-cloudy-day",
sunriseTime: 1537076134,
sunsetTime: 1537121189,
moonPhase: 0.23,
precipIntensity: 0.0025,
precipIntensityMax: 0.0051,
precipIntensityMaxTime: 1537128000,
precipProbability: 0.01,
precipType: "rain",
temperatureHigh: 26.43,
temperatureHighTime: 1537106400,
temperatureLow: 10.32,
temperatureLowTime: 1537160400,
apparentTemperatureHigh: 26.43,
apparentTemperatureHighTime: 1537106400,
apparentTemperatureLow: 10.32,
apparentTemperatureLowTime: 1537160400,
dewPoint: 7.31,
humidity: 0.57,
pressure: 1020.34,
windSpeed: 2.86,
windGust: 23.88,
windGustTime: 1537048800,
windBearing: 156,
cloudCover: 0.4,
uvIndex: 6,
uvIndexTime: 1537099200,
visibility: 16.09,
ozone: 295.12,
temperatureMin: 7.38,
temperatureMinTime: 1537074000,
temperatureMax: 26.43,
temperatureMaxTime: 1537106400,
apparentTemperatureMin: 7.38,
apparentTemperatureMinTime: 1537074000,
apparentTemperatureMax: 26.43,
apparentTemperatureMaxTime: 1537106400
},
{
time: 1537135200,
summary: "Partly cloudy in the morning.",
icon: "partly-cloudy-night",
sunriseTime: 1537162608,
sunsetTime: 1537207471,
moonPhase: 0.26,
precipIntensity: 0,
precipIntensityMax: 0.0051,
precipIntensityMaxTime: 1537164000,
precipProbability: 0,
temperatureHigh: 28.59,
temperatureHighTime: 1537192800,
temperatureLow: 15.51,
temperatureLowTime: 1537246800,
apparentTemperatureHigh: 28.59,
apparentTemperatureHighTime: 1537192800,
apparentTemperatureLow: 15.51,
apparentTemperatureLowTime: 1537246800,
dewPoint: 10.11,
humidity: 0.57,
pressure: 1017.91,
windSpeed: 6.61,
windGust: 14.9,
windGustTime: 1537178400,
windBearing: 156,
cloudCover: 0.2,
uvIndex: 6,
uvIndexTime: 1537185600,
visibility: 16.09,
ozone: 300.24,
temperatureMin: 10.32,
temperatureMinTime: 1537160400,
temperatureMax: 28.59,
temperatureMaxTime: 1537192800,
apparentTemperatureMin: 10.32,
apparentTemperatureMinTime: 1537160400,
apparentTemperatureMax: 28.59,
apparentTemperatureMaxTime: 1537192800
},
{
time: 1537221600,
summary: "Light rain in the evening.",
icon: "rain",
sunriseTime: 1537249082,
sunsetTime: 1537293753,
moonPhase: 0.29,
precipIntensity: 0.2159,
precipIntensityMax: 1.1989,
precipIntensityMaxTime: 1537293600,
precipProbability: 0.29,
precipType: "rain",
temperatureHigh: 26.14,
temperatureHighTime: 1537275600,
temperatureLow: 15.08,
temperatureLowTime: 1537336800,
apparentTemperatureHigh: 26.18,
apparentTemperatureHighTime: 1537275600,
apparentTemperatureLow: 15.09,
apparentTemperatureLowTime: 1537336800,
dewPoint: 13.66,
humidity: 0.66,
pressure: 1015.93,
windSpeed: 10.65,
windGust: 38.83,
windGustTime: 1537232400,
windBearing: 170,
cloudCover: 0.29,
uvIndex: 5,
uvIndexTime: 1537268400,
visibility: 16.09,
ozone: 299.95,
temperatureMin: 15.51,
temperatureMinTime: 1537246800,
temperatureMax: 26.14,
temperatureMaxTime: 1537275600,
apparentTemperatureMin: 15.51,
apparentTemperatureMinTime: 1537246800,
apparentTemperatureMax: 26.18,
apparentTemperatureMaxTime: 1537275600
},
{
time: 1537308000,
summary: "Mostly cloudy throughout the day.",
icon: "partly-cloudy-day",
sunriseTime: 1537335556,
sunsetTime: 1537380034,
moonPhase: 0.32,
precipIntensity: 0.0838,
precipIntensityMax: 0.3708,
precipIntensityMaxTime: 1537387200,
precipProbability: 0.42,
precipType: "rain",
temperatureHigh: 25.89,
temperatureHighTime: 1537365600,
temperatureLow: 12.29,
temperatureLowTime: 1537423200,
apparentTemperatureHigh: 25.97,
apparentTemperatureHighTime: 1537365600,
apparentTemperatureLow: 12.29,
apparentTemperatureLowTime: 1537423200,
dewPoint: 15.6,
humidity: 0.77,
pressure: 1018.47,
windSpeed: 5.95,
windGust: 26.59,
windGustTime: 1537315200,
windBearing: 202,
cloudCover: 0.65,
uvIndex: 4,
uvIndexTime: 1537354800,
visibility: 16.09,
ozone: 288.95,
temperatureMin: 15.08,
temperatureMinTime: 1537336800,
temperatureMax: 25.89,
temperatureMaxTime: 1537365600,
apparentTemperatureMin: 15.09,
apparentTemperatureMinTime: 1537336800,
apparentTemperatureMax: 25.97,
apparentTemperatureMaxTime: 1537365600
},
{
time: 1537394400,
summary: "Mostly cloudy until evening.",
icon: "partly-cloudy-day",
sunriseTime: 1537422030,
sunsetTime: 1537466316,
moonPhase: 0.35,
precipIntensity: 0.0178,
precipIntensityMax: 0.2007,
precipIntensityMaxTime: 1537394400,
precipProbability: 0.26,
precipType: "rain",
temperatureHigh: 22.92,
temperatureHighTime: 1537455600,
temperatureLow: 10.35,
temperatureLowTime: 1537506000,
apparentTemperatureHigh: 22.92,
apparentTemperatureHighTime: 1537455600,
apparentTemperatureLow: 10.35,
apparentTemperatureLowTime: 1537506000,
dewPoint: 14.84,
humidity: 0.85,
pressure: 1020.65,
windSpeed: 1.83,
windGust: 13.28,
windGustTime: 1537452000,
windBearing: 333,
cloudCover: 0.67,
uvIndex: 4,
uvIndexTime: 1537441200,
visibility: 16.09,
ozone: 286.21,
temperatureMin: 12.29,
temperatureMinTime: 1537423200,
temperatureMax: 22.92,
temperatureMaxTime: 1537455600,
apparentTemperatureMin: 12.29,
apparentTemperatureMinTime: 1537423200,
apparentTemperatureMax: 22.92,
apparentTemperatureMaxTime: 1537455600
},
{
time: 1537480800,
summary: "Mostly cloudy throughout the day.",
icon: "partly-cloudy-day",
sunriseTime: 1537508504,
sunsetTime: 1537552598,
moonPhase: 0.38,
precipIntensity: 0.0813,
precipIntensityMax: 0.2769,
precipIntensityMaxTime: 1537527600,
precipProbability: 0.18,
precipType: "rain",
temperatureHigh: 19.68,
temperatureHighTime: 1537538400,
temperatureLow: 8.82,
temperatureLowTime: 1537592400,
apparentTemperatureHigh: 19.68,
apparentTemperatureHighTime: 1537538400,
apparentTemperatureLow: 7.59,
apparentTemperatureLowTime: 1537592400,
dewPoint: 9.96,
humidity: 0.75,
pressure: 1021.32,
windSpeed: 5.46,
windGust: 13.5,
windGustTime: 1537520400,
windBearing: 359,
cloudCover: 0.67,
uvIndex: 4,
uvIndexTime: 1537527600,
visibility: 16.09,
ozone: 282.97,
temperatureMin: 10.35,
temperatureMinTime: 1537506000,
temperatureMax: 19.68,
temperatureMaxTime: 1537538400,
apparentTemperatureMin: 10.35,
apparentTemperatureMinTime: 1537506000,
apparentTemperatureMax: 19.68,
apparentTemperatureMaxTime: 1537538400
},
{
time: 1537567200,
summary: "Mostly cloudy until afternoon.",
icon: "partly-cloudy-day",
sunriseTime: 1537594978,
sunsetTime: 1537638879,
moonPhase: 0.41,
precipIntensity: 0,
precipIntensityMax: 0.0025,
precipIntensityMaxTime: 1537585200,
precipProbability: 0,
temperatureHigh: 21.16,
temperatureHighTime: 1537624800,
temperatureLow: 10.24,
temperatureLowTime: 1537678800,
apparentTemperatureHigh: 21.16,
apparentTemperatureHighTime: 1537624800,
apparentTemperatureLow: 10.24,
apparentTemperatureLowTime: 1537678800,
dewPoint: 7.49,
humidity: 0.62,
pressure: 1025.88,
windSpeed: 12.47,
windGust: 17.51,
windGustTime: 1537624800,
windBearing: 24,
cloudCover: 0.61,
uvIndex: 4,
uvIndexTime: 1537614000,
visibility: 16.09,
ozone: 268.66,
temperatureMin: 8.82,
temperatureMinTime: 1537592400,
temperatureMax: 21.16,
temperatureMaxTime: 1537624800,
apparentTemperatureMin: 7.59,
apparentTemperatureMinTime: 1537592400,
apparentTemperatureMax: 21.16,
apparentTemperatureMaxTime: 1537624800
}
]
},
domoticz beta/RaspBerry PI3 stretch
https://pon.fr github

Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Répondre