Super, halt uns auf dem Laufenden!
Beiträge von svenbuer
-
-
Hallo Zusammen,
die Erkennung und Auslösen funktioniert tadellos.
In Kombination mit einer Anwesenheitskontrolle wird die Lüftungsposition unserer Garage angefahren wenn eines unserer Smartphones zu Hause ist und die Werte über bzw. unterschritten werden.
Anwesenheitskontolle mit Gen2 Shelly (fertige Lösung) - Seite 2 - Vorlagen - Shelly Forum
Jetzt wäre noch offen, ob wir es hinbekommen, das Script umzuschreiben auf absolute Luftfeuchtigkeit.
-
Hallo Zusammen
ich kann Erfolg melden.
Die Anwesenheitserfasung funktioniert tadellos.
ich konnte auch schon damit Abläufe steuern, welche bei Anwesenheit einee Geräts laufen sollen, wie z.B. die Lüftungsposition unserer Garage.
Garage auf Lüftungsposition fahren - Seite 2 - User Scripte - Shelly Forum
-
Sieht gut aus.
Ich hab jetzt einen Shelly Plus Uni als Empfänger drin und es wird auf den ersten Blick zuverlässig geschaltet mit zwei Smartphones.
Ich werde mal eine Woche beobachten und dann nochmal Rückmeldung geben
-
Okay, dann au ich das morgen mal um, auf einen anderen Shelly.
-
Nein, das ist ein anderer Shelly.
-
Das ist ein Shelly 1 Gen 3
20241011-114449/1.4.4-g6d2a586
-
Keine Ahnung. Ich hab nur die IPs angepasst.
-
//GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
//More information: https://www.gnu.org/licenses/gpl-3.0.txt
//ABSOLUTELY NO WARRANTY!!!
//Made by Ostfriese
//############################## Config ############################
let Config = {
ips: ["192.168.0.50"],
names: ["Sven"],
first_user_in_action : "http://192.168.0.32/relay/0?turn=on",
last_user_out_action : "http://192.168.0.32/relay/0?turn=off",
user_action_online : ["",
"",
"",
"",
""],
user_action_offline : ["",
"",
"",
"",
""],
timeout : 1,
verbose : false,
buffer : 30
}
//############################## Config end ############################
let busy = false;
let users_online_array = [];
let offline_buffer_array = [];
let empty_house = true;
let i = 0;
function log(to_log) {
if(Config.verbose) {
print(to_log);
}
}
function count_absent() {
// count absent users
false_count = 0;
for(let k = 0; k < Config.ips.length; k++) {
if(users_online_array[k] === false) {
false_count += 1;
}
}
// if all users are absent
if(false_count === Config.ips.length) {
log("Config.last_user_out_action :", Config.last_user_out_action);
// call last_user_out_action
Shelly.call("http.get", {url: Config.last_user_out_action, timeout: Config.timeout});
// set house to empty
empty_house = true;
return;
}
// if house was empty
if (empty_house) {
log("Config.first_user_in_action :", Config.first_user_in_action);
// call first_user_in_action
Shelly.call("http.get", {url: Config.first_user_in_action, timeout: Config.timeout});
// set house to 'someone in'
empty_house = false;
}
}
// find next index
function iterate_index() {
if(i < Config.ips.length - 1) {
i += 1;
return;
}
i = 0;
}
function ping() {
try {
// return if already busy
if (busy === true) {
return;
}
busy = true;
ip = Config.ips[i];
// do a ping
Shelly.call("http.get", {url: ip, timeout: Config.timeout},
function(result, error_code, error_message) {
if(error_message === "-1: Connection error: -14") {;
// check if status changed from absent to present
if(users_online_array[i] === false
users_online_array[i] === '') {
print(Config.names[i], "online");
log("Config.user_action_online[" + i + "] :", Config.user_action_online[i]);
// call specific user action for present
Shelly.call("http.get", {url: Config.user_action_online[i], timeout: Config.timeout});
// set user to present in users_online_array
users_online_array[i] = true;
// check how much users present
count_absent();
}
users_online_array[i] = true;
offline_buffer_array[i] = Shelly.getComponentStatus("sys").unixtime;
// get index of next user
iterate_index();
busy = false;
return;
}
// check if user offline for longer than buffer seconds
t = Shelly.getComponentStatus("sys").unixtime - offline_buffer_array[i];
if((users_online_array[i] === true && t > 60)
users_online_array[i] === '') {
print(Config.names[i], "offline");
log("Config.user_action_offline[" + i + "] :", Config.user_action_offline[i]);
// call specific user action for absent
Shelly.call("http.get", {url: Config.user_action_offline[i], timeout: Config.timeout});
// set user to absent in users_online_array
users_online_array[i] = false;
// check how much users absent
count_absent();
}
// get index of next user
iterate_index();
busy = false;
return;
})
// catch errors
} catch(err) {
busy = false;
}
}
// set ping timer
function start() {
Timer.set(10,true,ping);
}
// set all users to absent
for(let j = 0; j < Config.ips.length; j++) {
users_online_array.push('');
offline_buffer_array.push(Shelly.getComponentStatus("sys").unixtime);
//print(Config.names[j], "offline");
}
// wait 1 second before start to avoid error after reboot
Timer.set(1000,false,start);
-
Wo, ich find es nicht.
-
Hallo zusammen, ich hab das Script eingebaut. Scheint aber einen Fehler zu haben Es wird ein aber nicht ausgeschaltet.
shelly_ejs_rpc.cpp:41 Shelly.call http.get {"url":"192.168.0.50","timeout":1}
20:54:35
shos_rpc_inst.c:243 http.get via loopback
20:54:35
shelly_http_client.:303 0x3fccd300: HTTPS GET 192.168.0.50 (CA ca.pem)
20:54:35
shelly_http_client.:611 0x3fccd300: Finished; bytes 0, code 0, redir 0/3, auth 0, status -1: Connection error: -14
20:54:35
shelly_ejs_rpc.cpp:41 Shelly.call http.get
-
Servus,
ja, hat ne feste IP.
Ich hatte aber leider einen IP-Adressenkonflikt.
Jetzt funktioniert alles wieder.
Werd mal ein paar Tage beobachten und dann noch mal Info geben.
-
Komisch seit heute morgen, kein eFunkion.
Das Script bring auch eine Fehler, mit Verbindung, obwohl der BLU Werte liefert.
Status: started Script _[ Feuchtemessung Garage mit BLU H&T ]_19:25:30
Debug: calling: http.get {19:26:31
"url": "http://192.168.0.33/rpc/BTHomeSens…201%22,19:26:31
"timeout": 5 }19:26:31
Error: Check_Loop() ---> Error Cannot read property 'code' of undefined19:26:37
Error: ErrorChk(), call Answer ---> Error -104: Timed out19:26:37
Info: maybe --> wrong URL or device may be offline19:26:37
Debug: calling: http.get {19:27:31
"url": "http://192.168.0.33/rpc/BTHomeSens…201%22,19:27:31
"timeout": 5 }19:27:31
Error: Check_Loop() ---> Error Cannot read property 'code' of undefined19:27:37
Error: ErrorChk(), call Answer ---> Error -104: Timed out19:27:37
Info: maybe --> wrong URL or device may be offline
-
Ich hab keine Ahnung was ich gemacht habe, aber jetzt geht es.
Console: Status:
started Script _[ Feuchtemessung Garage mit BLU H&T ]_18:44:37
Debug: calling: http.get {18:45:37
"url": "http://192.168.0.33/rpc/BTHomeSens…201%22,18:45:37
"timeout": 5 }18:45:37
Debug: Hum delta--> -26.5 ext_h--> 64 int_h--> 90.518:45:37
Debug: calling: Switch.set { "id": 0, "on": true }18:45:37
Debug: calling: http.get {18:46:37
"url": "http://192.168.0.33/rpc/BTHomeSens…201%22,18:46:37
"timeout": 5 }18:46:37
Debug: Hum delta--> -26.5 ext_h--> 64 int_h--> 90.518:46:37
Debug: calling: Switch.set { "id": 0, "on": true }18:46:37
Debug: calling: http.get {18:47:37
"url": "http://192.168.0.33/rpc/BTHomeSens…201%22,18:47:37
"timeout": 5 }18:47:37
Debug: Hum delta--> -26.6 ext_h--> 64 int_h--> 90.618:47:37
Debug: calling: Switch.set { "id": 0, "on": true }18:47:37
›_
URL-Aufruf{
"objects": [
{
"obj_id": 2,
"obj_name": "temperature",
"type": "sensor",
"unit": "° C"
},
{
"obj_id": 3,
"obj_name": "humidity",
"type": "sensor",
"unit": "%"
},
{
"obj_id": 4,
"obj_name": "pressure",
"type": "sensor",
"unit": "hPa"
}
],
"offset": 0,
"count": 3,
"total": 3
} -
Ich hab das Script eingebaut, nur leider funktioniert es nicht.
Ich hab das Delta so angepasst, das er schalten sollte.
-
Dann sollte es wohl so heissen.
-
Ich hab das Video, komplett angesehen und keinen Hinweis auf die Komponenten-ID gefunden.
-
Ja, ist eingebunden am Gen 3.
Die GeräteID lautet XB137192901110642.
-
Der Shelly 1 Gen 3 ist nun in der Garage installiert und der BLU H&T eingebunden, soweit das Skript vorbereitet.
Wie wollen wir weiter machen?
-
Ich denke auch, zuerst mal die Kombination mit dem BLU H&T zum laufen bekommen und dann die neue Berechnung.
Fände es cool, wenn wir das zusammen hinbekommen würden.
Es macht auf mich den Eindruck, als ob das Thema wirklich gebraucht wird in der Gemeinde.
Leider kann ich was das Programmieren angeht, nur wenig beitragen.
Bin aber gerne der Tester!!!