Aller au contenu

darklite44

Membres confirmés
  • Compteur de contenus

    447
  • Inscription

  • Dernière visite

  • Jours gagnés

    1

Tout ce qui a été posté par darklite44

  1. maj terminée
  2. Bonsoir, Est-ce quelqu'un peu tester mon code avec son eco-devices ? Je l'ai testé en mode HC : --[[ %% properties %% globals --]] function getFileFromServer(tcp, path) r, s, e = tcp:GET(path); if (tonumber(s)~=200) then return 0, nil; else return string.len(r), r; end return nil; end --[[ EXTRA FUNCTIONS ]]-- -- counting elements in array (table) function count(tab) local k,v,i; i=0; for k, v in pairs(tab) do i = i + 1; end return i; end -- print any variable content function printr(v,l,k) local d=function(t)fibaro:debug(t);end if(not l)then l=0;end local s=string.rep(string.char(0xC2,0xA0),(l*3)); local n="";if(k)then n=k.." = ";end if(v and type(v))then if(type(v)=="table")then d(s..n.."{");local i,j;for i,j in pairs(v)do printr(j,(l+1),tostring(i));end d(s.."}");elseif(type(v)=="function")then d(s..n..tostring(v).."() {");d(s.."}");elseif(type(v)=="userdata")then d(s..n..tostring(v).."() {");d(s.."}");elseif(type(v)=="string")then if(#v>50)then d(s..n.."String["..#v.."] = \""..string.sub(v,1,50).."\"...");else if(k)then v="\""..v.."\"";end d(s..n..tostring(v));end elseif(type(v)=="number")then d(s..n..tostring(v));else d(s..n..tostring(v).."["..type(v).."]");end else d(s..n.."{nil}");end end function trace(value) if (_trace) then return fibaro:debug(tostring(value)); end end function split(str, delim) local result,pat,lastPos = {},"(.-)" .. delim .. "()",1 for part, pos in string.gfind(str, pat) do table.insert(result, part); lastPos = pos end table.insert(result, string.sub(str, lastPos)) return result end ---============================================================ function padzero(s, count) return string.rep("0", count-string.len(s)) .. s end --======================================================================== -- get date parts for a given ISO 8601 date format (http://richard.warburton.it ) function get_date_parts(date_str) _,_,y,m,d=string.find(date_str, "(%d+)-(%d+)-(%d+)") return tonumber(y),tonumber(m),tonumber(d) end --==================================================== function getmonth(month) local months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } return months[tonumber(month)] end --==================================================== function getday_posfix(day) local idd = math.mod(day,10) return (idd==1 and day~=11 and "st") or (idd==2 and day~=12 and "nd") or (idd==3 and day~=13 and "rd") or "th" end --======================================================================== -- Note : date_str has to be ISO 8601 date format ie. yyyy-mm-dd -- function format_date(date_str, dateformat) local iyy, imm, idd if (date_str and date_str~="") then iyy, imm, idd = get_date_parts(date_str) dateformat = string.gsub(dateformat, "DDD", idd..string.upper(getday_posfix(idd))) dateformat = string.gsub(dateformat, "ddd", idd..getday_posfix(idd) ) dateformat = string.gsub(dateformat, "dd", padzero(idd,2)) dateformat = string.gsub(dateformat, "MMM", string.upper(getmonth(imm))) dateformat = string.gsub(dateformat, "mmm", getmonth(imm)) dateformat = string.gsub(dateformat, "mm", padzero(imm,2)) dateformat = string.gsub(dateformat, "yyyy", padzero(iyy,4)) dateformat = string.gsub(dateformat, "yy", string.sub(padzero(iyy,4),3,4)) else dateformat = "" end return(dateformat) end function split(str, pat) local t = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat, 1) while s do if s ~= 1 or cap ~= "" then table.insert(t,cap) end last_end = e+1 s, e, cap = str:find(fpat, last_end) end if last_end <= #str then cap = str:sub(last_end) table.insert(t, cap) end return t end local energylist = {}; selfId=fibaro:getSelfId(); local ip = fibaro:get(selfId, 'IPAddress'); -- connect to server fibaro:debug("Connecting to [" .. ip .. "]..."); local tcpSERVER = Net.FHttp(ip, 80); HP_cost = 0.1572; HC_cost = 0.1096; local LastBill =os.time{year=2015, month=04, day=05}; if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); local table = split(content, "\n"); if(not l)then l=0; end for i,j in pairs(table)do -- test du pattern annee, mois, jour, hp, hc = j:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); if(annee) then local seconds = os.time{year=annee, month=mois, day=jour}; local diff = tonumber(os.difftime(seconds, LastBill)); -- insertion dans le tableau day = annee .. "-" .. mois .. "-" .. jour f_day = format_date(day, "dd/mm/yy"); if(diff > 0) then energylist[#energylist + 1] = { date = f_day, hp = hp, hc = hc } end end end local max = count(energylist) -- comparer les valeurs pour calculer la facture fibaro:debug("Calcul sur la periode du " .. energylist[1].date .. " au " .. energylist[max].date); -- caclul conso hp_next_bill = tonumber( (energylist[max].hp - energylist[1].hp) /1000); hc_next_bill = tonumber( (energylist[max].hc - energylist[1].hc) /1000); -- calcul du cout hpc_next_bill = math.floor(hp_next_bill*HP_cost); hcc_next_bill = math.floor(hc_next_bill*HC_cost); next_bill = math.floor(hpc_next_bill + hcc_next_bill +(123.95/6) ); fibaro:debug("hp_next_bill: " .. hp_next_bill .. " kWH, " .. hpc_next_bill .. "€" ); fibaro:debug("hc_next_bill: " .. hc_next_bill .. " kWH, " .. hcc_next_bill .. "€" ); fibaro:debug("next_bill: " .. next_bill .. "€"); fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end Merci
  3. Prise en compte des dates après la dernière facture réalisée (2015-04-05) : local LastBill =os.time{year=2015, month=04, day=05} if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); local table = split(content, "\n"); if(not l)then l=0; end for i,j in pairs(table)do -- test du pattern annee, mois, jour, hp, hc = j:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); if(annee) then local seconds = os.time{year=annee, month=mois, day=jour}; local diff = tonumber(os.difftime(seconds, LastBill)); -- insertion dans le tableau day = annee .. "-" .. mois .. "-" .. jour f_day = format_date(day, "dd/mm/yy"); if(diff > 0) then energylist[#energylist + 1] = { date = f_day, hp = hp, hc = hc } fibaro:debug("date=" .. f_day .. ", HP:" .. hp .. ", HC:" .. hc .. ", sec_diff=" .. diff); end end end fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end Ce qui donne dans le debug: [DEBUG] 16:28:27: Received file [7988 bytes]. [DEBUG] 16:28:27: date=06/04/15, HP:1325477, HC:1050730, sec_diff=86400 ... [DEBUG] 16:28:27: date=19/04/15, HP:1432648, HC:1135514, sec_diff=1209600 [DEBUG] 16:28:27: DONE!
  4. -- connect to server fibaro:debug("Connecting to [192.168.xx.xx]..."); local tcpSERVER = Net.FHttp("192.168.xx.xx", 80); ​ local i=0; if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); local table = split(content, "\n"); if(not l)then l=0; end for i,j in pairs(table)do -- test du pattern annee, mois, jour, hp, hc = j:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); if(annee) then -- insertion dans le tableau day = annee .. "-" .. mois .. "-" .. jour f_day = format_date(day, "dd/mm/yy"); energylist[#energylist + 1] = { date = f_day, hp = hp, hc = hc } --fibaro:debug("content:match=" .. f_day .. ", HP:" .. hp .. ", HC:" .. hc); end end printr(energylist); fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end Les donnés vont bien dans la structure, reste à les traiter: [DEBUG] 15:50:41: --- [DEBUG] 15:50:43: Received file [7988 bytes]. [DEBUG] 15:50:43: { [DEBUG] 15:50:43: 1 = { [DEBUG] 15:50:43: date = "21/01/15" [DEBUG] 15:50:43: hc = "233912" [DEBUG] 15:50:43: hp = "437439" [DEBUG] 15:50:43: } ... [DEBUG] 15:50:44: 87 = { [DEBUG] 15:50:44: date = "19/04/15" [DEBUG] 15:50:44: hc = "1135514" [DEBUG] 15:50:44: hp = "1432648" [DEBUG] 15:50:44: } [DEBUG] 15:50:44: } [DEBUG] 15:50:44: DONE!
  5. à‡a bouge chez Fibaro avant la sortie avec 28 tickets passés en résolu : 0002092 3[HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Unable to change "Do not mark nodes as dead" 0002183 4[HC2 v4.xxx] Software bloquant résolu (a.socha) 2015-04-20 Plugin are blocking heating linked device 00025151 [HC2 v4.xxx] Software texte résolu (a.socha) 2015-04-20 Text is out of the device view 0003062 1[HC2 v4.xxx] Z-WAVE devices critique résolu (m.roszak) 2015-04-20 KFOB2 Remote controller is partially working.... 0001764 13[HC2 v4.xxx] Z-WAVE devices critique résolu (m.roszak) 2015-04-20 Aeon Labs Aeotec Przelacznik gniazda sieciowego Z-Wave ZW075 00030642 [HC2 v4.xxx] Software mineur résolu (m.roszak) 2015-04-20 Not possible to delete device parameter in 4.037 0003123 4 1 [HC2 v4.xxx] Z-WAVE engine majeur résolu (m.roszak) 2015-04-20 Aeon Labs DSB05xxx Multi Sensor goes dead randomly 0003126 [HC2 v4.xxx] Z-WAVE devices majeur résolu (k.balcerzak) 2015-04-20 FGRGBW 441M EU - martwe urzadzenia 0003124 1[HC2 v4.xxx] Z-WAVE engine majeur résolu (m.roszak) 2015-04-20 Aeon Labs smart switches marked as dead often 0002826 6[HC2 v4.xxx] Z-WAVE devices majeur résolu (m.roszak) 2015-04-20 Battery drain on Danfoss LC12 0003086 [HC2 v4.xxx] Software bloquant résolu (jbarnas) 2015-04-20 Remote access doesn't reconnect if internet connection fail or is not available on boot 0002858 1 2 [HC2 v4.xxx] Software majeur résolu (jbarnas) 2015-04-20 Temperature data from UBS gets lost 00031721 [HC2 v4.xxx] Software majeur résolu (jbarnas) 2015-04-20 FGMS001 Motion Sensor EU - Light Sensor doesn't work 0002762 32 12 [HC2 v4.xxx] Software majeur résolu (m.roszak) 2015-04-20 Fibaro Motion Sensor Parameter 40 set to 10 lux but actual behaviour... 0003042 13[HC2 v4.xxx] Z-WAVE engine majeur résolu (m.roszak) 2015-04-20 Fgms001 Not correctly reporting lux 00025552 [HC2 v4.xxx] Software majeur résolu (a.socha) 2015-04-20 Problems with virtual device interface 0002556 1 1 [HC2 v4.xxx] Software mineur résolu (k.balcerzak) 2015-04-20 Description of all plugins 0002523 9 8 [HC2 v4.xxx] Z-WAVE devices majeur résolu (p.jurek) 2015-04-20 v4.031 - Fibaro FGRM-221/222 - Venetian mode - Lamellas button 0002958 18 2 [HC2 v4.xxx] Software majeur résolu (a.socha) 2015-04-20 Excluded devices in HC2 reappear again. Unable to delete them. 0002529 [HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Uninstall of default plugins/panels failed 0001809 8[HC2 v4.xxx] Z-WAVE devices mineur résolu (a.socha) 2015-04-20 Aeon labs Z-Wave Home Energy Monitor HEM (Single Phase) E2 Not reporting energy usage 0002733 2[HC2 v4.xxx] Z-WAVE devices mineur résolu (a.socha) 2015-04-20 Cant get the Seismometer to be shown and icon is wrong 0002558 1 1 [HC2 v4.xxx] Z-WAVE devices majeur résolu (m.roszak) 2015-04-20 Not possible to set polling time interval Duwi and Zwave.ME modules. 0002091 28 2 [HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Unable to change "Devices polling time interval" 0002751 2[HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Email: Newline "\n" does not work in LUA 0002182 8 3 [HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Seismometer Icon Missing 0002330 5 4 [HC2 v4.xxx] Software mineur résolu (a.socha) 2015-04-20 Fibaro Door Sensor, Icon Save Bug 0003166 2[HC2 v4.xxx] Software mineur résolu (jbarnas) 2015-04-20 Icons for windows / door contact FGK101 can not be changed.
  6. Krikroff, Je suis parvenu à stocker les valeurs de chaque ligne dans un tableau et le parcourir : -- CHECK SERVER fibaro:debug("---"); --setState(0, "CHECKING SERVER..."); -- connect to server fibaro:debug("Connecting to [192.168.xx.xx]..."); local tcpSERVER = Net.FHttp("192.168.xx.xx", 80); local i=0; if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); local table = split(content, "\n"); if(not l)then l=0; end for i,j in pairs(table)do printr(j,(l+1),tostring(i)); end annee, mois, jour, hp, hc = content:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); day = annee .. "-" .. mois .. "-" .. jour f_day = format_date(day, "dd/mm/yy"); fibaro:debug("content:match=" .. f_day .. ", HP:" .. hp .. ", HC:" .. hc); fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end Maintenant il faut que je fasse les étapes suivantes : triage des données dans le tableau calcul de la consommation à partie d'une date fournie jusqu'à aujourd'hui formatage de l'affichage [DEBUG] 14:22:05: --- [DEBUG] 14:22:05: Connecting to [192.168.xx.xx]... [DEBUG] 14:22:05: --- [DEBUG] 14:22:07: Received file [7988 bytes]. [DEBUG] 14:22:07: 1 = String[304] = "ANNEE,MOIS,JOUR,T1_BASE,T1_HCHP,T1_HCHC,T1_EJPHN,T"... [DEBUG] 14:22:07: 2 = String[89] = "2015,1,21,0,437439,233912,0,0,0,0,0,0,0,0,0,45,31,"... ... [DEBUG] 14:22:07: 87 = String[85] = "2015,4,18,0,1423908,1130804,0,0,0,0,0,0,0,0,0,45,3"... [DEBUG] 14:22:07: 88 = String[85] = "2015,4,19,0,1432648,1135514,0,0,0,0,0,0,0,0,0,45,3"... [DEBUG] 14:22:07: 89 = "" [DEBUG] 14:22:07: content:match=21/01/15, HP:437439, HC:233912 [DEBUG] 14:22:07: DONE!
  7. Merci pour ta réponse mais je ne comprend pas bien l'utilisation du string.sub car on demande de retourner la sous-chaîne démarrant au caractère de position i et terminant au caractère de position i également.
  8. Pourquoi ne pas utiliser l'API REST HTTP plutôt avec un appel àhttp://192.168.1.23/api/devices?id=i ?
  9. L'API a changé pour interroger les modules ?
  10. Déjà la boucle Search for power consumption n'a pas l'air de fonctionner. De fait le tableau reste vide, d'où l'erreur -- Search for power consumption for i = 1, maxNodeID do value = fibaro:getValue(i, "dead"); fibaro:debug("i=" ..i .. ", value=" .. value); if tonumber(fibaro:getValue(i, "dead")) == 0 then unitSensor = string.find(fibaro:get(i, 'unitSensor'), "W"); unit = nil or string.find (fibaro:get(i, 'unit'), "W") fibaro:debug("i=" .. i .. ", unitSensor=" .. unitSensor ); --fibaro:debug("i=" .. i .. ", unitSensor=" .. unitSensor .. ", unit=" .. unit); if string.find(fibaro:get(i, 'unitSensor'), "W") ~= nil or string.find (fibaro:get(i, 'unit'), "W") ~= nil then fibaro:debug('ID = ' ..i.. ' ' ..fibaro:getType(i).. ' unitSensor=' ..fibaro:get(i, 'unitSensor').. ' unit=' ..fibaro:get(i, 'unit')) if fibaro:getType(i) == "multi_level_sensor" then deviceValue = fibaro:getValue(i, "value") else deviceValue = fibaro:getValue(i, "valueSensor") end devices[j] = {i, tonumber(deviceValue)} Total = Total + tonumber(deviceValue) j = j + 1 end end end Si je teste seulement mon device FGP111 Plug (device 56) cela ne fonctionne pas [DEBUG] 09:12:43: i=56, value=0 [ERROR] 09:12:43: line 31: attempt to concatenate global 'unitSensor' (a nil value) [DEBUG] 09:12:50: i=56, value=0 [ERROR] 09:12:50: line 31: attempt to concatenate global 'unitSensor' (a nil value)
  11. C'est quoi le problème avec ce module en v4 ?
  12. J'arrive maintenant à télécharger et décoder une ligne du fichier . Je voudrais avoir de l'aide pour faire la boucle de lecture du buffer. Les stars du Lua, des idées ? --[[ %% properties %% globals --]] function getFileFromServer(tcp, path) r, s, e = tcp:GET(path); if (tonumber(s)~=200) then return 0, nil; else return string.len(r), r; end return nil; end -- CHECK SERVER fibaro:debug("---"); --setState(0, "CHECKING SERVER..."); -- connect to server fibaro:debug("Connecting to [192.168.1.10]..."); tcpSERVER = Net.FHttp("192.168.1.10", 80); if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); annee, mois, jour, hp, hc = content:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); fibaro:debug("content:match=" .. annee .. "-" .. mois .. "-" .. jour .. ", HP:" .. hp .. ", HC:" .. hc); fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end
  13. Bonsoir, J'ai progressé, j'arrive maintenant à télécharger et décoder une ligne du fichier . Je voudrais avoir de l'aide pour faire la boucle de lecture du buffer : --[[ %% properties %% globals --]] function getFileFromServer(tcp, path) r, s, e = tcp:GET(path); if (tonumber(s)~=200) then return 0, nil; else return string.len(r), r; end return nil; end -- CHECK SERVER fibaro:debug("---"); --setState(0, "CHECKING SERVER..."); -- connect to server fibaro:debug("Connecting to [192.168.1.10]..."); tcpSERVER = Net.FHttp("192.168.1.10", 80); if (not tcpSERVER) then fibaro:debug("SERVER ERROR! Skipping..."); else fibaro:debug("---"); size, content = getFileFromServer(tcpSERVER, "/protect/download/xdata.csv"); if (size>0) then fibaro:debug("Received file [" .. size .. " bytes]."); fibaro:debug("content [" .. content .. "]."); annee, mois, jour, hp, hc = content:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),"); fibaro:debug("content:match=" .. annee .. "-" .. mois .. "-" .. jour .. ", HP:" .. hp .. ", HC:" .. hc); fibaro:debug("DONE!"); else fibaro:debug("Connection problem!"); end end Voilà ce que j'ai en retour [DEBUG] 23:24:21: --- [DEBUG] 23:24:21: Connecting to [192.168.1.10]... [DEBUG] 23:24:21: --- [DEBUG] 23:24:23: Received file [7730 bytes]. [DEBUG] 23:24:23: content:match=2015-1-21, HP:437439, HC:233912 [DEBUG] 23:24:23: DONE!
  14. Si tu as l'occasion de faire un test avec les QUBINO, je suis preneur de ton commentaire. Si cela fonctionne je m'orienterai là -dessus.
  15. Voici la réponse officielle que j'ai eu ce midi donc c'est pour Lundi :
  16. Bonjour à tous, J'ai un souci pour télécharger un fichier CSV en LUA. En effet, le contenu n'est pas dans directement le body de la réponse HTTP. Du coup lorsque je parse, le contenu est nul. --[[ %% properties %% globals --]] -- Replace the value with ID of this virtual module selfId=fibaro:getSelfId(); ip = fibaro:get(selfId, 'IPAddress'); ECO = Net.FHttp(ip) local response, status, errorCode = ECO:GET("/protect/download/xdata.csv") fibaro:debug(response) fibaro:debug("####Debut#########################") -- check for error if errorCode == 0 then if tonumber(status) == 200 then -- enregistrement du retour de l API dans une table fibaro:debug(response) else fibaro:debug("HTTP response status: "..status); end else fibaro:debug("Communication error"); fibaro:log("Communication error"); fibaro:call(selfId, "setProperty", "ui.Msg.value", "Comm. error", os.date("%d %b - %X")); end fibaro:debug(response) Ce qui me donne en retour : [DEBUG] 09:20:40: ####Debut######################### Si je prend une trace réseau, on remarque bien que le contenu est un Content-Type: application/octet-stream GET /protect/download/xdata.csv HTTP/1.1 Host: 192.168.1.10 Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 Accept-Encoding: gzip, deflate, sdch Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 HTTP/1.1 200 OK Connection: close Content-Type: application/octet-stream Cache-Control: no-cache ANNEE,MOIS,JOUR,T1_BASE,T1_HCHP,T1_HCHC,T1_EJPHN,T1_EJPHPM,T1_BBRHPJB,T1_BBRHCJB,T1_BBRHPJW,T1_BBRHCJW,T1_BBRHPJR,T1_BBRHCJR,T1_PMAX,T1_ISOUSC,T1_IMAX,Counter1,T2_BASE,T2_HCHP,T2_HCHC,T2_EJPHN,T2_EJPHPM,T2_BBRHPJB,T2_BBRHCJB,T2_BBRHPJW,T2_BBRHCJW,T2_BBRHPJR,T2_BBRHCJR,T2_PMAX,T2_ISOUSC,T2_IMAX,Counter2 2015,1,21,0,437439,233912,0,0,0,0,0,0,0,0,0,45,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2024300, 2015,1,22,0,445749,251266,0,0,0,0,0,0,0,0,0,45,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2024300,
  17. Le problème c'est commande gérer en LUA le téléchargement du fichier. Quelqu'un sait faire ça ?
  18. On m'a proposé l'exemple suivant qui semble fonctionner pour parser une ligne ligne = '2015,4,14,0,33875763,36581093,0,0,0,0,0,0,0,0,0,30,42,4700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4700,' annee, mois, jour, hp, hc = ligne:match("(%d+),(%d+),(%d+),%d+,(%d+),(%d+),") Mon problème avec le CSV c'est commande gérer en LUA le téléchargement du fichier car le contenu n'est pas dans le body de la réponse HTTP. Du coup lorsque je parse, le contenu est nul. --[[ %% properties %% globals --]] -- Replace the value with ID of this virtual module selfId=fibaro:getSelfId(); ip = fibaro:get(selfId, 'IPAddress'); ECO = Net.FHttp(ip) local response, status, errorCode = ECO:GET("/protect/download/xdata.csv") fibaro:debug(response) fibaro:debug("####Debut#########################") -- check for error if errorCode == 0 then if tonumber(status) == 200 then -- enregistrement du retour de l API dans une table fibaro:debug(response) else fibaro:debug("HTTP response status: "..status); end else fibaro:debug("Communication error"); fibaro:log("Communication error"); fibaro:call(selfId, "setProperty", "ui.Msg.value", "Comm. error", os.date("%d %b - %X")); end fibaro:debug(response) Ce qui me donne en retour : [DEBUG] 09:20:40: ####Debut######################### Alors pour pour l'API JSON aucun problème avec le code suivant : local response, status, errorCode = ECO:GET("/api/xdevices.json?cmd=10")
  19. Trois tickets clos ce matin mentionnant la future version 4.0.42 : 0002532 No updates in eventpanel anymore Software - 2015-04-13 10:08 0002742 Temperature panel only showing the last 30 minutes Z-WAVE engine - 2015-04-13 09:28 0002517 4,031 nie pokazuje historii zdarzeń Software - 2015-04-13 09:27
  20. Je viens de leur envoyer encore un mail. Pour le timestamp, utiliser http://www.epochconverter.com/
  21. à‡a fonctionne chez moi également . Reste à voir pour me notifie quotidiennement ma consommation avec Pushover.
  22. Ils ne pourraient pas ajouter une valeur delta comme pour la température pour faire le calibrage du coup ?
  23. Est-ce qu'il y'a moyen de revenir àla version beta via une restauration pour tester les plugins ?
  24. Si tu veux je peux faire beta-testeur :-)
  25. Personne n'a fait la version HP/HC ?
×
×
  • Créer...