Hi Leute,
ich habe hier in der Suche das Script von Ostfriese gefunden, das ich für meine Pumpensteuerung angepasst habe.
Ich habe einen wasserführenden Kamin der einen Pufferspeicher speist. Die Steuerung soll folgendes machen.
- Wenn die Temperatur im Kamin 65 Grad erreicht dann schalte die Pumpe an. -> Schalte Shelly Plus 1PM ein
- Wenn die Temperatur über 65 Grad ist, dann prüfe den Temperaturunterschied zum Pufferspeicher, ist dieser größer, gleich 4 Grad, dann schalte Pumpe an
- <= 4 Grad, schalte Pumpe aus.
Hier das angepasste Script von Ostfriese
//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 = {
temp_diff : 4,
temp_min : 65,
id_kamin : 100,
id_speicher: 101,
relay : 0,
interval : 10 // 2 seconds is the minimum interval
}
//############################## Config end ############################
function watch() {
try {
temp_kamin= Shelly.getComponentStatus('Temperature', Config.id_kamin).tC;
temp_speicher= Shelly.getComponentStatus('Temperature', Config.id_speicher).tC;
print('Temp. Kamin =',temp_kamin);
print('Temp. Speicher =',temp_speicher);
//kamin <= minimum
if (temp_kamin<= Config.temp_min) {
Shelly.call("http.get", {url:'http://127.0.0.1/relay/' + JSON.stringify(Config.relay) + '?turn=off'});
print('Relay(', Config.relay, ') off. Kamin temp <= ', Config.temp_min);
}
else {
delta = temp_kamin - temp_speicher;
print('Temp. Delta=',delta);
//delta more than or equal Config.temp_diff
if (delta >= Config.temp_diff) {
Shelly.call("http.get", {url:'http://127.0.0.1/relay/' + JSON.stringify(Config.relay) + '?turn=on'});
print('Relay(', Config.relay, ') on. Delta >= ', Config.temp_diff);
}
//delta less than Config.temp_diff
else {
Shelly.call("http.get", {url:'http://127.0.0.1/relay/' + JSON.stringify(Config.relay) + '?turn=off'});
print('Relay(', Config.relay, ') off. Delta < ', Config.temp_diff);
}
}
print('\n')
} catch (err) {
Shelly.call("http.get", {url:'http://127.0.0.1/relay/' + JSON.stringify(Config.relay) + '?turn=off'});
print(err);
}
}
function start() {
// do a first shot
watch();
// set watch timer to configured value
Timer.set(Config.interval * 1000,true,watch);
}
// schedule script start for 1 second
Timer.set(1000,false,start);
Alles anzeigen
Aber irgendwie funktioniert das nicht immer. Gestern lief es erst, aber heute morgen nicht.
Derzeit hat mein Kamin 70 Grad, Delta ist >= 4 Grad, aber der Shelly Plug wird nicht eingeschaltet. Die Bedingungen scheinen zu passen, er biegt richtig ab, was ja die Logausgaben belegen. Relay( 0 ) on. Delta >= 4. Aber das Einschalten hackt.
Temp. Kamin = 70.5
10:55:40
Temp. Speicher = 38.9
10:55:40
Temp. Delta= 31.6
10:55:40
Relay( 0 ) on. Delta >= 4
Hier noch ein paar mehr Logausgaben:
shos_rpc_inst.c:230 http.get via loopback
11:14:37
shelly_http_client.:306 0x3ffe45d0: HTTP GET http://127.0.0.1/relay/0?turn=on
11:14:37
shelly_notification:163 Status change of temperature:101: {"id":101,"tC":43.06,"tF":109.51}
11:14:38
shelly_notification:163 Status change of temperature:100: {"id":100,"tC":71.00,"tF":159.80}
11:14:43
shelly_http_client.:606 0x3ffe5fc4: Finished; bytes 0, code 0, redir 0/3, auth 0, status DEADLINE_EXCEEDED: Timed out
11:14:43
Temp. Kamin = 71
11:14:47
Temp. Speicher = 43.1
11:14:47
Temp. Delta= 27.9
11:14:47
shelly_ejs_rpc.cpp:41 Shelly.call http.get {"url":"http://127.0.0.1/relay/0?turn=on"}
11:14:47
Relay( 0 ) on. Delta >= 4
11:14:47
11:14:47
shos_rpc_inst.c:230 http.get via loopback
11:14:47
shelly_http_client.:306 0x3ffe5fc4: HTTP GET http://127.0.0.1/relay/0?turn=on
11:14:47
shelly_notification:163 Status change of temperature:101: {"id":101,"tC":43.19,"tF":109.74}
11:14:48
shelly_notification:163 Status change of temperature:100: {"id":100,"tC":71.12,"tF":160.03}
11:14:53
shelly_http_client.:606 0x3ffe45d0: Finished; bytes 0, code 0, redir 0/3, auth 0, status DEADLINE_EXCEEDED: Timed out
11:14:53
Temp. Kamin = 71.1
11:14:57
Temp. Speicher = 43.1
11:14:57
Temp. Delta= 28
11:14:57
shelly_ejs_rpc.cpp:41 Shelly.call http.get {"url":"http://127.0.0.1/relay/0?turn=on"}
11:14:57
Relay( 0 ) on. Delta >= 4
11:14:57
11:14:57
shos_rpc_inst.c:230 http.get via loopback
11:14:57
shelly_http_client.:306 0x3ffe45d0: HTTP GET http://127.0.0.1/relay/0?turn=on
11:14:57
shelly_notification:163 Status change of temperature:101: {"id":101,"tC":43.06,"tF":109.51}
11:14:58
shelly_notification:163 Status change of switch:0: {"id":0,"aenergy":{"by_minute":[0.000,0.000,0.000],"minute_ts":1709892900,"total":6657.430}}
11:15:00
shelly_notification:163 Status change of temperature:100: {"id":100,"tC":71.25,"tF":160.25}
11:15:03
shelly_http_client.:606 0x3ffe5fc4: Finished; bytes 0, code 0, redir 0/3, auth 0, status DEADLINE_EXCEEDED: Timed out
11:15:03
Temp. Kamin = 71.2
11:15:07
Temp. Speicher = 43.1
11:15:07
Temp. Delta= 28.1
11:15:07
shelly_ejs_rpc.cpp:41 Shelly.call http.get {"url":"http://127.0.0.1/relay/0?turn=on"}
11:15:07
Relay( 0 ) on. Delta >= 4
11:15:07
11:15:07
shos_rpc_inst.c:230 http.get via loopback
11:15:07
shelly_http_client.:306 0x3ffe5fc4: HTTP GET http://127.0.0.1/relay/0?turn=on
11:15:07
shelly_notification:163 Status change of temperature:100: {"id":100,"tC":71.38,"tF":160.47}
11:15:13
shelly_http_client.:606 0x3ffe45d0: Finished; bytes 0, code 0, redir 0/3, auth 0, status DEADLINE_EXCEEDED: Timed out
11:15:13
Temp. Kamin = 71.4
11:15:17
Temp. Speicher = 43.1
11:15:17
Temp. Delta= 28.3
11:15:17
shelly_ejs_rpc.cpp:41 Shelly.call http.get {"url":"http://127.0.0.1/relay/0?turn=on"}
11:15:17
Relay( 0 ) on. Delta >= 4
Idee woran das liegen könnte ?
Danke u. Gruß
Spike