Aller au contenu

couillerot

Membres confirmés
  • Compteur de contenus

    1 503
  • Inscription

  • Dernière visite

Tout ce qui a été posté par couillerot

  1. couillerot

    Banque Icones Hcl, HC2 et HC3

    Bonjour à tous, je ne suis certainement pas le seul à déplorer la "qualité" douteuse et la manque de diversité de certains icons (les zones) de notre interface préférée. De par mes connaissances très, très limitées en domotique z-wave (je suis un newbie de chez newbie!), je veux malgré tout apporter ma pierre à l'édifice sur ce forum de passionnés en créant quelques icons un peu plus sympas que ceux d'origines... je ne dis pas que j'y arriverais mais bon je peux toujours essayer! Ci-dessous le lien pour accéder à la galerie des Icônes que j'ai réalisé : http://www.domotique-fibaro.fr/index.php/topic/1588-banque-icones-hc2-et-hcl/page-12?p=31383 Je vous invite également à parcourir ce thread pour découvrir d'autres icônes réalisés par d'autres membres très talentueux Bonne visite! Stef -- Mise à Jour des icons 2021 --
  2. Ce QA récupère les données météo issues du site WeatherBit.io Du fait que ce QA est du type weather provider, vous pouvez le substituer à la source météo par défaut de la box : YR Weather (panneau General / Principal / Capteurs Principaux / source de la météo) La mise à jour des données se fait toutes les 5 minutes. Au niveau de la température et de l'humidité, vous pouvez dorénavant soit récupérer les données de WeatherBit, soit issues de vos propres modules. Dans le cas ou vous souhaitez obtenir les valeurs (température ou/et humidité) via vos propres modules, il suffit de renseigner dans le tableau des variables l'id de votre (vos) module(s) de température et/ou humidité ("temp_id" / "humidity_id"). Si vous renseignez la valeur "0" ce seront les données de WeatherBit qui seront récoltées. Installation Il vous faut d’abord obtenir une « clé » (key) que vous obtiendrez en vous inscrivant gratuitement sur le site Weatherbit.io Renseignez alors le key_id dans le panneau des variables. Pour l’installation des icons, il suffit de suivre l’ordre pré établi (de id_icon1 à id_icon11) selon la représentation ci-dessous : Pour récupérer l’id d’un icon : après avoir téléversé l’icon, vous faites un clic droit dessus et sélectionner « Ouvrir l’image dans un nouvel onglet ». Dans l’onglet, il devrait s’afficher une phrase du style : « User(id_icon).png Bien noter pour chaque icon son id correspondant pour pouvoir le renseigner par la suite dans le tableau des variables… ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- QA WEATHERBIT / com.fibaro.weather --------------------------- --------------- Stephane Couillerot 2021 pour domotique-fibaro.fr ----------------- ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- ------- indiquez dans le panneau des variables votre latitude / longitude --------- -----------et votre key id qui vous est attribuéz en vous inscrivant -------------- ---------------------gratuitement sur le site WeatherBit.io ----------------------- ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- ------ function QuickApp:onInit() __TAG = "QA_"..plugin.mainDeviceId.."INFOS METEO WEATHERBIT" self:loop() end -- function QuickApp:loop() lat = api.get("/settings/location").latitude lati = tostring(lat) lon = api.get("/settings/location").longitude long = tostring(lon) key_id = self:getVariable("key_id") Var_Heure = os.date("%d.%m.%Y à %H:%M") lev = api.get("/settings/info").sunriseHour lever = string.gsub(lev, ":", "h") couch = api.get("/settings/info").sunsetHour coucher = string.gsub(couch, ":", "h") local http = net.HTTPClient() http:request("https://api.weatherbit.io/v2.0/current?lat="..lati.."&lon="..long.."&lang=fr&key="..key_id, { options = { method = 'GET' }, success = function(response) if response.status == 200 then if response.data and response.data ~= "" then local jsonTable = json.decode(response.data) gfx = jsonTable.data[1].weather.code aujourdhui = tostring(os.date("%w", os.time())) dat = jsonTable.data[1].ob_time codeweather = jsonTable.data[1].weather.code jour = string.sub(dat, 9, 10) mois = string.sub(dat, 6, 7) city = jsonTable.data[1].city_name citycode = jsonTable.data[1].country_code codeicon = tonumber(gfx) ----------------------------------------------------------------------------- -------------------- MISE A JOUR ICON COM.FIBARO.WEATHER -------------------- ----------------------------------------------------------------------------- if codeweather >= tonumber("300") and codeweather <= tonumber("522") then condition = "rain" end if codeweather >= tonumber("800") and codeweather <= tonumber("801") then condition = "clear" end if codeweather == tonumber("900") then condition = "unknown" end if codeweather >= tonumber("600") and codeweather <= tonumber("623") then condition = "snow" end if codeweather >= tonumber("200") and codeweather <= tonumber("233") then condition = "storm" end if codeweather >= tonumber("802") and codeweather < tonumber("803") then condition = "cloudy" end if codeweather >= tonumber("803") and codeweather <= tonumber("804") then condition = "Partly cloudy" end if codeweather >= tonumber("700") and codeweather <= tonumber("751") then condition = "fog" end ----------------------------------------------------------------------------- ---------------------------- MISE A JOUR ICON QA ---------------------------- ----------------------------------------------------------------------------- id_icon1 = tonumber(self:getVariable("id_icon1")) id_icon2 = tonumber(self:getVariable("id_icon2")) id_icon3 = tonumber(self:getVariable("id_icon3")) id_icon4 = tonumber(self:getVariable("id_icon4")) id_icon5 = tonumber(self:getVariable("id_icon5")) id_icon6 = tonumber(self:getVariable("id_icon6")) id_icon7 = tonumber(self:getVariable("id_icon7")) id_icon8 = tonumber(self:getVariable("id_icon8")) id_icon9 = tonumber(self:getVariable("id_icon9")) id_icon10 = tonumber(self:getVariable("id_icon10")) id_icon11 = tonumber(self:getVariable("id_icon11")) if codeicon == tonumber("610") then self:updateProperty("deviceIcon", id_icon1) end if codeicon >= tonumber("803") and codeicon <= tonumber("804") then self:updateProperty("deviceIcon", id_icon2) end if codeicon >= tonumber("700") and codeicon <= tonumber("751") then self:updateProperty("deviceIcon", id_icon3) end if codeicon >= tonumber("500") and codeicon <= tonumber("522") then self:updateProperty("deviceIcon", id_icon4) end if codeicon >= tonumber("601") and codeicon <= tonumber("623") then self:updateProperty("deviceIcon", id_icon5) end if codeicon == tonumber("600") then self:updateProperty("deviceIcon", id_icon6) end if codeicon == tonumber("800") then self:updateProperty("deviceIcon", id_icon7) end if codeicon >= tonumber("801") and codeicon <= tonumber("802") then self:updateProperty("deviceIcon", id_icon8) end if codeicon >= tonumber("300") and codeicon <= tonumber("302") then self:updateProperty("deviceIcon", id_icon9) end if codeicon >= tonumber("230") and codeicon <= tonumber("233") then self:updateProperty("deviceIcon", id_icon10) end if codeicon >= tonumber("200") and codeicon <= tonumber("202") then self:updateProperty("deviceIcon", id_icon11) end ------------------------------------------------------------------------------ -------------------------- CONSTRUCTION DES TABLES --------------------------- ------------------------------------------------------------------------------ week = {["0"] = "DIMANCHE", ["1"] = "LUNDI", ["2"] = "MARDI", ["3"] = "MERCREDI", ["4"] = "JEUDI", ["5"] = "VENDREDI", ["6"] = "SAMEDI"} month = {["01"] = "JANVIER", ["02"] = "FEVRIER", ["03"] = "MARS", ["04"] = "AVRIL", ["05"] = "MAI", ["06"] = "JUIN", ["07"] = "JUILLET", ["08"] = "AOUT", ["09"] = "SEPTEMBRE", ["10"] = "OCTOBRE", ["11"] = "NOVEMBRE", ["12"] = "DECEMBRE"} ------------------------------------------ ----- RECUPERATION DES DONNEES METEO ----- ------------------------------------------ ---- Récupération des 2 varaibles température / Humidity ---- tempid = self:getVariable("temp_id") humid = self:getVariable("humidity_id") fibartemp = fibaro.getType(tonumber(tempid)) fibarhumid = fibaro.getType(tonumber(humid)) ---- Température ---- if tostring(tempid) > tostring("0") and fibartemp == tostring("com.fibaro.temperatureSensor") then temp = fibaro.getValue(tonumber(tempid), "value") roomnametemp = fibaro.getRoomNameByDeviceID(tonumber(tempid)) else temp = jsonTable.data[1].app_temp roomnametemp = tostring("WeatherBit") end ---- Humidité ---- if tostring(humid) > tostring("0") and fibarhumid == tostring("com.fibaro.humiditySensor") then humidite = fibaro.getValue(tonumber(humid), "value") roomnamehum = fibaro.getRoomNameByDeviceID(tonumber(humid)) else humidite = jsonTable.data[1].rh roomnamehum = tostring("WeatherBit") end ---- Vent ---- win = jsonTable.data[1].wind_spd winder = tonumber(win) * 3.6 windspeed = string.format("%.1f", tostring(winder)) ---- Divers ---- descript = jsonTable.data[1].weather.description snow = jsonTable.data[1].snow winddir = jsonTable.data[1].wind_cdir uv = jsonTable.data[1].uv pression = jsonTable.data[1].pres rosee = jsonTable.data[1].dewpt ---- Mise à jour dse variables pluie pour historique ---- pluie = fibaro.getValue(911, "value") precip = fibaro.getValue(909, "value") self:setVariable("pluie", pluie) local conditionCodes = { unknown = 3200, clear = 32, rain = 40, snow = 38, storm = 666, cloudy = 30, fog = 20, } local conditionCode = conditionCodes[condition] if conditionCode then self:updateProperty("ConditionCode", conditionCode) self:updateProperty("WeatherCondition", condition) self:updateProperty("Temperature", tonumber(temp)) self:updateProperty("Wind", tonumber(windspeed)) self:updateProperty("Humidity", tonumber(humidite)) end self:debug(aujourdhui) ------------------------------------------------------------------------------ --------------------------- CONSTRUCTION DES LABELS -------------------------- ------------------------------------------------------------------------------ self:updateProperty("log", ""..temp.. " °c") self:updateView("labelCity", "text", "INFOS METEO DU "..week[tostring(aujourdhui)].." "..jour.. " "..month[mois].." "..os.date("%Y")) self:updateView("label1", "text", descript.."\r\rTempérature : "..temp.. "°c\rHumidité : "..string.format("%.0f", humidite).." %\rPluie : "..string.format("%.1f", precip).." mm/h\rNeige : "..string.format("%.1f", snow).." mm/h\rCumul pluie 24h : "..string.format("%.1f", pluie).."mm\rVent : "..windspeed.." km/h ("..winddir..")\rIndex UV (0-11+) : "..string.format("%.0f", uv).."\rPression atmosphérique : "..string.format("%.0f", pression).." mb\rPoint de rosée : "..rosee.." °c\rLever du soleil : "..lever.."\rCoucher du soleil : "..coucher.."\r\rSource Température : "..roomnametemp.. "\rSource Humidité : "..roomnamehum) self:updateView("labelMAJ", "text", "Station de "..city.." ("..citycode..") | MAJ le "..Var_Heure) else self:debug("Error : empty response data") end else self:debug("Error : status=" .. tostring(response.status)) end end, error = function(err) self:debug("Error : " .. err) end }) self:debug("Boucle METEO") fibaro.setTimeout(1000 * 60 * 30, function() -- MAJ 30 minutes self:loop() end) end Version 1.1 - pour la température et l'humidité, ce sont soient les données de Weatherbit soient les valeurs de vos propres modules. - changement de l'icon selon les conditions météo. - indication de la source de la temp et de l'humidité ("nom de la pièce" ou WeatherBit) Version 1.2 - QA Reconnu comme weather provider - récupération auto des coordonnées latitude et longitude - Vérification que les id des modules de température et/ou Humidité appartiennent aux types appropriés WeatherBit.fqa Bonne installation ! Stef
  3. couillerot

    Quick App : Arrosage Automatique

    Il ne s'agit pas à proprement parlé d'un QA sur l'arrosage automatique mais simplement du déclencheur, à l'aide d'une variable globale "Arrosage" > OUI ou NON (récupérable donc dans une scène ou un autre QA pour lancer l'arrosage). Ce QA fonctionne de la sorte : - il récupère les prévisions de précipitations J+1 et J+2 (via le site WeatherBit) - il met à jour régulièrement le cumul des précipitations du jour via un pluviomètre (type "capteur de pluie") ou soit les données de précipitations du jour via Weatherbit (indication de la source dans le QA) - il stock les données de précipitations à J-1 et J-2 - il compare la consigne de déclenchement et les précipitations passées, actuelles et prévues pour conseiller un arrosage, ou pas. si vous avez des conseils pour optimiser le code (surement) ou même des choses à améliorer (certainement), n'hésitez pas ! Installation : - Créer une variable globale globable énumérée : "Arrosage" > valeurs : "OUI" / "NON" - Dans le tableau des variables : renseignez la key_id WeatherBit (en s'inscrivant gratuitement sur weatherbit.io) et - indiquez l'id de votre pluviomètre (précipitations 24h) > "id_pluviometre" ou l'id de n'importe quel autre module existant pour obtenir les données de Weatherbit. function QuickApp:onInit() self:updateProperty("deviceIcon", 1044) -- mettre ici l'id de votre icon self:loop() end function QuickApp:loop() lat = api.get("/settings/location").latitude lati = tostring(string.format("%.2f", lat)) lon = api.get("/settings/location").longitude long = tostring(string.format("%.2f", lon)) key_id = self:getVariable("key_id") local http = net.HTTPClient() http:request("https://api.weatherbit.io/v2.0/forecast/daily?lat="..lati.."&lon="..long.."&days=5&lang=fr&key="..key_id, { options = { method = 'GET' }, success = function(response) if response.status == 200 then if response.data and response.data ~= "" then local jsonTable = json.decode(response.data) precipday1 = jsonTable.data[2].precip precipday2 = jsonTable.data[3].precip precipday0 = jsonTable.data[1].precip id_pluie = self:getVariable("id_pluviometre") precip1 = self:getVariable("precip_jour_1") precip2 = self:getVariable("precip_jour_2") Consigne_mm, _ = self:getVariable("Consigne") Consigne_mm = tonumber(Consigne_mm) if tostring(id_pluie) > tostring("0") and fibaro.getType(tonumber(id_pluie)) == tostring("com.fibaro.rainSensor") then pluie = fibaro.getValue(tonumber(id_pluie), "value") source = fibaro.getName(tonumber(id_pluie)) else pluie = precipday0 source = tostring("WeatherBit") end name = fibaro.getName(tonumber(id_pluie)) arrosage = string.format("%.2f", precipday1 + precipday2 + pluie + precip1 + precip2) arrosage, _= tonumber(arrosage) arrosage_jardin = fibaro.getGlobalVariable("Arrosage") self:setVariable("pluie", pluie) ---------------------------------------- ---------- ARROSAGE OUI / NON ---------- ---------------------------------------- if tonumber(arrosage) > tonumber(Consigne_mm) then fibaro.setGlobalVariable("Arrosage", "NON") else if (tonumber(precip2) > tonumber(Consigne_mm)) and (tonumber(precipday2 + precipday1 + pluie + precip1) == 0) then fibaro.setGlobalVariable("Arrosage", "OUI") else if (tonumber(precipday2) > tonumber(Consigne_mm)) and (tonumber(precipday1 + pluie + precip1 + precip2) == 0) then fibaro.setGlobalVariable("Arrosage", "OUI") else fibaro.setGlobalVariable("Arrosage", "OUI") end end end ------------------------------------------------------------------------------ --------------------------- CONSTRUCTION DES LABELS -------------------------- ------------------------------------------------------------------------------ Arro = fibaro.getGlobalVariable("Arrosage") self:updateProperty("log", ""..arrosage.." mm") self:updateView("labeldate", "text", "INFOS ARROSAGE DU "..os.date("%d.%m.%Y\r\rdonnées mises à jour à %Hh%M")) self:updateView("labelconsigne", "text", "\nConsigne de report : + "..tostring(Consigne_mm).." mm de pluie / 5 jours") self:updateView("labelprecip", "text", "\rPrécipitations J-2 : "..string.format("%.1f", precip2).." mm\r\rPrécipitations J-1 : "..string.format("%.1f", precip1).." mm\r\rPrécipitations ce jour : " ..string.format("%.1f", pluie).." mm (source : "..source..")\r\rPrécipitations prévues J+1 : "..string.format("%.1f", precipday1).." mm\r\rPrécipitations prévues J+2 : "..string.format("%.1f", precipday2).." mm") self:updateView("labelconseil", "text", "Arrosage conseillé : "..Arro) else self:debug("Error : empty response data") end else self:debug("Error : status=" .. tostring(response.status)) end end, error = function(err) self:debug("Error : " .. err) end }) self:stockprecipitations() fibaro.setTimeout(1000 * 60 * 3, function() self:loop() end) end function QuickApp:uiMoinsOnR() local Consigne_mm, _ = self:getVariable("Consigne") Consigne_mm = tonumber(Consigne_mm) - 1 self:setVariable("Consigne", tostring(Consigne_mm)) self:loop() end function QuickApp:uiPlusOnR() local Consigne_mm, _ = self:getVariable("Consigne") Consigne_mm = tonumber(Consigne_mm) + 1 self:setVariable("Consigne", tostring(Consigne_mm)) self:loop() end function QuickApp:stockprecipitations() local Heure = tonumber(os.date("%H", os.time())) local Minute = tonumber(os.date("%M", os.time())) ----------------------------------------------------------------- ---------- MISE A JOUR DES VARIABLES POUR L'HISTORIQUE ---------- ----------------------------------------------------------------- if (Heure == tonumber("23") and Minute > tonumber("45")) and (Heure == tonumber("23") and Minute < tonumber("50")) then actus = self:getVariable("precip_jour_1") self:setVariable("precip_jour_2", tostring(actus)) end if (Heure == tonumber("23") and Minute > tonumber("50")) and (Heure == tonumber("23") and Minute < tonumber("55")) then actu = self:getVariable("pluie") self:setVariable("precip_jour_1", tostring(actu)) end fibaro.setTimeout(1000 * 60 * 2, function() self:stockprecipitations() end) end version 1.2 - choix du type de source de données de précipitations (capteur de pluie ou WeatherBit) version 1.3 (20.06.2021) - correction d'un bug historique précipitations - affichage dans le log du total des précipitations sur 5 jours. Programmateur.fqa bonne installation ! Stef
  4. Ce QA récupère les données de prévisions météo sur 5 jours du site WeatherBit. Mise a jour du QA toutes les 2 heures. Installation Il vous faut d’abord obtenir une « clé » (key) que vous obtiendrez en vous inscrivant gratuitement sur le site Weatherbit.io renseignez alors la variables key_id dans le panneau. Pour l’installation des icons, il suffit de suivre l’ordre pré établi (de id_icon1 à id_icon11) selon la représentation ci-dessous : Pour récupérer l’id d’un icon : après avoir téléversé l’icon, vous faites un clic droit dessus et sélectionner « Ouvrir l’image dans un nouvel onglet ». Dans l’onglet, il devrait s’afficher une phrase du style : « User(id_icon).png Bien noter pour chaque icon son id correspondant pour pouvoir le renseigner par la suite dans le tableau des variables… Bonne installation ! Version 1.2 - Récupération auto des coordonnées de latitude et longitude de la box pour déterminer votre localité. Previsions_Meteo.fqa
  5. couillerot

    Fibaro RGBW Controller 2

    Fibaro FGRGBW-442 "RGBW Controller 2" FONCTIONS : Contrôleur RGB sans fil Technologie Z-Wave+ Supporte le framework de sécurité S2 Compatible bandeaux de LED RGB et RGBW Compatible avec toute source lumineuse 12V ou 24V 4 entrées analogiques 0V-10V 4 sorties 12/24VDC Mesure de la consommation électrique totale et indépendante des 4 canaux Mise à jour sans fil avec la box Fibaro Home Center 2 Facilité d'utilisation et d'installation CARACTERISTIQUES TECHNIQUES : Type de module : Récepteur Z-Wave+ Alimentation : 12V DC / 24V DC, Puissance de sortie : 12A combiné (somme de tous les sorties) Charge maxi (par exemple des lampes halogènes) à 12V - 144W combiné, à 24V - 288W combiné. Consommation d'énergie : <0,3 W Fréquence : 868,42 Mhz Puissance du signal radio : 1mW Distance de transmission : 50m champ libre, 30m en intérieur Dimensions: 42 x 37 x 17 mm Température de fonctionnement : 0-40°C Normes : EMC 2004/108/EC, R&TTE 199/5/WE
  6. couillerot

    Quick App : Arrosage Automatique

    Pour palier aux nombres limités d'appels, j'ai modifié légèrement le QA Vu que j'utilise le QA "prévisions Météo", j'ai donc créé 2 VG (précipitations J+1 et J+2) que je récupère dans "Arrosage auto" Stef
  7. couillerot

    Quick App : Arrosage Automatique

    oui il doit être sans doute possible via l'api d'activer / désactiver le calendrier. Stef
  8. couillerot

    Quick App - Météo WeatherBit v1.3

    pas de soucis Stef
  9. couillerot

    Quick App : Arrosage Automatique

    à priori pas possible... et c'est bien dommage Stef
  10. couillerot

    Quick App - Météo WeatherBit v1.3

    tu peux remplacer le code par celui-ci ? Stef function QuickApp:onInit() self:loop() end ----- function QuickApp:loop() key_id = self:getVariable("key_id") lat = api.get("/settings/location").latitude lati = tostring(lat) lon = api.get("/settings/location").longitude long = tostring(lon) local http = net.HTTPClient() http:request("https://api.weatherbit.io/v2.0/forecast/daily?lat="..lati.."&lon="..long.."&days=5&lang=fr&key="..key_id, { options = { method = 'GET' }, success = function(response) if response.status == 200 then if response.data and response.data ~= "" then local jsonTable = json.decode(response.data) local gfx = jsonTable.data[2].weather.code local city = jsonTable.city_name local citycode = jsonTable.country_code ------------------------------------------------------------------------------ ----------------------------- CHOIX DE L'ICON -------------------------------- ------------------------------------------------------------------------------ codeicon = tonumber(gfx) id_icon1 = tonumber(self:getVariable("id_icon1")) id_icon2 = tonumber(self:getVariable("id_icon2")) id_icon3 = tonumber(self:getVariable("id_icon3")) id_icon4 = tonumber(self:getVariable("id_icon4")) id_icon5 = tonumber(self:getVariable("id_icon5")) id_icon6 = tonumber(self:getVariable("id_icon6")) id_icon7 = tonumber(self:getVariable("id_icon7")) id_icon8 = tonumber(self:getVariable("id_icon8")) id_icon9 = tonumber(self:getVariable("id_icon9")) id_icon10 = tonumber(self:getVariable("id_icon10")) id_icon11 = tonumber(self:getVariable("id_icon11")) if codeicon == tonumber("610") then self:updateProperty("deviceIcon", id_icon1) end if codeicon >= tonumber("803") and codeicon <= tonumber("804") then self:updateProperty("deviceIcon", id_icon2) end if codeicon >= tonumber("700") and codeicon <= tonumber("751") then self:updateProperty("deviceIcon", id_icon3) end if codeicon >= tonumber("500") and codeicon <= tonumber("522") then self:updateProperty("deviceIcon", id_icon4) end if codeicon >= tonumber("601") and codeicon <= tonumber("623") then self:updateProperty("deviceIcon", id_icon5) end if codeicon == tonumber("600") then self:updateProperty("deviceIcon", id_icon6) end if codeicon == tonumber("800") then self:updateProperty("deviceIcon", id_icon7) end if codeicon >= tonumber("801") and codeicon <= tonumber("802") then self:updateProperty("deviceIcon", id_icon8) end if codeicon >= tonumber("300") and codeicon <= tonumber("302") then self:updateProperty("deviceIcon", id_icon9) end if codeicon >= tonumber("230") and codeicon <= tonumber("233") then self:updateProperty("deviceIcon", id_icon10) end if codeicon >= tonumber("200") and codeicon <= tonumber("202") then self:updateProperty("deviceIcon", id_icon11) end Var_Heure = os.date("%d.%m.%Y à %Hh%M") local day2, day3, day4, day5 ------------------------------------------------------------------------------ -------------------------- CONSTRUCTION DES TABLES --------------------------- ------------------------------------------------------------------------------ week = { ["0"] = "DIMANCHE", ["1"] = "LUNDI", ["2"] = "MARDI", ["3"] = "MERCREDI", ["4"] = "JEUDI", ["5"] = "VENDREDI", ["6"] = "SAMEDI" } month = { ["01"] = "JANVIER", ["02"] = "FEVRIER", ["03"] = "MARS", ["04"] = "AVRIL", ["05"] = "MAI", ["06"] = "JUIN", ["07"] = "JUILLET", ["08"] = "AOUT", ["09"] = "SEPTEMBRE", ["10"] = "OCTOBRE", ["11"] = "NOVEMBRE", ["12"] = "DECEMBRE" } ------------------ ----- JOUR 1 ----- ------------------ precipday1 = jsonTable.data[1].precip day1weather = jsonTable.data[1].weather.description snowday1 = jsonTable.data[1].snow lowtempday_1 = jsonTable.data[1].low_temp maxtempday_1 = jsonTable.data[1].max_temp windspeed_1 = jsonTable.data[1].wind_spd winddir_1 = jsonTable.data[1].wind_cdir day_1 = jsonTable.data[1].datetime day = tostring(os.date("%w", os.time())) j_1 = string.sub(day_1, 9, 10) m_1 = string.sub(day_1, 6, 7) day1 = tonumber(day) ------------------ ----- JOUR 2 ----- ------------------ precipday2 = jsonTable.data[2].precip snowday2 = jsonTable.data[2].snow day_2 = jsonTable.data[2].datetime day2weather = jsonTable.data[2].weather.description lowtempday_2 = jsonTable.data[2].low_temp maxtempday_2 = jsonTable.data[2].max_temp windspeed_2 = jsonTable.data[2].wind_spd winddir_2 = jsonTable.data[2].wind_cdir j_2 = string.sub(day_2, 9, 10) m_2 = string.sub(day_2, 6, 7) day2 = tonumber(day1) + 1 ------------------ ----- JOUR 3 ----- ------------------ precipday3 = jsonTable.data[3].precip snowday3 = jsonTable.data[3].snow day_3 = jsonTable.data[3].datetime day3weather = jsonTable.data[3].weather.description lowtempday_3 = jsonTable.data[3].low_temp maxtempday_3 = jsonTable.data[3].max_temp windspeed_3 = jsonTable.data[3].wind_spd winddir_3 = jsonTable.data[3].wind_cdir j_3 = tostring(string.sub(day_3, 9, 10)) m_3 = tostring(string.sub(day_3, 6, 7)) day3 = tonumber(day2) + 1 ------------------ ----- JOUR 4 ----- ------------------ precipday4 = jsonTable.data[4].precip snowday4 = jsonTable.data[4].snow day_4 = jsonTable.data[4].datetime day4weather = jsonTable.data[4].weather.description lowtempday_4 = jsonTable.data[4].low_temp maxtempday_4 = jsonTable.data[4].max_temp windspeed_4 = jsonTable.data[4].wind_spd winddir_4 = jsonTable.data[4].wind_cdir j_4 = tostring(string.sub(day_4, 9, 10)) m_4 = tostring(string.sub(day_4, 6, 7)) day4 = tonumber(day3) + 1 ------------------ ----- JOUR 5 ----- ------------------ precipday5 = jsonTable.data[5].precip snowday5 = jsonTable.data[5].snow day_5 = jsonTable.data[5].datetime day5weather = jsonTable.data[5].weather.description lowtempday_5 = jsonTable.data[5].low_temp maxtempday_5 = jsonTable.data[5].max_temp windspeed_5 = jsonTable.data[5].wind_spd winddir_5 = jsonTable.data[5].wind_cdir j_5 = tostring(string.sub(day_5, 9, 10)) m_5 = tostring(string.sub(day_5, 6, 7)) day5 = tonumber(day4) + 1 ------------------------------ ------- BOUCLE SEMAINE ------- ------------------------------ if tonumber(day1) == tonumber("6") then day2 = 0 day3 = 1 day4 = 2 day5 = 3 end if tonumber(day2) == tonumber("6") then day1 = 5 day3 = 0 day4 = 1 day5 = 2 end if tonumber(day3) == tonumber("6") then day1 = 4 day2 = 5 day4 = 0 day5 = 1 end if tonumber(day4) == tonumber("6") then day1 = 3 day2 = 4 day3 = 5 day5 = 0 end if tonumber(day5) == tonumber("6") then day1 = 2 day2 = 3 day3 = 4 day4 = 5 end ---------------------------------- ---------- ALERTE NEIGE ---------- ---------------------------------- if (snowday2 > 0) or (snowday3 > 0) or (snowday4 > 0) or (snowday5 > 0) then self:updateProperty("log", "ALERTE NEIGE") elseif ( windspeed_2 > 30) or ( windspeed_3 > 30) or ( windspeed_4 > 30) or ( windspeed_5 > 30) then self:updateProperty("log", "ALERTE VENT") else self:updateProperty("log", "") end ------------------------------------------------------------------------------ --------------------------- CONSTRUCTION DES LABELS -------------------------- ------------------------------------------------------------------------------ self:updateView("labelday1", "text", week[tostring(day1)].." "..j_1.. " "..month[m_1].."\r"..day1weather.."\rT° mini : "..lowtempday_1.."°c - T° maxi : "..maxtempday_1.."°c\r" ..string.format("%.1f", precipday1) .." mm de pluie | " ..string.format("%.1f", snowday1).." mm de neige\rVent "..string.format("%.1f", windspeed_1 * 3.6).." km/h ("..winddir_1..")") self:updateView("labelday2", "text", week[tostring(day2)].." "..j_2.. " "..month[m_2].."\r"..day2weather.."\rT° mini : "..lowtempday_2.."°c - T° maxi : "..maxtempday_2.."°c\r" ..string.format("%.1f", precipday2) .." mm de pluie | " ..string.format("%.1f", snowday2).." mm de neige\rVent "..string.format("%.1f", windspeed_2 * 3.6).." km/h ("..winddir_2..")") self:updateView("labelday3", "text", week[tostring(day3)].." "..j_3.. " "..month[m_3].."\r"..day3weather.."\rT° mini : "..lowtempday_3.."°c - T° maxi ; "..maxtempday_3.."°c\r" ..string.format("%.1f", precipday3) .." mm de pluie | " ..string.format("%.1f", snowday3).." mm de neige\rVent "..string.format("%.1f", windspeed_3* 3.6).." km/h ("..winddir_3..")") self:updateView("labelday4", "text", week[tostring(day4)].." "..j_4.. " "..month[m_4].."\r"..day4weather.."\rT° mini : "..lowtempday_4.."°c - T° maxi : "..maxtempday_4.."°c\r" ..string.format("%.1f", precipday4) .." mm de pluie | " ..string.format("%.1f", snowday4).." mm de neige\rVent "..string.format("%.1f", windspeed_4 * 3.6).." km/h ("..winddir_4..")") self:updateView("labelday5", "text", week[tostring(day5)].." "..j_5.. " "..month[m_5].."\r"..day5weather.."\rT° mini : "..lowtempday_5.."°c - T° maxi : "..maxtempday_5.."°c\r" ..string.format("%.1f", precipday5) .." mm de pluie | " ..string.format("%.1f", snowday5).." mm de neige\rVent "..string.format("%.1f", windspeed_5 * 3.6).." km/h ("..winddir_5..")") self:updateView("labelMAJ", "text", "Station de "..city.." ("..citycode..") - MAJ le "..Var_Heure) ----------------------------- precipitation_arrosage = string.format("%.2f", precipday1 + precipday2) fibaro.setGlobalVariable("prevision_pluie", tostring(precipitation_arrosage)) fibaro.setGlobalVariable("precipday2", tostring(precipday2)) fibaro.setGlobalVariable("precipday3", tostring(precipday3)) ---------- else self:debug("Error : empty response data") end else self:debug("Error : status=" .. tostring(response.status)) end end, error = function(err) self:debug("Error : " .. err) end }) self:debug("Boucle PREVISIONS METEO") fibaro.setTimeout(1000 * 60 * 120, function() self:loop() end) end
  11. couillerot

    Quick App - Météo WeatherBit v1.3

    qu'est-ce que le log t'indique ? Stef
  12. couillerot

    Quick App - Météo WeatherBit v1.3

    Salut, l'api fonctionne parfaitement chez moi Stef
  13. salut à tous, A des années lumières du superbe et complet QA de Barelle sur l'Eco Devices, voici une version light (et sans prétentions) spéciale HP / HC (un grand merci à Lazer pour son aide ;)) Pour l'installation, rien de plus simple : - télécharger le QA - renseigner dans le tableau des variables : * l'adresse IP de l'Eco Devices ("ip_Ecodevice") * le coût de l'abonnement / an ("tarifAbonnement") * le prix des heures Pleines / Creuses ("tarifHC" et "tarifHP") * l'id utilisateur pour recevoir le rapport journalier sur la consommation HC / HP et le coût total ("id_Mail") et c'est tout... ce QA prend en compte toutes les taxes annexes pour un calcul au plus juste (TCFE, CFPE et CTA). Un reset auto est effectué tous les soirs à minuit. Par défaut, ce QA pointe sur la borne T1. pour se loguer sur le T2, 3 lignes seront à modifier dans le code du QA (signalées). Compteur d'énergie (type EnergyMeter) : Compteur Energie.fqa Compteur de puissance (type PowerSensor) : Compteur Puissance.fqa Version 1.1 - ce QA est désormais reconnu comme compteur d'énergie par la HC3 (par défaut, il indique la conso instantanée en VA) - affichage du tarif en cours (donc heures pleines ou heures creuses) Version 1.2 - QA peut être considéré comme compteur d'énergie (type EnergyMeter) ou Compteur de puissance (type PowerSensor) Stef
  14. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    J'ai expliqué le problème à GCE qui m'ont demandé une capture d'écran car de leur côté ça fonctionne correctement... (avec firmware 1.06.00 et 1.06.01) pourrais tu me fournir une capture de la réponse de la commande ? après il m'ont donné une alternative : ip/status.xml mais là c'est une autre histoire... Stef
  15. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    si si mais je voulais être sûr Stef
  16. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    oui Manu il s'agit bien de l'adresse json qui pour moi aurait été modifiée D'ailleurs, j'ai vu que le mode Tempo était maintenant présent dans la maj web (peut-être depuis la version 1.6 ?) Manu, tu as bien les 2 mêmes maj : web version et prog version ? (sous système) Effectivement Lazer, ce QA ne traite uniquement que du HC/HP. Stef
  17. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    j'ai envoyé un mail à CGE... on verra bien. Stef
  18. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    effectivement, je soupçonne que l'adresse a changé... Stef
  19. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    Je vais faire la MAJ et voir ce que ça donne... Stef
  20. couillerot

    Quick App - Eco Devices Light v1.2 (Electricité)

    Salut ! je viens d'installer le QA compteur d'énergie (celui présent au haut du topic) et je n'ai pas d'erreur... Sinon, à tout hasard, pour la variable "tarifAbonnement", tu as bien mis un "." et non une "," dans le chiffre ? Stef
  21. couillerot

    Quick App - Météo WeatherBit v1.3

    salut ROBBEJP et merci pour tes remerciements mais la version Free de Weatherbit ne permet pas l'utilisation de prévisions à l'heure et c'est vrai que c'est bien dommage. Nous sommes malheureusement cantonnés aux prévisions "classiques" :( Stef
  22. couillerot

    HC3 & HC3L - 5.131.57 - BETA - 02/02/2023

    idem !!!
  23. couillerot

    Quick App - Météo WeatherBit v1.3

    Le QA fait un appel tous les 20 min donc légèrement plus que qu'autorisé mais ça ne plante pas chez moi. effectivement, l'idéal serait de mettre 30 min entre 2 appels. j'ai modifié le code en première page, sinon c'est c'est partie qu'il faut modifier : self:debug("Boucle METEO") fibaro.setTimeout(1000 * 60 * 30, function() -- MAJ toutes les 30 minutes self:loop() end) end Stef
  24. couillerot

    Quick App - Météo WeatherBit v1.3

    version 1.3 ---> ajout d'un nouveau pack d'icons et correctif (à confirmer...) Stef
  25. couillerot

    Quick App : Arrosage Automatique

    salut Sakkhho, de mon côté, les infos remontent toujours bien... RAS. Stef
×