Aller au contenu

Kana-chan

Membres confirmés
  • Compteur de contenus

    320
  • Inscription

  • Dernière visite

  • Jours gagnés

    6

Tout ce qui a été posté par Kana-chan

  1. Bonjour Barelle, En fait c'est exactement celui que je cherche à faire. Je ne l'avais pas vu dans la liste ... besoin de changer de paire de lunette surement. Mais je vais en profiter pour voir comment tu as fait ! Voilà ...
  2. OK, mais objectivement. Est-ce long ?
  3. Bonjour, Elle est longue à se mettre à jour ? Car la dernière LED clignote mais rien ne se passe de plus. Voilà ...
  4. J'ai vu, mais c'est compréhensible. Je verrai cela à tête reposée ce week-end, je pense.
  5. Bonjour, J'ai déjà regardé ton premier lien. Mais comme je n'ai jamais fait de scènes sur la HC2, je n'utilisais pas cela. C'est pourquoi je ne comprends pas trop comment cela fonctionne. Je vais regarder ton exemple avec ton QuickApp en second lien. J'espère que je vais réussir à comprendre ! Merci.
  6. Bonjour, Je vous sollicite pour de l'aide. Je n'arrive pas à porter mon VD HC2 vers un QuickApp HC3. Voici le code du VD sur HC2 : -- Interrogate the Synology UPS Server -- Configuration used for testing : -- * a Synology DS1010+ with DSM 5.2-5967 Update 8 -- * a Eaton Ellipse PRO 1200 local debug = false; local globalVarName = "UpsStatus"; -- values "power-line" or "battery" local username = "monuser"; local password = "secret"; local selfId = fibaro:getSelfId(); local _deviceIp = fibaro:get(selfId, 'IPAddress'); local _devicePort = fibaro:get(selfId, 'TCPPort'); if (_devicePort == nil) then _devicePort = 3493; end local tcpSocket = Net.FTcpSocket(_deviceIp, _devicePort); local cr = string.char(13); local lf = string.char(10); local crLf = cr..lf; -- icônes à adapter local icones = { ["0%"] = 1051 ,["50%"] = 1050 ,["100%"] = 1049 ,["normal"] = 1047 ,["on"] = 1046 ,["off"] = 1045 ,["secteur"] = 1048 } function trace(text, color) color = color or "white"; if debug then fibaro:debug("<font color='"..color.."'>"..text.."</font>"); end end -- trace function changeIcon(newIcon) local currentIcon = tonumber(fibaro:getValue(selfId, "currentIcon")); trace("currentIcon="..currentIcon..", newIcon="..newIcon, "cyan"); if (newIcon ~= currentIcon) then fibaro:call(selfId, "setProperty", "currentIcon", newIcon); trace("new icon : "..newIcon.."OK", "cyan"); end end -- changeIcon function tracerr(text, color) color = color or "red"; fibaro:debug("<font color='red'>ERROR! </font>".."<font color='"..color.."'>"..text.."</font>"); end -- tracerr function split(text, sep) local sep, fields = sep or ":", {}; local pattern = string.format("([^%s]+)", sep); text:gsub(pattern, function(c) fields[#fields+1] = c end); return fields; end -- split function createGlobalIfNotExists(varName, defaultValue) local payload = fibaro:getGlobalValue(varName); if ((payload == nil) or (payload == "")) then trace("Création de la variable " .. varName .. " avec comme valeur par défaut " .. defaultValue, "orange"); local newVar = {}; newVar.name = varName; newVar.value = defaultValue; local HC2 = Net.FHttp("127.0.0.1", 11111); HC2:POST("/api/globalVariables", json.encode(newVar)); end end function writeSocket(data) trace("writeSocket, data="..data, "lightgreen"); local bytes, errorCode = tcpSocket:write(data); if errorCode == 0 then return true; else tracerr("writeSocket, errorCode="..errorCode); return false; end end -- writeSocket function readSocket() local err, length = 0, 1; local buffer, data = "", ""; while (err==0 and length>0) do data, err = tcpSocket:read(); length = string.len(data); buffer = buffer..data; end return buffer, err; end -- readSocket function connect() trace("connect, connecting to server", "lightgreen"); if writeSocket("USERNAME " .. username .. crLf) then local response, err = readSocket(); if ((string.len(response) >=2) and (string.sub(response, 1, 2) == "OK")) then trace("connect, USERNAME OK", "lightgreen"); if writeSocket("PASSWORD " .. password .. crLf) then response, err = readSocket(); if ((string.len(response) >=2) and (string.sub(response, 1, 2) == "OK")) then trace("connect, PASSWORD OK", "lightgreen"); return true; else tracerr("connect, PASSWORD bad response, err="..err..", response="..response or ""); return false; end else tracerr("connect, PASSWORD writeSocket error"); end else tracerr("connect, USERNAME bad response, err="..err..", response="..response or ""); return false; end else tracerr("connect, USERNAME writeSocket error"); end end -- connect function logout() if writeSocket("LOGOUT\n") then local response, err = readSocket(); if err == 0 then trace("logout, successfull, response=" .. response, "lightgreen"); else tracerr("logout, readSocket error, err=" .. err); end else tracerr("logout, writeSocket error"); end end -- logout function ask(question) if writeSocket(question .. crLf) then local response, err = readSocket(); if (response) then return response; else return nil; end else tracerr("ask, writeSocket error, question=" .. question); end end -- ask function listToTable(list, sep) local arr = split(list, sep); -- Go through the table local i, done = 1, false; local payload = {}; while (not done) do -- populate the table if (string.sub(arr[i], 1, 18) == "BEGIN LIST VAR UPS") then i = i + 1; else if (string.sub(arr[i], 1, 16) == "END LIST VAR UPS") then done = true; else local keyEnd = string.find(arr[i], " "); local key = string.sub(arr[i], 1, keyEnd-1); local value = string.sub(arr[i], keyEnd+1); payload[key] = string.gsub(value, '"', ''); trace("payload["..key.."]="..payload[key], "cyan"); i = i + 1; done = (arr[i] == nil); end end end return payload; end -- listToTable local icone = icones["normal"]; changeIcon(icone); tcpSocket:setReadTimeout(200); if connect() then trace("Connected to UPS server (".._deviceIp..":".._devicePort..")", "lightgreen"); local listVar = ask("LIST VAR UPS"); -- trace("listVar="..listVar, "cyan"); listVar = string.gsub(listVar, "VAR UPS ", ""); -- each item begins with "VAR UPS ", eliminate them -- trace("listVar="..listVar, "cyan"); local varUps = listToTable(listVar, "\n"); fibaro:call(selfId, "setProperty", "ui.Modele.value", varUps["ups.model"] or ""); fibaro:call(selfId, "setProperty", "ui.Charge.value", (varUps["battery.charge"] or "") .. " %"); fibaro:call(selfId, "setProperty", "ui.Status.value", varUps["ups.status"] or ""); fibaro:call(selfId, "setProperty", "ui.BatteryRuntime.value", (varUps["battery.runtime"] or "") .. " sec"); fibaro:call(selfId, "setProperty", "ui.InputVoltage.value", (varUps["input.voltage"] or "") .. " V"); fibaro:call(selfId, "setProperty", "ui.RealPower.value", (varUps["ups.realpower.nominal"] or "") .. " W"); fibaro:call(selfId, "setProperty", "ui.BatteryVoltage.value", (varUps["battery.voltage"] or "") .. " V"); fibaro:call(selfId, "setProperty", "ui.BatteryMFR.value", (varUps["battery.mfr.date"] or "") .. ""); fibaro:call(selfId, "setProperty", "ui.BatteryDate.value", (varUps["battery.date"] or "") .. ""); createGlobalIfNotExists(globalVarName, "power-line"); if (varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OB D")) then -- values "OL CHRG", "OB DISCHRG", "OL DISCHRG" trace("UPS is on battery!", "yellow"); fibaro:setGlobal(globalVarName, "battery"); if (varUps["battery.charge"]) then if (tonumber(varUps["battery.charge"]) > 80) then icone = icones["100%"]; elseif (tonumber(varUps["battery.charge"]) > 30) then icone = icones["50%"]; else icone = icones["0%"]; end end elseif (varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OL D")) then trace("UPS is on line, pb battery.", "red"); fibaro:setGlobal(globalVarName, "power-line"); if (varUps["battery.charge"]) then if (tonumber(varUps["battery.charge"]) > 80) then icone = icones["100%"]; elseif (tonumber(varUps["battery.charge"]) > 30) then icone = icones["50%"]; else icone = icones["0%"]; end end else fibaro:setGlobal(globalVarName, "power-line"); if ((varUps["battery.charge"] and tonumber(varUps["battery.charge"]) < 100) or varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OL C")) then trace("UPS is on line and charging.", "lime"); icone = icones["secteur"]; else trace("UPS is on line.", "lime"); icone = icones["on"]; end end --local aVar = ask("GET VAR UPS ups.temperature"); --trace("aVar="..aVar, "cyan"); logout(); else trace("unable to connect to UPS server (".._deviceIp..":".._devicePort..")", "red"); icone = icones["off"]; end changeIcon(icone); Je cherche à faire la même chose en QuickApp sur le HC3 mais j'ai des soucis avec le passage de Net.FTcpSocket() en HC2 à net.TCPSocket() en HC3. N'étant pas à l'aise déjà avec ce nouveau système, je suis perdu. Voici le code actuel en HC3: function QuickApp:onInit() self:debug("QuickApp:onInit") -- Interrogate the Synology UPS Server -- Configuration used for testing : -- * a Synology DS1010+ with DSM 5.2-5967 Update 8 -- * a Eaton Ellipse PRO 1200 self.myDebug = true; self.varName = "UpsStatus"; -- values "power-line" or "battery" self.username = "monuser"; self.password = "secret"; self._deviceIp = self:getVariable('IPAddress'); self._devicePort = self:getVariable('TCPPort'); if (self._devicePort == nil) then self._devicePort = "3493"; end self._devicePort = tonumber(self._devicePort); self.socketTCP = net.TCPSocket({timeout = 10000}); self.response = {}; self.err = ""; self.cr = string.char(13); self.lf = string.char(10); self.crLf = self.cr .. self.lf; self.sleeping = 240; -- secondes self.myInstance = { ["lastrun"] = 0, ["every"] = self.sleeping }; self.isConnected = false; self.compteur = 0; self.display = { ["BatteryDate"] = "Batterie Date : ", ["BatteryMFR"] = "Batterie MFR : ", ["BatteryVoltage"] = "Batterie Volt : ", ["RealPower"] = "Puissance : ", ["InputVoltage"] = "Entrée Volt : ", ["BatteryRuntime"] = "Autonomie : ", ["Status"] = "Statut : ", ["Charge"] = "Charge : ", ["Modele"] = " Modèle : " } -- icônes à adapter self.icones = { ["0%"] = 1022, ["50%"] = 1023, ["100%"] = 1021, ["normal"] = 1024, ["on"] = 1026, ["off"] = 1025, ["secteur"] = 1020 }; self:updateProperty("deviceIcon", 1024); --self:connect(); end function QuickApp:trace(text, color) color = color or "white"; if self.myDebug == true then print("Debug: <font color='"..color.."'>"..text.."</font>"); end end -- trace function QuickApp:changeIcon(newIcon) self:trace("newIcon=" .. newIcon, "cyan"); self:updateProperty("deviceIcon", newIcon); self:trace("new icon : " .. newIcon .. " OK", "cyan"); end -- changeIcon function QuickApp:tracerr(text, color) color = color or "red"; print("<font color='red'>ERROR! </font><font color='" .. color .. "'>" .. text .. "</font>"); end -- tracerr function QuickApp:split(text, sep) local sep, fields = sep or ":", {}; local pattern = string.format("([^%s]+)", sep); text:gsub(pattern, function(c) fields[#fields+1] = c end); return fields; end -- split function QuickApp:writeSocket(data) self:trace("writeSocket, data=" .. data, "lightgreen"); self.socketTCP:write(data, { success = function() -- the function that will be triggered when the data is correctly sent --print("data sent: "..data); end, error = function(myErr) -- the function that will be triggered in the event of an error in data transmission self.err = myErr; print("error while sending data: ", self.err); end }) end -- writeSocket -- function handling the read data -- normally this is where the data reported by the device will be handled function QuickApp:onDataReceived(data) print("onDataReceived: ", data); self.response[self.compteur] = data; self.compteur = self.compteur + 1; end -- method for reading data from the socket -- since the method itself has been looped, it should not be called from other locations than QuickApp:connect function QuickApp:waitForResponseFunction() self.socketTCP:readUntil("\n", { -- reading a data package from the socket success = function(data) self:onDataReceived(data); -- handling of received data self:waitForResponseFunction(); -- looping of data readout end, error = function() -- a function that will be called in case of an error when trying to receive data, e.g. disconnecting a socket print("Response Error or no response"); self.socketTCP:close(); -- socket closed --fibaro.setTimeout(5000, function() self:connect(); end) -- re-connection attempt (every 5s) end }) end -- a method to open a TCP connection. -- if the connection is successful, the data readout loop will be called QuickApp:waitForResponseFunction() function QuickApp:connect() self.socketTCP:connect(self._deviceIp, self._devicePort, { -- connection to the device with the specified IP and port success = function() -- the function will be triggered if the connection is correct print("Connected"); self:waitForResponseFunction(); -- launching a data readout "loop" if self:connection() then self.isConnected = true; end end, error = function(err) -- a function that will be triggered in case of an incorrect connection, e.g. timeout self.socketTCP:close(); -- closing the socket print("Connection Error"); --fibaro.setTimeout(5000, function() self:connect(); end) -- re-connection attempt (every 5s) end }) end function QuickApp:connection() self:trace("Connect, connecting to server", "lightgreen"); self:writeSocket("USERNAME " .. self.username .. self.crLf); self:writeSocket("PASSWORD " .. self.password .. self.crLf); self:ask("LIST VAR UPS"); return true; end function QuickApp:logout() self:writeSocket("LOGOUT" .. self.crLf); self:trace("logout, successfull", "lightgreen"); self.socketTCP:close(); self.compteur = 0; end -- logout function QuickApp:ask(question) self:writeSocket(question .. self.crLf); if (self.response) then return self.response; else return nil; end end -- ask function QuickApp:listToTable(list, sep) local arr = self:split(list, sep); -- Go through the table local i, done = 1, false; local payload = {}; while (not done) do -- populate the table if (string.sub(arr[i], 1, 18) == "BEGIN LIST VAR UPS") then i = i + 1; else if (string.sub(arr[i], 1, 16) == "END LIST VAR UPS") then done = true; else local keyEnd = string.find(arr[i], " "); local key = string.sub(arr[i], 1, keyEnd-1); local value = string.sub(arr[i], keyEnd+1); payload[key] = string.gsub(value, '"', ''); self:trace("payload[" .. key .. "]=" .. payload[key], "cyan"); i = i + 1; done = (arr[i] == nil); end end end return payload; end -- listToTable function QuickApp:computeResponses() local returned_response = ""; for index = 3, self.compteur-2, 1 do returned_response = returned_response .."\n".. self.response[index]; end return returned_response; end function QuickApp:refreshAll() local icone = self.icones["normal"]; self:changeIcon(icone); --self.socketTCP:setReadTimeout(200); if self.isConnected then local listVar = self:computeResponses(); --self:trace("listVar=" .. listVar, "cyan"); listVar = string.gsub(listVar, "VAR UPS ", ""); -- each item begins with "VAR UPS ", eliminate them --trace("listVar=" .. listVar, "cyan"); local varUps = self:listToTable(listVar, "\n"); self:updateView("Modele", "text", self.display["Modele"]..varUps["ups.model"] or ""); self:updateView("Charge", "text", self.display["Charge"]..(varUps["battery.charge"] or "") .. " %"); self:updateView("Status", "text", self.display["Status"]..varUps["ups.status"] or ""); self:updateView("BatteryRuntime", "text", self.display["BatteryRuntime"]..(varUps["battery.runtime"] or "") .. " sec"); self:updateView("InputVoltage", "text", self.display["InputVoltage"]..(varUps["input.voltage"] or "") .. " V"); self:updateView("RealPower", "text", self.display["RealPower"]..(varUps["ups.realpower.nominal"] or "") .. " W"); self:updateView("BatteryVoltage", "text", self.display["BatteryVoltage"]..(varUps["battery.voltage"] or "") .. " V"); self:updateView("BatteryMFR", "text", self.display["BatteryMFR"]..(varUps["battery.mfr.date"] or "") .. ""); self:updateView("BatteryDate", "text", self.display["BatteryDate"]..(varUps["battery.date"] or "") .. ""); self:setVariable(self.varName, "power-line"); if (varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OB D")) then -- values "OL CHRG", "OB DISCHRG", "OL DISCHRG" self.trace("UPS is on battery!", "yellow"); self:setVariable(self.varName, "battery"); if (varUps["battery.charge"]) then if (tonumber(varUps["battery.charge"]) > 80) then icone = self.icones["100%"]; elseif (tonumber(varUps["battery.charge"]) > 30) then icone = self.icones["50%"]; else icone = self.icones["0%"]; end end elseif (varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OL D")) then self.trace("UPS is on line, pb battery.", "red"); self:setVariable(self.varName, "power-line"); if (varUps["battery.charge"]) then if (tonumber(varUps["battery.charge"]) > 80) then icone = self.icones["100%"]; elseif (tonumber(varUps["battery.charge"]) > 30) then icone = self.icones["50%"]; else icone = self.icones["0%"]; end end else self:setVariable(self.varName, "power-line"); if ((varUps["battery.charge"] and tonumber(varUps["battery.charge"]) < 100) or varUps["ups.status"] and (string.sub(varUps["ups.status"], 1, 4) == "OL C")) then self:trace("UPS is on line and charging.", "lime"); icone = self.icones["secteur"]; else self:trace("UPS is on line.", "lime"); icone = self.icones["on"]; end end --local aVar = ask("GET VAR UPS ups.temperature"); --self.trace("aVar=" .. aVar, "cyan"); --self:logout(); else self:trace("unable to connect to UPS server (" .. self._deviceIp .. ":" .. self._devicePort .. ")", "red"); icone = self.icones["off"]; end self:changeIcon(icone); end function QuickApp:myRefresh() local last = self.myInstance.lastrun; local diff = os.difftime(os.time(), last); if (diff >= self.myInstance.every) then self:connect(); self:refreshAll(); self.myInstance.lastrun = os.time(); --self:debug("Check"); -- for watchdog use end end Je n'arrive pas faire en sorte d'attendre les réponses suite aux envois de messages: [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: Connected [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: Debug: Connect, connecting to server [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: Debug: writeSocket, data=USERNAME monuser <= Commande 1 [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: Debug: writeSocket, data=PASSWORD secret <= Commande 2 [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: Debug: writeSocket, data=LIST VAR UPS <= Commande 3 [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: OK <= Réponse 1 [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: OK <= Réponse 2 [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: BEGIN LIST VAR UPS <= Réponse 3 (poursuit sur les autres lignes) [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.charge "100" [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.charge.low "10" [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.charge.warning "50" [2021-03-14] [16:48:42] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.date "2001/09/25" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.mfr.date "2017/03/24" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.runtime "4130" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.runtime.low "120" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.type "PbAc" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.voltage "27.1" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS battery.voltage.nominal "24.0" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS device.mfr "American Power Conversion" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS device.model "Back-UPS RS 900G" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS device.serial "3B1712X12050 " [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS device.type "ups" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.name "usbhid-ups" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.parameter.pollfreq "30" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.parameter.pollinterval "5" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.parameter.port "auto" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.version "DSM6-2-25364-191230" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.version.data "APC HID 0.95" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS driver.version.internal "0.38" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.sensitivity "medium" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.transfer.high "294" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.transfer.low "176" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.transfer.reason "input voltage out of range" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.voltage "235.0" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS input.voltage.nominal "230" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.beeper.status "disabled" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.delay.shutdown "20" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.firmware "879.L4 .I" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.firmware.aux "L4 " [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.load "16" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.mfr "American Power Conversion" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.mfr.date "2017/03/24" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.model "Back-UPS RS 900G" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.productid "0002" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.realpower.nominal "540" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.serial "3B1712X12050 " [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.status "OL" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.test.result "No test initiated" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.timer.reboot "0" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.timer.shutdown "-1" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: VAR UPS ups.vendorid "051d" [2021-03-14] [16:48:43] [DEBUG] [QUICKAPP96]: onDataReceived: END LIST VAR UPS C'est assez frustrant alors que sous la HC2 la méthode était plus facile. Saurez-vous me venir en aide ? Je vous remercie par avance. Désolé pour le long message.
  7. HC3 Achat le 26/02/2021 SN : HC3-00015321 Date de fabrication : Je sais pas !! Voilà ...
  8. Bon, je me réponds à moi-même : c'était un problème de serveur DNS de mon coté. Mais comme la HC2 fonctionnait bien, j'avais un doute. @Lazer a vu juste ! C'est donc réparé maintenant. Voilà ...
  9. Bonjour, J'ai un souci avec les variables du panneau de Variable d'un QuickApp. Dans une variable, au lieu de mettre une adresse IP, je mets le FQDN de type xxx.domaine.fr. Je constate que la fonction qui fait la connexion ne fonctionne pas dans ce cas. Dès que je remets une adresse IP (publique dans mon cas), cela fonctionne. Avez-vous rencontrez ce genre de souci ? Merci pour votre aide.
  10. Salut @Lazer, Je vais ouvrir un autre sujet, car je ne parle pas de GEA, mais de Variable à un QuickApp. Voilà ...
  11. Si dans l'url tu mets une adresse IP (type une adresse d'un site externe à ton réseau comme 8.8.8.8), alors cela fonctionne, le connect est OK. Par contre, si je mets "http : / /truc.muche.fr:8880" alors cela ne fonctionne plus. Mais ce n'est peut-être pas l'endroit pour en parler. Voilà ...
  12. Bonsoir, Dans GEA, dans l'url, mettre "127.0.0.1" au lieu de localhost et là le shutdown fonctionne presque ! J'ai le chenillard mais elle ne se coupe pas ! Elle reboot en boucle ! J'ai un souci avec un module qui va checker sur Internet, avec l'adresse IP cela fonctionne, mais avec le FQDN cela ne fonctionne pas. Avez-vous une idée sur ce souci ? Merci d'avance. Voilà ...
  13. Kana-chan

    Support Gea

    OK ! Cool ! Merci Laser. C'est bien pratique ce genre d'appel de méthode inter-quickapps !!
  14. Kana-chan

    Support Gea

    Bonjour à tous, Je voudrais savoir comment utiliser les fonctions des QuickApp dans GEA si c'est possible. Je voudrais faire un truc du genre : GEA.add({ {"Time", "07:26", "07:27"} }, 30, "", { {"QuickApp", id["COLOR_WP"], setIdWallPlug, [id["WP01_COLORS"]]}, {"QuickApp", id["COLOR_WP"], onOn, []} } ) En gros, je veux exécuter la méthode du QuickApp : setIdWallPlug avec l'argument id WP01_COLORS qui possède l'id COLOR_WP, et ensuite exécuter la méthode onOn qui ne possède pas d'argument. Merci pour votre aide.
  15. Kana-chan

    icones

    Bonjour à tous, Je ne vois pas la possibilité d'importer des images dans les QA que j'importe ou bien que je crée moi-même. Ai-je loupé une étape ? Merci pour votre aide.
  16. Alors oui, en effet, la variable status retourne bien 200 quand cela fonctionne. Merci pour tout !
  17. @Lazer, Ton code fonctionne, mais le print sur response ne fonctionne pas. Il semble que response soit une table. Sais-tu comment faire pour connaitre les détails de cette table ? Je te remercie par avance.
  18. Bonjour à vous. Merci beaucoup pour vos aides. Je vais regarder tout cela ce soir.
  19. Bonjour à tous, Je ne trouve pas comment faire le PUT dans une HC3 (que je viens de recevoir, en remplacement de ma HC2). Il se trouve que j'ai ce code là : local deviceID = fibaro:getGlobal("IdWallPlug"); --ID de Wallplug local IpHC2 = fibaro:get(fibaro:getSelfId(), "IPAddress"); -- IP HC2 local LoginHC2 = fibaro:getGlobal("LoginHC2"); -- login local MdpHC2 = fibaro:getGlobal("MdpHC2"); -- mot de passe local mycolor = '0'; -- choix de la couleur local text_remplace = '{"id":62,"size":1,"value":'..mycolor..'}'; local text_json = '{"id":'..deviceID..',"properties":{"parameters":['..text_remplace..']}}'; local HC2 = Net.FHttp(IpHC2, 80); HC2:setBasicAuthentication(LoginHC2, MdpHC2); local response ,status, errorCode = HC2:PUT("/api/devices/"..deviceID, text_json); fibaro:debug("Status: "..status); fibaro:debug("Error Code: "..errorCode); Et j'aimerai l'adapter dans la HC3, dans un QuickApp si j'ai bien compris. Or je n'y arrive pas, malgré les exemples fournis par Laser pour du code des scènes HC2 qui semble être identique pour la HC3. J'ai aussi cherché à utiliser api.put(), mais sans succès à cause de l'authentification... Pouvez-vous me donner un exemple de traduction du code ci-dessus pour un QuickApp HC3 ? Je vous remercie par avance.
  20. Kana-chan

    Netatmo Welcome

    Bonsoir, En effet, je parlais d'avoir les explications de la page en français ou anglais. Je ne maîtrise pas l'allemand.
  21. Kana-chan

    Netatmo Welcome

    Bonsoir, Et est-ce que par hasard, il y a une version en français ou anglais ? Merci.
  22. Kana-chan

    Perte connexion HC2 avec réseau

    Bonsoir, Sur la HC2, le bouton pour passer en mode maintenance et avoir le réseau qu'il faut n'est pas le bouton power, mais le bouton d'à coté. Non ? Et avec l'écran, vous pouvez voir que vous êtes alors sur le réseau de maintenance car il est écrit sur l'écran et donc, vous avez réalisé la bonne manipulation. A ce moment là, vous modifiez les paramètres de votre PC pour avoir le 192.168.81.2 par exemple, enfin, une adresse différente de celle affichée, différente sur le dernier nombre après le ".". Enfin, vous connectez le câble. Les lumières de la carte réseau semble fonctionner car vous le dites elle s'allument de manière désordonnées. Je pense que vous devriez réessayer.
  23. Bonjour, Le sud est pas mal non plus niveau tarifs, malheureusement...
  24. Kana-chan

    Petits bug de la HC3

    Et avez vous essayé "<br/>" au cas où ? Voilà ...
  25. Bonjour, Si pas de réseau, c'est aussi peut-être à cause du câble réseau, non ? Pourquoi ce serait la box ? En la remettant où elle était avant, est-ce que cela marche mieux ? Avez-vous fait des tests avec un autre appareil sur ce nouvel emplacement ? Voilà ...
×
×
  • Créer...