-
Compteur de contenus
178 -
Inscription
-
Dernière visite
iman's Achievements
-
Je vais essayé de voir la chose mais étant nul avec ce type de fonction
-
je ferai la modification par la suite et je vais chercher
-
dans le fichier config, j'ai juste modifier le mot de passe et créer une base phpMYAdmin avec identifiant root et mot de passe et pour le serveur j'ai également laissé localhost
-
non je n'ai aucun autre site et pour moi c'est nouveau j'ai fait la modification sur la ligne mais toujours le même message d'erreur
-
j'utilise mon synologie avec mariaDB 10 et phpMyAdmin dans le quel j'ai créer une base de donnée "domotique"
-
j'ai voulu installé domocharts, mais au moment de mettre l'url 192.1668.X.XXX/graph/install.php j'ai le message d'erreur Error : could not find driver mon serveur web est activé, j'ai copie le dossier gaph dans le dossier web et j'ai uniquement modifier le mot de passe et la je sèche
-
merci pepite, je vais regardé ça.Il n'est pas prévu pour la box fibaro une sauvegarde sur le cloud prochainement?
-
bonjour je souhaiterai conserver l'historique de ma consommation électrique sur plusieurs année, car au bout d'un moment cette historique est perdu sur la box, comment faire?
-
setpoint résolu et tous fonctionne
-
OJC, ma scène fonctionne mais le setpoint=1 °c il ne prend pas la consigne du VD?
-
honte à moi, je viens de trouver j'ai 2 VD et je change la variable suivant la cheminée si elle est en route et j'ai modifier qu'un seul des VD et évidemment le mauvais merci encore pour ton aide OJC sinon pour la régule c top
-
dans le VD les labels sont identique et voici la scène et message erreur: --[[ %% autostart %% properties 1078 ui.lbldressing.value 1078 ui.lblsalle.value 1078 ui.lblbureau.value 1078 ui.lblsalledebains.value 1078 ui.lblchambre.value 1078 ui.lblenfant.value 1078 ui.lblclara.value 1078 ui.lblmatheo.value %% globals --]] --[[ Heating Manager v. 1.3.0 (2017) by OJC This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. --]] --[[ Versions Notes 1.3.0 Add the possibility of using virtual device as heater controller Add the possibilité of using virtual device or global variable as setpoint provider 1.2.0 New regulation code, inspired by eedomus box Add the possibility of using virtual temperature sondes Configuration simplification for both Manager and Panel 1.1.0 Add motion sensor management Improve door/window sensor management Code Optimization 1.0.0 Initial release --]] ---------------------------------------------------------------------------------- -- GENERIC CODE -- ---------------------------------------------------------------------------------- logColor = {"YellowGreen", "SkyBlue", "NavajoWhite", "Tomato"} lib = {} function lib:iif(a,b,c) if (a) then return b else return c end end function lib:log(m,l) if ((l or 1) >= logLevel) then print('<span style="color:' .. logColor[l or 1] .. ';">' .. m .. '</span>') end end f = {"Ç","ç","[-èéêë']+","[-ÈÉÊË']+","[-àáâãäå']+","[-@ÀÁÂÃÄÅ']+","[-ìíîï']+","[-ÌÍÎÏ']+","[-ðòóôõö']+","[-ÒÓÔÕÖ']+","[-ùúûü']+","[-ÙÚÛÜ']+","[-ýÿ']+","Ý","%W"} r = {"C","c","e","E","a","A","i","I","o","O","u","U","y","Y",""} format = {} function format:ddigit(n) if (n < 10) then return "0"..n else return n end end function format:replace(s) local s = s for i, j in ipairs(f) do s = string.gsub(s, j, r) end return s end function getDeviceIDbyName(name) local devices = api.get("/devices?name=" .. name) if (devices[1] ~= nil) then return devices[1].id end end function getInstanceAuthorization(max) local t = os.time() local max = tonumber(max) or 1 while (fibaro:countScenes() > max) do fibaro:sleep(500) if (os.time() - t) > 30 then return false end end return true end --DEPENDENCIES = lib:log; getDeviceIDbyName function getPanelID() local p = panel local v = fibaro:getGlobalValue(p.global) if (fibaro:getValue(v, p.label) == nil) then local ID = getDeviceIDbyName(p.name) if (ID ~= nil) then fibaro:setGlobal(p.global, ID) return ID else lib:log("[CRITICAL ERROR] " .. p.name .. " was not found !", 4) fibaro:abort() end else return v end end --DEPENDENCIES = format:ddgit function getReadableTime(t) local d = "" local h = math.floor(t/3600) local m = math.floor(t/60 - (h * 60)) local s = math.floor(t - h * 3600 - m * 60) if (h > 0) then d = d .. format:ddigit(h) .. " h " end if (m > 0) then d = d .. lib:iif(h ~= 0, format:ddigit(m), m) .. " m " end if (s > 0) then d = d .. lib:iif(m ~= 0, format:ddigit(s), s) .. " s" end return d end function getTemperatureSonde(ID) local r = api.get("/rooms?id=" .. ID) return r.defaultSensors.temperature end function setGlobalVariables(...) for _, v in ipairs{...} do if (fibaro:getGlobalValue(v) == nil) then api.post("/globalVariables", {name = v, isEnum = 0}) end end end ---------------------------------------------------------------------------------- -- SPECIFIC CODE -- ---------------------------------------------------------------------------------- collection = {} HeatingManager = {} --DEPENDENCIES = GetTemperatureSonde; format:replace function HeatingManager:addHeater(idHeater, idSonde, localP, localT) local heater, on, off if type(idHeater) == "table" then heater, on, off = idHeater[1], idHeater[2], idHeater[3] else heater, on, off = idHeater, 0, 0 end table.insert(collection, { heater = heater, OnOff = lib:iif(on ~= 0, {on, off}, 0), sonde = idSonde or getTemperatureSonde(fibaro:getRoomID(heater)), kP = localP or default.kP, kT = localT or default.kT, panel = "lbl" .. format:replace(fibaro:getRoomNameByDeviceID(heater)) }) end --DEPENDENCIES = getPanelID function HeatingManager:getTemperatures(item) local c, s, e = 0, 0, 0 if (type(item.sonde) == "number") then c = fibaro:getValue(item.sonde, "value") elseif (type(item.sonde) == "table") then c = string.match(fibaro:getValue(item.sonde[1], "ui." .. item.sonde[2] .. ".value"), "[0-13]+[,.][0-13]+") or string.match(fibaro:getValue(item.sonde[1], "ui." .. item.sonde[2] .. ".value"), "[0-13]+") end s = string.match(fibaro:getValue(getPanelID(), "ui." .. item.panel .. ".value"), "[0-]+13[,.][0-13]+") or string.match(fibaro:getValue(getPanelID(), "ui." .. item.panel .. ".value"), "[0-13]+") if (outdoorSonde == nil) then o = api.get("/weather").Temperature elseif (type(outdoorSonde) == "number") then o = fibaro:getValue(outdoorSonde, "value") elseif (type(outdoorSonde) == "table") then o = string.match(fibaro:getValue(outdoorSonde[1], "ui." .. outdoorSonde[2] .. ".value"), "[0-9]+[,.][0-9]+") or string.match(fibaro:getValue(outdoorSonde[1], "ui." .. outdoorSonde[2] .. ".value"), "[0-9]+") end return c, s, o or s end function HeatingManager:setOutdoorSonde(idSonde) outdoorSonde = idSonde end ---------------------------------------------------------------------------------- -- MAIN CODE -- ---------------------------------------------------------------------------------- --DEPENDENCIES = lib:log; getReadableTime ; -- HeatingManager:getTemperatures function SceneRun() local collection = collection for _, item in ipairs(collection) do local current, setpoint, C, T, P = 0, 0, 0, 0, 0 lib:log("[INFO] Checking " .. fibaro:getRoomNameByDeviceID(item.heater) .. "...") current, setpoint, outdoor = HeatingManager:getTemperatures(item) if (current == nil) then lib:log("[ERROR] " .. fibaro:getRoomNameByDeviceID(item.heater) .. " have no Temperature Sonde !",4) fibaro:call(item.heater, "turnOff") break end lib:log("[INFO] Current = " .. current .. " °C - Setpoint = " .. setpoint .." °C - Outdoor = " .. outdoor .. " °C") P = math.min((item.kP * (setpoint - current)) + (item.kT * (setpoint - outdoor)),1) if (P > 0) then lib:log("[ACTION] Start heating in " .. fibaro:getRoomNameByDeviceID(item.heater) .. " for " .. getReadableTime(P * heatingCycle * 60), 2) if type(item.OnOff) == "number" then fibaro:call(item.heater, "turnOn") if (P < 1) then setTimeout(function() fibaro:call(item.heater, "turnOff") end, P * heatingCycle * 60 * 1000) end else fibaro:call(item.heater, "pressButton", item.OnOff[1]) if (P < 1) then setTimeout(function() fibaro:call(item.heater, "pressButton", item.OnOff[2]) end, P * heatingCycle * 60 * 1000) end end else lib:log("[INFO] Heating is not required in ".. fibaro:getRoomNameByDeviceID(item.heater)) if type(item.OnOff) == "number" then fibaro:call(item.heater, "turnOff") else fibaro:call(item.heater, "pressButton", item.OnOff[2]) end end end setTimeout(SceneRun, heatingCycle * 60 * 1000) end ---------------------------------------------------------------------------------- -- CONFIGURATION -- ---------------------------------------------------------------------------------- -- 1. Default Parameters default = {} default.kP = 3.1 default.kT = 0.02 -- For more information, see https://doc.eedomus.com/view/Algorithme_Chauffage -- 2. General Parameters heatingCycle = 10 logLevel = 1 -- 3. Collection Definition --[[ HeatingManager:addHeater(idHeater, [idSonde], [localP], [localT]) + idHeater = ID of heater control device or {ID of heater virtuel device, order number of the ON button, order number of the OFF button} + idSonde = ID of temperature sonde or {ID of temperature virtual device, ID of temperature label} - Optional : if not set, room temperature sonde is used + localP = Optional : if not set, default.kP is used + localT = Optional : if not set, default.kT is used --]] HeatingManager:addHeater({437, 1, 2}, 1053, localP, localT) HeatingManager:addHeater({511, 1, 2}, 453, 0.6, 0.01) HeatingManager:addHeater({438, 1, 2}, 1059, 2.6, localT) HeatingManager:addHeater({439, 1, 2}, 415, 1.2, 0.01) HeatingManager:addHeater({1076, 1, 2}, 1073, 0.6, 0.01) HeatingManager:addHeater({943, 1, 2}, 1070, 0.6, 0.01) HeatingManager:addHeater({1075, 1, 2}, 457, 0.6, 0.01) HeatingManager:addHeater({1077, 1, 2}, 450, 0.6, 0.01) --HeatingManager:setOutdoorSonde(ID Device or {ID VirtualDevice, ID Label}) --idSonde = ID Device or {ID VirtualDevice, ID Label} - Optional : If not set, weather plugin is used HeatingManager:setOutdoorSonde(1045) ------------------------------------------------------------------------- -- START CODE -- ------------------------------------------------------------------------- --DEPENDENCIES = lib:log; getInstanceAuthorization; -- HeatingManager:checkGlobalVariables; -- SceneRun trigger = fibaro:getSourceTrigger() if not (getInstanceAuthorization(lib:iif(trigger.type == "property", 9, 1))) then lib.log("[CRITICAL ERROR] Too many instances are running !", 4) fibaro:abort() end panel = {name = "Heating Panel", label = "ui.lblHeatingPanel.value", global = "HeatingPanelID"} setGlobalVariables("HeatingPanelID") if (trigger.type == "property") then for _, item in ipairs(collection) do if item.panel == string.match(trigger.propertyName,"ui.(%a+).value") then local current = 0 local setPoint = 0 current, setPoint = HeatingManager:getTemperatures(item) if (current == nil) then lib:log("[ERROR] " .. fibaro:getRoomNameByDeviceID(item.heater) .. " have no Temperature Sonde !",4) fibaro:call(item.heater, "turnOff") fibaro:abort() end if (current < setPoint) then lib.log("[OVERRIDE] Start heating in " .. fibaro:getRoomNameByDeviceID(item.heater), 4) fibaro:call(item.heater,"turnOn") elseif (current >= setPoint) then lib.log("[OVERRIDE] Heating is not required in " .. fibaro:getRoomNameByDeviceID(item.heater), 4) fibaro:call(item.heater,"turnOff") end end end else lib:log("Heating Manager v. 1.3.0 (2017) by OJC", 3) SceneRun() end [DEBUG] 17:54:32: [INFO] Checking chambre...[DEBUG] 17:54:32: line 153: bad argument #1 to 'match' (string expected, got nil)
-
entre temps temps j'ai rectifier et mis tous avec le label chambre ainsi que le nom de la pièce
-
la voici: --[[ %% autostart %% properties 1078 ui.lbldressing.value 1078 ui.lblsalle.value 1078 ui.lblbureau.value 1078 ui.lblsalledebains.value 1078 ui.lblchambre.value 1078 ui.lblenfant.value 1078 ui.lblclara.value 1078 ui.lblmatheo.value %% globals --]] --[[ Heating Manager v. 1.3.0 (2017) by OJC This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. --]] --[[ Versions Notes 1.3.0 Add the possibility of using virtual device as heater controller Add the possibilité of using virtual device or global variable as setpoint provider 1.2.0 New regulation code, inspired by eedomus box Add the possibility of using virtual temperature sondes Configuration simplification for both Manager and Panel 1.1.0 Add motion sensor management Improve door/window sensor management Code Optimization 1.0.0 Initial release --]] ---------------------------------------------------------------------------------- -- GENERIC CODE -- ---------------------------------------------------------------------------------- logColor = {"YellowGreen", "SkyBlue", "NavajoWhite", "Tomato"} lib = {} function lib:iif(a,b,c) if (a) then return b else return c end end function lib:log(m,l) if ((l or 1) >= logLevel) then print('<span style="color:' .. logColor[l or 1] .. ';">' .. m .. '</span>') end end f = {"Ç","ç","[-èéêë']+","[-ÈÉÊË']+","[-àáâãäå']+","[-@ÀÁÂÃÄÅ']+","[-ìíîï']+","[-ÌÍÎÏ']+","[-ðòóôõö']+","[-ÒÓÔÕÖ']+","[-ùúûü']+","[-ÙÚÛÜ']+","[-ýÿ']+","Ý","%W"} r = {"C","c","e","E","a","A","i","I","o","O","u","U","y","Y",""} format = {} function format:ddigit(n) if (n < 10) then return "0"..n else return n end end function format:replace(s) local s = s for i, j in ipairs(f) do s = string.gsub(s, j, r) end return s end function getDeviceIDbyName(name) local devices = api.get("/devices?name=" .. name) if (devices[1] ~= nil) then return devices[1].id end end function getInstanceAuthorization(max) local t = os.time() local max = tonumber(max) or 1 while (fibaro:countScenes() > max) do fibaro:sleep(500) if (os.time() - t) > 30 then return false end end return true end --DEPENDENCIES = lib:log; getDeviceIDbyName function getPanelID() local p = panel local v = fibaro:getGlobalValue(p.global) if (fibaro:getValue(v, p.label) == nil) then local ID = getDeviceIDbyName(p.name) if (ID ~= nil) then fibaro:setGlobal(p.global, ID) return ID else lib:log("[CRITICAL ERROR] " .. p.name .. " was not found !", 4) fibaro:abort() end else return v end end --DEPENDENCIES = format:ddgit function getReadableTime(t) local d = "" local h = math.floor(t/3600) local m = math.floor(t/60 - (h * 60)) local s = math.floor(t - h * 3600 - m * 60) if (h > 0) then d = d .. format:ddigit(h) .. " h " end if (m > 0) then d = d .. lib:iif(h ~= 0, format:ddigit(m), m) .. " m " end if (s > 0) then d = d .. lib:iif(m ~= 0, format:ddigit(s), s) .. " s" end return d end function getTemperatureSonde(ID) local r = api.get("/rooms?id=" .. ID) return r.defaultSensors.temperature end function setGlobalVariables(...) for _, v in ipairs{...} do if (fibaro:getGlobalValue(v) == nil) then api.post("/globalVariables", {name = v, isEnum = 0}) end end end ---------------------------------------------------------------------------------- -- SPECIFIC CODE -- ---------------------------------------------------------------------------------- collection = {} HeatingManager = {} --DEPENDENCIES = GetTemperatureSonde; format:replace function HeatingManager:addHeater(idHeater, idSonde, localP, localT) local heater, on, off if type(idHeater) == "table" then heater, on, off = idHeater[1], idHeater[2], idHeater[3] else heater, on, off = idHeater, 0, 0 end table.insert(collection, { heater = heater, OnOff = lib:iif(on ~= 0, {on, off}, 0), sonde = idSonde or getTemperatureSonde(fibaro:getRoomID(heater)), kP = localP or default.kP, kT = localT or default.kT, panel = "lbl" .. format:replace(fibaro:getRoomNameByDeviceID(heater)) }) end --DEPENDENCIES = getPanelID function HeatingManager:getTemperatures(item) local c, s, e = 0, 0, 0 if (type(item.sonde) == "number") then c = fibaro:getValue(item.sonde, "value") elseif (type(item.sonde) == "table") then c = string.match(fibaro:getValue(item.sonde[1], "ui." .. item.sonde[2] .. ".value"), "[0-9]+[,.][0-9]+") or string.match(fibaro:getValue(item.sonde[1], "ui." .. item.sonde[2] .. ".value"), "[0-9]+") end s = string.match(fibaro:getValue(getPanelID(), "ui." .. item.panel .. ".value"), "[0-]+9[,.][0-9]+") or string.match(fibaro:getValue(getPanelID(), "ui." .. item.panel .. ".value"), "[0-9]+") if (outdoorSonde == nil) then o = api.get("/weather").Temperature elseif (type(outdoorSonde) == "number") then o = fibaro:getValue(outdoorSonde, "value") elseif (type(outdoorSonde) == "table") then o = string.match(fibaro:getValue(outdoorSonde[1], "ui." .. outdoorSonde[2] .. ".value"), "[0-9]+[,.][0-9]+") or string.match(fibaro:getValue(outdoorSonde[1], "ui." .. outdoorSonde[2] .. ".value"), "[0-9]+") end return c, s, o or s end function HeatingManager:setOutdoorSonde(idSonde) outdoorSonde = idSonde end ---------------------------------------------------------------------------------- -- MAIN CODE -- ---------------------------------------------------------------------------------- --DEPENDENCIES = lib:log; getReadableTime ; -- HeatingManager:getTemperatures function SceneRun() local collection = collection for _, item in ipairs(collection) do local current, setpoint, C, T, P = 0, 0, 0, 0, 0 lib:log("[INFO] Checking " .. fibaro:getRoomNameByDeviceID(item.heater) .. "...") current, setpoint, outdoor = HeatingManager:getTemperatures(item) if (current == nil) then lib:log("[ERROR] " .. fibaro:getRoomNameByDeviceID(item.heater) .. " have no Temperature Sonde !",4) fibaro:call(item.heater, "turnOff") break end lib:log("[INFO] Current = " .. current .. " °C - Setpoint = " .. setpoint .." °C - Outdoor = " .. outdoor .. " °C") P = math.min((item.kP * (setpoint - current)) + (item.kT * (setpoint - outdoor)),1) if (P > 0) then lib:log("[ACTION] Start heating in " .. fibaro:getRoomNameByDeviceID(item.heater) .. " for " .. getReadableTime(P * heatingCycle * 60), 2) if type(item.OnOff) == "number" then fibaro:call(item.heater, "turnOn") if (P < 1) then setTimeout(function() fibaro:call(item.heater, "turnOff") end, P * heatingCycle * 60 * 1000) end else fibaro:call(item.heater, "pressButton", item.OnOff[1]) if (P < 1) then setTimeout(function() fibaro:call(item.heater, "pressButton", item.OnOff[2]) end, P * heatingCycle * 60 * 1000) end end else lib:log("[INFO] Heating is not required in ".. fibaro:getRoomNameByDeviceID(item.heater)) if type(item.OnOff) == "number" then fibaro:call(item.heater, "turnOff") else fibaro:call(item.heater, "pressButton", item.OnOff[2]) end end end setTimeout(SceneRun, heatingCycle * 60 * 1000) end ---------------------------------------------------------------------------------- -- CONFIGURATION -- ---------------------------------------------------------------------------------- -- 1. Default Parameters default = {} default.kP = 3.1 default.kT = 0.02 -- For more information, see https://doc.eedomus.com/view/Algorithme_Chauffage -- 2. General Parameters heatingCycle = 10 logLevel = 1 -- 3. Collection Definition --[[ HeatingManager:addHeater(idHeater, [idSonde], [localP], [localT]) + idHeater = ID of heater control device or {ID of heater virtuel device, order number of the ON button, order number of the OFF button} + idSonde = ID of temperature sonde or {ID of temperature virtual device, ID of temperature label} - Optional : if not set, room temperature sonde is used + localP = Optional : if not set, default.kP is used + localT = Optional : if not set, default.kT is used --]] HeatingManager:addHeater({437, 1, 2}, 1053, localP, localT) HeatingManager:addHeater({511, 1, 2}, 453, 0.6, 0.01) HeatingManager:addHeater({438, 1, 2}, 1059, 2.6, localT) HeatingManager:addHeater({439, 1, 2}, 415, 1.2, 0.01) HeatingManager:addHeater({1076, 1, 2}, 1073, localP, localT) HeatingManager:addHeater({943, 1, 2}, 1070, 0.6, 0.01) HeatingManager:addHeater({1075, 1, 2}, 457, 2.6, localT) HeatingManager:addHeater({1077, 1, 2}, 450, 1.2, 0.01) --HeatingManager:setOutdoorSonde(ID Device or {ID VirtualDevice, ID Label}) --idSonde = ID Device or {ID VirtualDevice, ID Label} - Optional : If not set, weather plugin is used HeatingManager:setOutdoorSonde(1045) ------------------------------------------------------------------------- -- START CODE -- ------------------------------------------------------------------------- --DEPENDENCIES = lib:log; getInstanceAuthorization; -- HeatingManager:checkGlobalVariables; -- SceneRun trigger = fibaro:getSourceTrigger() if not (getInstanceAuthorization(lib:iif(trigger.type == "property", 9, 1))) then lib.log("[CRITICAL ERROR] Too many instances are running !", 4) fibaro:abort() end panel = {name = "Heating Panel", label = "ui.lblHeatingPanel.value", global = "HeatingPanelID"} setGlobalVariables("HeatingPanelID") if (trigger.type == "property") then for _, item in ipairs(collection) do if item.panel == string.match(trigger.propertyName,"ui.(%a+).value") then local current = 0 local setPoint = 0 current, setPoint = HeatingManager:getTemperatures(item) if (current == nil) then lib:log("[ERROR] " .. fibaro:getRoomNameByDeviceID(item.heater) .. " have no Temperature Sonde !",4) fibaro:call(item.heater, "turnOff") fibaro:abort() end if (current < setPoint) then lib.log("[OVERRIDE] Start heating in " .. fibaro:getRoomNameByDeviceID(item.heater), 4) fibaro:call(item.heater,"turnOn") elseif (current >= setPoint) then lib.log("[OVERRIDE] Heating is not required in " .. fibaro:getRoomNameByDeviceID(item.heater), 4) fibaro:call(item.heater,"turnOff") end end end else lib:log("Heating Manager v. 1.3.0 (2017) by OJC", 3) SceneRun() end et avec le panneau le déboguer est OK par contre message erreur avec la scène sur le rajout à partir de chambre
-
OJC, j'ai voulu rajouter 4 radiateurs supplémentaires soit 8 au total et j'ai ce message d'erreur avec le heating manager 1.3: [DEBUG] 15:16:01: [INFO] Checking notre chambre...[DEBUG] 15:16:01: line 154: bad argument #1 to 'match' (string expected, got nil)