Liquidationen Wie endet Dein Skript tatsächlich?
Irgendeine Debug-Ausgabe vorhanden ?
Beiträge von PatrickR
VPN/Proxy erkannt
Es scheint, dass Sie einen VPN- oder Proxy-Dienst verwenden. Bitte beachten Sie, dass die Nutzung eines solchen Dienstes die Funktionalität dieser Webseite einschränken kann.
-
-
Hallo Beta_Buerger ; DIYROLLY
hab nun die Version 1.5 "Control_Gong_v1.5.js" erstellt.
Über verschiedene WebHooks, kann der Ausgang des Shellys ein-/ausgeschaltet werden.
Über einen anderen WH, kann für eine Zeit tm in Minuten das Ein-/Ausschalten blockiert bzw. freigegeben werden.Per WebHook kann der Status in DE bzw. EN abgerufen werden.
Beispiele:
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?Gong_ON=>Antwort im Browser:
[Gong_ON] true===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?locked_tm:20
=>Antwort im Browser:
[locked_tm:20] true===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?unlocked_tm:20
=>Antwort im Browser:
[unlocked_tm:20] true===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?status_de=>Antwort im Browser:
Gong Status: [status_de]
Der Gong (Id:0) angeschaltet
Die Gongaktivierung ist blockiert
Restlaufzeite: 00:19:38 (hh:mm:ss)===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?status_en
=>Antwort im Browser:
Request: [status_en]
Relay output (Id:0): true
Control relay locked: true
Remaining time: 00:19:38 (hh:mm:ss)===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?Gong_ON=>Antwort im Browser:
[Gong_ON] true===
ht tp://EigeneIP/script/ScriptID/Gong_ENDPOINT?Gong_OFF=>Antwort im Browser:
[Gong_OFF] Gong control locked
Bitte großzügig über Englischschreibfehler hinwegsehenBestimmt kann man manches einfacher/anders programmieren.
So hat jeder seinen Programmierstil.Eingabefehler sind nicht abgefangen,
daher bitte auf korrekte Eingabe achten.
Viel Spaß.Patrick
Code
Alles anzeigen// Control_Gong_v1.5 // 18.01.2025 by PatrickR // // 14.12.2024 v1.0 // 15.12.2024 v1.1 time control: locking/unlocking controlling the relay after x minutes // 17.12.2024 v1.2 remaining time in the response of the status, Gong_OFF, naming changed // 17.12.2024 v1.3 add Math.round for calculation in fkt_calc_endtime() // 01.01.2025 v1.4 add 2nd status answer // 18.01.2025 v1.5 change request reply // // // The ouput will be switched ON by receving a command via Endpoint "Gong_ON" // Via WebHook will the output blocked // // WebHook to activate Gong (enter correct IP and scriptId): // http://IP/script/scriptId/Gong_ENDPOINT?Gong_ON // IP: shelly of the IP // scriptId: Id of the script // // WebHook to deactivate Gong (enter correct IP and scriptId): // http://IP/script/scriptId/Gong_ENDPOINT?Gong_OFF // IP: shelly of the IP // scriptId: Id of the script // // WebHook to unlock relay control via this script (enter correct IP, scriptId and minutes): // http://IP/script/scriptId/Gong_ENDPOINT?unlocked_tm // http://IP/script/scriptId/Gong_ENDPOINT?unlocked_tm:minutes // IP: shelly of the IP // scriptId: Id of the script // minutes: time after the relay control of this script will be locked // // WebHook to lock relay control via this script (enter correct IP, scriptId and minutes): // http://IP/script/scriptId/Gong_ENDPOINT?locked_tm // http://IP/script/scriptId/Gong_ENDPOINT?locked_tm:minutes // IP: shelly of the IP // scriptId: Id of the script // minutes: time after the relay control of this script will be unlocked // // WebHook to read status in EN of the relay control (enter correct IP and scriptId): // http://IP/script/scriptId/Gong_ENDPOINT?status_en // IP: shelly of the IP // scriptId: Id of the script // // WebHook to read status in DE of the relay control (enter correct IP and scriptId): // http://IP/script/scriptId/Gong_ENDPOINT?status_de // IP: shelly of the IP // scriptId: Id of the script // // // Endpoint_Solution by ostfriese // GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 // More information: https://www.gnu.org/licenses/gpl-3.0.txt // ABSOLUTELY NO WARRANTY AT ALL!!! // Made by ostfriese. // // **************************************************************************************** // **************************************************************************************** // ******************************* GLOBAL ******************************* // **************************************************************************************** // **************************************************************************************** let debug_step0 = 0; let debug_step1 = 0; let vbCrLf = "\n\r"; let vbLf = "\n"; let strIP = ""; // **************************************************************************************** // **************************************************************************************** // ******************************* CONFIG ******************************* // **************************************************************************************** // **************************************************************************************** let CONFIG = { local: { script_id: 0, // not to change, will be change at runtime switchId: 0, // relay output id 0 or id 1 ep_req_Gong_ON: "Gong_ON", // request to switch output ON ep_req_Gong_OFF: "Gong_OFF", // request to switch output OFF ep_req_Gong_unlocked: "unlocked_tm", // request to unlock output (optional tm in minutes) ep_req_Gong_locked: "locked_tm", // request to lock output (optional tm in minutes) ep_req_Gong_status_en: "status_en", // request status in english ep_req_Gong_status_de: "status_de", // request status in german ep_req_replyStart: "[", // highlight request command Start ep_req_replyEnd: "]", // highlight request command End delimiter_timer: ":", // delimiter of timer value timer_handler: null, // handler variable of timer tms_shellyTimeEnd: 0, // calculated unixtime when timer ends endpoint_locked: true, // problem that endpoint process is locked by an other request ctl_Gong_locked: false // status if request to switch output is locked } } // **************************************************************************************** // **************************************************************************************** // ******************************* DEBUG ******************************** // **************************************************************************************** // **************************************************************************************** function fkt_debug_s0(to_print) { if (debug_step0 > 0) { print(to_print); } }; function fkt_debug_s1(to_print) { if (debug_step1 > 0) { print(to_print); } }; // **************************************************************************************** // **************************************************************************************** // ***************************** FUNCTION ****************************** // **************************************************************************************** // **************************************************************************************** function fkt_calc_endtime(tm_timer) { let tms_shellyTimeCur = Shelly.getComponentStatus("sys").unixtime; fkt_debug_s1("tms_shellyTimeCur: " + tms_shellyTimeCur); CONFIG.local.tms_shellyTimeEnd = tms_shellyTimeCur + Math.round(tm_timer * 60); } function fkt_remaining_time() { let tms_shellyTimeCur = Shelly.getComponentStatus("sys").unixtime; let tms_newShellyTime = CONFIG.local.tms_shellyTimeEnd - tms_shellyTimeCur; let t_hour = "00"; let t_min = "00"; let t_sec = "00"; if (tms_newShellyTime > 0) { t_hour = t_hour + Math.floor(tms_newShellyTime / 3600); t_min = t_min + Math.floor(tms_newShellyTime / 60) % 60; t_sec = t_sec + (tms_newShellyTime % 60); } let retvalue = strRight(t_hour, 2) + ":" + strRight(t_min, 2) + ":" + strRight(t_sec, 2) + " (hh:mm:ss)"; fkt_debug_s1("remaining time: " + retvalue); return retvalue; } function fkt_send_response(response, strBody) { response.code = 200; response.body = strBody; response.send(); } function fkt_check_Endpoint(request, response) { if (CONFIG.local.endpoint_locked) { fkt_debug_s1("fkt_check_Endpoint: locked"); return; } else { fkt_debug_s1("fkt_check_Endpoint: not yet locked"); let arrReqsplit = request.query.split(CONFIG.local.delimiter_timer); let strReply = CONFIG.local.ep_req_replyStart + request.query + CONFIG.local.ep_req_replyEnd + " "; switch (arrReqsplit[0]) { case CONFIG.local.ep_req_Gong_ON: fkt_Endpoint_Gong_ON_OFF(true, response, strReply); break; case CONFIG.local.ep_req_Gong_OFF: fkt_Endpoint_Gong_ON_OFF(false, response, strReply); break; case CONFIG.local.ep_req_Gong_unlocked: fkt_Endpoint_Gong_unlocked(arrReqsplit[1]); strReply = strReply + !CONFIG.local.ctl_Gong_locked; fkt_send_response(response, strReply); break; case CONFIG.local.ep_req_Gong_locked: fkt_Endpoint_Gong_locked(arrReqsplit[1]); strReply = strReply + CONFIG.local.ctl_Gong_locked; fkt_send_response(response, strReply); break; case CONFIG.local.ep_req_Gong_status_en: fkt_Endpoint_Gong_status(response, request.query, "en"); break; case CONFIG.local.ep_req_Gong_status_de: fkt_Endpoint_Gong_status(response, request.query, "de"); break; } } }; function fkt_Endpoint_Gong_ON_OFF(booOutput, responseIN, strReply) { let strReturn = "data missing"; if (CONFIG.local.endpoint_locked) { strReturn = "endpoint_locked"; return strReturn; } CONFIG.local.endpoint_locked = true; if (CONFIG.local.ctl_Gong_locked === true) { fkt_debug_s1("fkt_Endpoint_Gong_ON_OFF: Gong control locked"); strReturn = "Gong control locked"; fkt_send_response(responseIN, (strReply + strReturn)); } else { let arrUD = [responseIN, strReply, booOutput]; let swRelay = { id: CONFIG.local.switchId, on: arrUD[2] }; Shelly.call("Switch.Set", swRelay, function (response, error_code, error_message, ud) { fkt_debug_s1(JSON.stringify(response)); let SW_Out = Shelly.getComponentStatus("switch", CONFIG.local.switchId).output if (ud[2] === false) { SW_Out = !SW_Out; // question is if out is off, means if .output is false then answere is true } fkt_send_response(ud[0], (ud[1] + SW_Out)) }, arrUD ); } CONFIG.local.endpoint_locked = false; return strReturn; } function fkt_Endpoint_Gong_unlocked(minutes_till_out_be_locked) { if (CONFIG.local.endpoint_locked) { return; } CONFIG.local.endpoint_locked = true; fkt_unlock_ctl_out(); Timer.clear(CONFIG.local.timer_handler); if (minutes_till_out_be_locked !== undefined) { fkt_calc_endtime(minutes_till_out_be_locked); let tms = minutes_till_out_be_locked * 60 * 1000; // minutes in milliseconds CONFIG.local.timer_handler = Timer.set(tms, false, fkt_lock_ctl_out); } else { CONFIG.local.tms_shellyTimeEnd = 0; } CONFIG.local.endpoint_locked = false; } function fkt_Endpoint_Gong_locked(minutes_till_out_be_unlocked) { if (CONFIG.local.endpoint_locked) { return; } CONFIG.local.endpoint_locked = true; fkt_lock_ctl_out(); Timer.clear(CONFIG.local.timer_handler); if (minutes_till_out_be_unlocked !== undefined) { fkt_calc_endtime(minutes_till_out_be_unlocked); let tms = minutes_till_out_be_unlocked * 60 * 1000; // minutes in milliseconds CONFIG.local.timer_handler = Timer.set(tms, false, fkt_unlock_ctl_out); } else { CONFIG.local.tms_shellyTimeEnd = 0; } CONFIG.local.endpoint_locked = false; } function fkt_Endpoint_Gong_status(resp, requestquery, version) { if (CONFIG.local.endpoint_locked) { fkt_send_response(resp, requestquery); return; } CONFIG.local.endpoint_locked = true; let switchStatus = Shelly.getComponentStatus("switch", CONFIG.local.switchId).output; let strResp = ""; let tm_remain_time = "00:00:00 (hh:mm:ss)"; if (CONFIG.local.tms_shellyTimeEnd !== 0) { tm_remain_time = fkt_remaining_time(); } switch (version) { case "en": strResp = "Request: " + CONFIG.local.ep_req_replyStart + requestquery + CONFIG.local.ep_req_replyEnd + vbLf + "Relay output (Id:" + CONFIG.local.switchId + "): " + switchStatus + vbLf + "Control relay locked: " + CONFIG.local.ctl_Gong_locked + vbLf + "Remaining time: " + tm_remain_time; break; case "de": let strGongActivation = 'm' + chr(246) + 'glich'; if (CONFIG.local.ctl_Gong_locked) strGongActivation = "blockiert"; let strSwitchStatus = "ausgeschaltet"; if (switchStatus) strSwitchStatus = "angeschaltet"; strResp = "Gong Status: " + CONFIG.local.ep_req_replyStart + requestquery + CONFIG.local.ep_req_replyEnd + vbLf + "Der Gong (Id:" + CONFIG.local.switchId + ") ist " + strSwitchStatus + vbLf + "Die Gongaktivierung ist " + strGongActivation + vbLf + "Restlaufzeit: " + tm_remain_time; break; } fkt_send_response(resp, strResp); CONFIG.local.endpoint_locked = false; } function fkt_lock_ctl_out() { CONFIG.local.ctl_Gong_locked = true; fkt_debug_s1("fkt_lock_ctl_out"); } function fkt_unlock_ctl_out() { CONFIG.local.ctl_Gong_locked = false; fkt_debug_s1("fkt_unlock_ctl_out"); } function fkt_get_own_ip() { // fkt_debug_s0("get_own_ip"); Shelly.call("WiFi.GetStatus", null, function (status) { strIP = status.sta_ip; }); } function strRight(fulltext, numberChar) { let result = fulltext.substr(fulltext.length - numberChar, numberChar); return result } function fkt_start() { HTTPServer.registerEndpoint("Gong_ENDPOINT", fkt_check_Endpoint); CONFIG.local.script_id = Shelly.getCurrentScriptId(); fkt_debug_s0("Your possible urls are:"); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_ON); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_OFF); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_unlocked); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_unlocked + ":60"); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_locked); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_locked + ":60"); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_status_en); fkt_debug_s0("http://" + strIP + "/script/" + CONFIG.local.script_id + "/Gong_ENDPOINT?" + CONFIG.local.ep_req_Gong_status_de); CONFIG.local.endpoint_locked = false; } print("start 'Control_Gong_v1.5' & debug_step0/debug_step1: " + debug_step0 + "/" + debug_step1); fkt_get_own_ip(); Timer.set(1000, false, fkt_start);
-
svenbuer
Danke für die RückmeldungMittels
ht tp://IP/rpc/BTHomeDevice.GetKnownObjects?id=200
Kannst Du sehen, welche Komponenten dem Shelly bekannt sind.
IP und 200 anpassen bzw. 200 aufwärts probieren.
Hinweis: Die obj_id ist ein Dezimal-Wert, dieser kann hier als HEX-Wert nachgeschlagen werden https://bthome.io/format/
Beispiel:
{"id":200,"objects":[{"obj_id":1,"idx":0,"component":"bthomesensor:200"},{"obj_id":46,"idx":0,"component":"bthomesensor:201"},{"obj_id":69,"idx":0,"component":"bthomesensor:202"}]}
Patrick -
Hallo svenbuer ,
die IP vom Shelly ist eine feste IP ?
Kannst Du -wenn der Fehler- wieder auftritt die IP in der Geräteinformation vom Shelly prüfen ?
Der BLU und der Shelly haben aktuelle Firmware ?
PatrickNachtrag:
Im BLU wird Dir in der App angezeigt (erster Tab/Reiter), wann er das letzte mal und mit welchem Shelly Verbindung hatte. -
Danke.
Wer weiß.
Einfach mal beobachten.
ht tp://192.168.0.33/rpc/BTHomeSensor.GetStatus?id=201
=> {"id":201,"value":87,"last_updated_ts":1736452720}Der Timestamp 1736452720 entspricht dem 09.01.2025 um 20:58:40 Uhr.
(gilt für UTC+1)
https://www.confirado.de/tools/timestamp-umrechner.htmlWird alle 60sec aktualisiert.
Kannst somit prüfen, dass(ob) der Timestamp-Wert sich ändert.
Patrick -
Hallo svenbuer
kannst Du mal über einen WebBrowser deinen Shelly aufrufen
und dort im Script-Bereich das Script stoppen und die Consolenausgabe unten leeren.
Dann das Script starten und die Ausgabe der Console posten (bitte die Ausgabe von min. 2 Minuten)?
Desweiteren die Antwort auf folgendes Kommando ?
(URLs ohne Leerzeichen verwenden)
ht tp://192.168.0.33/rpc/BTHome.GetObjectInfos?obj_ids=[2,3,4] -
Hallo svenbuer ,
ich hab die IP, URL und das Auslesen des Wertes im Skript vom DeKat angepaßt.
Sonst habe ich nichts geändert.
PatrickCode
Alles anzeigenvar intervall = 60, //Humidity Checking Intervall, in Seconds remoteIP = "192.168.0.33", //Remote Shelly IP, as String BTH_H_id = "201", //BTHomeSensor-Id for humidity hum_delta_min = -20, //Hum_min negativ Delta, to turn on, 0 if not needed hum_delta_max = -5, //Hum_max postiv Delta, to turn off, 0 if not needed debug = true; //Wenn die Luftfeuchtigkeit um einen gewissen Wert außen niedriger ist, wie in der Garage, soll das Relay des Shelly Plus 1 in der Garage geschlossen werden. function Check_Loop(res) { try { if (res.code !== 200) return; //Exit if wrong Response // let extern_hum = Number(JSON.parse(res.body).rh); //Getting remote Humidity Value let extern_hum = Number(JSON.parse(res.body).value); //Getting remote Humidity Value from BTHomeSensor let intern_hum = Number(Status('Humidity', 100).rh); //Getting local Humidity Value let hum_Delta = extern_hum - intern_hum; //Calc hum Delta if (debug) print('Debug: Hum delta-->', hum_Delta, 'ext_h-->', extern_hum, 'int_h-->', intern_hum); //Debug output if (hum_delta_min && hum_Delta < hum_delta_min) Call("Switch.set", { id: 0, on: true }, null, null, debug); //Switching Relay Channed 0 on if (hum_delta_max && hum_Delta > hum_delta_max) Call("Switch.set", { id: 0, on: false }, null, null, debug); //Switching Relay Channel 0 off } catch (e) { ErrorMsg(e, 'Check_Loop()'); } //Error Handler } let tH1 = 0; //Timer Handler function Main() { if (!tH1) Timer.set(1000 * intervall, true, function () { //Endless Loop Call("http.get", { url: "http://" + remoteIP + "/rpc/BTHomeSensor.GetStatus?id=" + BTH_H_id, timeout: 5 }, Check_Loop, null, debug); //Call Remote Shelly // Call("http.get", { url: "http://" + remoteIP + "/rpc/Humidity.GetStatus?id=100", timeout: 5 }, Check_Loop, null, debug); //Call Remote Shelly }); } // Dekats Toolbox, a universal Toolbox for Shelly scripts function ErrorChk(r, e, m, d) { //Shelly.call error check try { aC--; if (aC < 0) aC = 0; if (d.CB && d.uD) d.CB(r, d.uD); if (d.CB && !d.uD) d.CB(r); if (!d.CB && d.uD) print('Debug: ', d.uD); if (e) throw new Error(Str(m)); if (Str(r) && Str(r.code) && r.code !== 200) throw new Error(Str(r)); } catch (e) { ErrorMsg(e, 'ErrorChk(), call Answer'); } } function Cqueue() { //Shelly.call queue try { if (!cCache[0] && !nCall[0]) return; while (cCache[0] && aC < callLimit) { if (cCache[0] && !nCall[0]) { nCall = cCache[0]; cCache.splice(0, 1); } if (nCall[0] && aC < callLimit) { Call(nCall[0], nCall[1], nCall[2], nCall[3], nCall[4]); nCall = []; } } if (tH9) { Timer.clear(tH9); tH9 = 0; } if (nCall[0] || cCache[0]) if (cSp <= 0) cSp = 0.1; tH9 = Timer.set(1000 * cSp, 0, function () { tH9 = 0; Cqueue(); }); } catch (e) { ErrorMsg(e, 'Cqueue()'); } } function Call(m, p, CB, uD, deBug) { //Upgrade Shelly.call try { let d = {}; if (deBug) print('Debug: calling:', m, p); if (CB) d.CB = CB; if (Str(uD)) d.uD = uD; if (!m && CB) { CB(uD); return; } if (aC < callLimit) { aC++; Shelly.call(m, p, ErrorChk, d); } else if (cCache.length < cacheLimit) { cCache.push([m, p, CB, uD, deBug]); if (deBug) print('Debug: save call:', m, p, ', call queue now:', cCache.length); Cqueue(); } else { throw new Error('to many Calls in use, droping call: ' + Str(m) + ', ' + Str(p)); } } catch (e) { ErrorMsg(e, 'Call()'); } } function Str(d) { //Upgrade JSON.stringify try { if (d === null || d === undefined) return null; if (typeof d === 'string') return d; return JSON.stringify(d); } catch (e) { ErrorMsg(e, 'Str()'); } } function Cut(f, k, o, i) { //Upgrade slice f=fullData, k=key-> where to cut, o=offset->offset behind key, i=invertCut try { let s = f.indexOf(k); if (s === -1) return; if (o) s = s + o.length || s + o; if (i) return f.slice(0, s); return f.slice(s); } catch (e) { ErrorMsg(e, 'Cut()'); } } function Setup() { //Wating 2sek, to avoid a Shelly FW Bug try { if (Main && !tH9) { tH9 = Timer.set(2000, 0, function () { print('\nStatus: started Script _[', scriptN, ']_'); if (callLimit > 5) { callLimit = 5; } try { Main(); } catch (e) { ErrorMsg(e, 'Main()'); tH9 = 0; Setup(); } }); } } catch (e) { ErrorMsg(e, 'Setup()'); } } function ErrorMsg(e, s, deBug) { //Toolbox formatted Error Msg try { let i = 0; if (Cut(e.message, '-104: Timed out')) i = 'wrong URL or device may be offline'; if (s === 'Main()' || deBug) i = e.stack; if (Cut(e.message, '"Main" is not')) i = 'define a Main() function before using Setup()'; print('Error:', s || "", '---> ', e.type, e.message); if (i) print('Info: maybe -->', i); } catch (e) { print('Error: ErrorMsg() --->', e); } } var tH8 = 0, tH9 = 0, aC = 0, cCache = [], nCall = [], callLimit = 5, cacheLimit = 40, cSp = 0.1; //Toolbox global variable var Status = Shelly.getComponentStatus, Config = Shelly.getComponentConfig; //Renamed native function var info = Shelly.getDeviceInfo(), scriptID = Shelly.getCurrentScriptId(), scriptN = Config('script', scriptID).name; //Pseudo const, variabel //Toolbox v3.5 -Alpha(cut), Shelly FW >1.0.8 Setup();
-
Ich hab das Video, komplett angesehen und keinen Hinweis auf die Komponenten-ID gefunden.
15:10 BTHomeSensor (203) -> Id 203 per WebBrowser
Oder per Browser-Aufruf (http ohne Blank)
ht tp://IP-BLUE-GW/rpc/BTHome.GetObjectInfos?obj_ids=[2,3,4] -
Hallo svenbuer ,
ich meinte die Komponenten Id,
welche vorhanden ist nachdem die BTHome Componente über das BLU-GW eingerichtet wird.
Ich kenne aktuell nur das Video in der es erklärt wird, siehe oben.
Mir der Id kann dann das Skript mit dem neuem URL/IP angepaßt werden,
http://ip_blu_gw/rpc/BTHomeSensor.GetStatus?id=ID
z.B. http://192.168.178.123/rpc/BTHomeSensor.GetStatus?id=201
Patrick -
Der URL Aufruf muss an den BLU H&T angepasst werden.
Ist der BLU über Bluetooth vom Gen3 eingebunden?
Welche Component-Nr. hat der Feuchtesensor?
Tipp:
PS: Bin gerade unterwegs, daher etwas kurz
-
Hab's noch nicht ganz verstanden.
1. Klick -> Licht an, Button blau
2. Klick -> Licht aus, Button grau
bzw. korrigiere mich.
Wie sind die Einstellungen "Eingang-/Ausgangeinstellungen" ?
Und ist es bei allen gleich das Verhalten ?
Aktuelle Firmware drauf?
Das liegt nicht am PM.
Patrick
-
oder über die Absolute Luftfeuchtigkeit
ohne Gewähr
Calculation_absolute_humidity_v1.1Code
Alles anzeigen// Calculation_absolute_humidity_v1.1 // by PatrickR // 26.12.2024 // // This script is calculating the absolute humidity // This script is based on the script by Jan Nikolas Dicke // https://www.jandicke.net/tools/ which is based on the blog by Peter Mander // https://carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity/ // // **************************************************************************************** // **************************************************************************************** // ******************************* GLOBAL ******************************* // **************************************************************************************** // **************************************************************************************** let debug_step0 = 1; let debug_step1 = 0; //let vbCrLf = "\n\r"; //let vbLf = "\n"; //let vbTab = "\t"; // **************************************************************************************** // **************************************************************************************** // ******************************* CONFIG ******************************* // **************************************************************************************** // **************************************************************************************** // **************************************************************************************** // **************************************************************************************** // ******************************* DEBUG ******************************** // **************************************************************************************** // **************************************************************************************** function fkt_debug_s0(to_print) { if (debug_step0 > 0) { print(to_print); } }; function fkt_debug_s1(to_print) { if (debug_step1 > 0) { print(to_print); } }; // **************************************************************************************** // **************************************************************************************** // ***************************** FUNCTION ****************************** // **************************************************************************************** // **************************************************************************************** function fkt_calc_airing(temp_in, relhum_in, temp_out, relhum_out) { let open_to_airing = 99; // error if (relhum_in && relhum_out && temp_in && temp_out) { let abshum_in = fkt_calc_AbsHum(temp_in, relhum_in); // absolute humidity inside let abshum_out = fkt_calc_AbsHum(temp_out, relhum_out); // absolute humidity outside let abshum_diff = Math.abs(abshum_in - abshum_out); // difference between inside to outside let abshum_diff_rnd = Math.round(abshum_diff * 100) / 100; // round 2 decimal places let result_info = ""; if (abshum_diff < 1) { result_info = "does not change or only slightly"; open_to_airing = 0; } else { if (abshum_in < abshum_out) { result_info = "rises about " + abshum_diff_rnd + "g/m³"; open_to_airing = -1; } if (abshum_in > abshum_out) { result_info = "drops about " + abshum_diff_rnd + "g/m³"; open_to_airing = 1; } } // result fkt_debug_s1("Information: The humidity inside " + result_info); fkt_debug_s1("Outside: absolute humidity: " + abshum_out + "g/m³."); fkt_debug_s1("Inside: absolute humidity: " + abshum_in + "g/m³."); } return open_to_airing; } /* Calculation absolute humidity in g/m3 */ function fkt_calc_AbsHum(temp, relhum) { let cnt = 6.112 * Math.pow(Math.E, (17.67 * temp) / (temp + 243.5)) * relhum * 2.1674 / (273.15 + temp); let abshum = Math.round(cnt * 100) / 100; // round 2 decimal places return abshum; } // **************************************************************************************** // **************************************************************************************** // ***************************** END ****************************** // **************************************************************************************** // **************************************************************************************** print("start 'Calculation_absolute_humidity_v1.1' & debug_step0/debug_step1/debug_step2: " + debug_step0 + "/" + debug_step1 + "/" + debug_step2); let airing = 127; // fkt_calc_result_info_airing(temp_in, relhum_in, temp_out, relhum_out); airing = fkt_calc_airing(28.5, 60.5, 35.5, 30.5); fkt_debug_s0("airing: " + airing);
-
Ohne Gewähr
Partial use of the script from "https://www.omnicalculator.com" in clarificationCode// Calculation_dew_point_v1.0 // by PatrickR // 23.12.2024 // // This script is calculating the dew point (Taupunkt) // // Formula for calculation from "Hanna Pamula" (l is l striked through) // https://www.omnicalculator.com/de/physik/taupunkt-rechner Partial use of the script from "https://www.omnicalculator.com" in clarification
-
Hallo apreick , Flutschi ,
stimmt schon, korrekt ist es über den Taupunkt-Vergleich Außen <-> Innen zu schalten/lüften.
Dem svenbuer ging es aber erstmal drum den BLU H&T einsetzen zu können.
Patrick
TP Bestimmung muss noch bei mir warten, sollte aber letztendlich kein Problem sein (abgesehen von der mir zur Verfügung stehenden Zeit) -
So korrekt?
Ist:
Shelly 1 AddOn Feuchte Innen
Shelly 1 AddOn Feuchte Außen
Soll:
Shelly 1 Gen3 AddOn Feuchte Innen
BLU H&T Feuchte Außen -
Hallo svenbuer
kannst Du Deine geplante Schaltung beschreiben ?
Was ersetzt was und was wird wo verbunden sein ?
Patrick -
svenbuer
Mit Gen3/Pro Geräten, kannst Du das BLU über BTHome/Components mit dem Shelly Gen3/Pro verbinden,
und ein Skript verwenden, was auf die Daten zugreift, ohne das BLU-Protokoll berücksichtigen zu müssen,
wie es im BLU_Events vom DeKat umgesetzt ist.
Hier ein Erklärvideo bzgl. Einrichtung:
https://www.youtube.com/watch?v=ojDMNUlaZm4
Und ja, das Skript kann man dann anpassen. -
Gen3 oder Pro (halt mit 8MB Flash).
Wobei Du den BLU auch mit anderen BLU GWs/Shellys verbinden kannst, ohne Gen3/Pro, aber dann halt auch ohne Skript-Anbindung.
Was auch gehen würde wäre ein Shelly Plug S Gen3
oder andere
Patrick -
-
Kein Gen3, yep.
Dieser muss dann in der BLU Reichweite der BLU H&Ts sein.
Ich hab gerade das gleiche Problem und muß mich da erst einmal einarbeiten/einlesen.
Daher kann es noch etwas dauern.