Can I replace new similar Shelly than old one and keep old scenes what I had done before? I think that I lose scenes what include this Shelly, but have I any change avoid this?
Beiträge von markok
-
-
Contains Shelly RGBW2 relay or solid state contacts to outputs?
-
Thank you for your help, but still I have something what I can't understand. I tried it code like below, but seems that it can't get apower status.
-
Problem solved. The main problem was Content-Type. This topic was helpful Script HTTP.POST to Shelly Cloud fails
-
Is it possible read other Shelly's status? If it is possible is there differece depending gen1 or gen2 products? I have code like below which work local devices, but I don't know how I can include other Shelly's IP address to this code.
-
I have Alliance-Apps OpenDTU and it support cURL command. I hope that I can control this product using Shelly script. How I can send cURL command usingShelly script?
Command what I want use is:
Codecurl --user "user:pwd" http://192.168.x.x/api/limit/config --request POST --data "data={'serial':'1144xxxxxxxx', 'limit_type':1, 'limit_value':50}"
I tried use code like below with my own setups, but it not work and I don't know what I must to do, Can somebody help me how to do that?
Code
Alles anzeigenfunction ParseResponse(res, error_code, error_msg, ud) { if (error_code != 0) { print("Request error: ", error_code, error_msg); } else { if (res.code === 200) { let response = JSON.parse(res.body); print(response); } else { print('Request failed: ', res.code); } } } let username = 'xxxx' let password = 'xxxxxx' let urlToCall = 'http://' + username + ':' + password + '@192.168.x.xxx/api/limit/config' let payload = 'data={"serial":"1144xxxxxxxx", "limit_type":1, "limit_value":100}' Shelly.call("HTTP.POST", { url: urlToCall, body: payload, timeout: 15, ssl_ca: "*" }, ParseResponse);
-
Please turn off ECO mode!
This was a good hint, thank you. I turned Eco mode off and now voltage measuring works well.
-
Thank you for the quick reply. I try tomorrow turn eco mode off. Now it is turned on. Would Shelly UNI be better product to measuring voltage? I think that Shelly UNI has this ADC chip, but I am not sure?
-
I tried use Shelly Add-On voltmeter option, but it doesn't work correctly. I tried measure 4 VDC supply and wires was connected to Add-On analog input and GND connections. Shelly app shows voltage changing between 3,1 - 4.6V althought supply voltage doesn't change. What could be wrong? I have connected to same Add-On five ds18b20 temperature sensors.
-
Thank you very much for your help De kat. My code seems to work correct now.
-
Thank you again. I test this way next.
-
My English is not very good, but I try explain what is the project goal. I have air heat pump, which defrosting logic is very poor. It make several defrosting without any reason. I try make better logic with two temperature sensor. One sensor measure outside temperature and other one heat exchanger temperature. When difference between these sensors are two Celsius degree, defrosting start. This part work now pretty good, but I have still couple of problems.
When defrosting start, I want that code running stop 15-20 minutes. If it not stop, relay status can change when defrosting is running and I don't want it.
Other problem is defrosting fail safe mode. I want that defrosting happens once in six hours althought temperature sensors not get correct value.
Hopefully you understand what I mean. I have tried many way resolve this problem, but I can't done it yet.
-
Thank you very much about this advise. I can now read all data what I need, but I have still one problem. I have to pause code execution if one "else" is true. I tried put there a new timer, but I got message that I use too many timers. How I can do that at correct way? My code is below and there is text PAUSE where I want the pause. I want that relay not turn ON before than set time has gone out.
Code
Alles anzeigen//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 : 2, temp_min : 10, id_ulko : 100, id_kenno: 101, relay : 0, interval : 60 // 2 seconds is the minimum interval } //############################## Config end ############################ function watch() { try { temp_ulko = Shelly.getComponentStatus('Temperature', Config.id_ulko).tC; temp_kenno = Shelly.getComponentStatus('Temperature', Config.id_kenno).tC; print('Temp. ulko =',temp_ulko); print('Temp. kenno =',temp_kenno); //temp_ulko >= minimum if (temp_ulko >= 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. ulko >= ', Config.temp_min); } else { delta = temp_ulko - temp_kenno; print('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=off'}); print('Relay(', Config.relay, ') off. Delta >= ', Config.temp_diff); } //delta less than Config.temp_diff else { //PAUSE 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); } } 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);
-
i am tried use Google, but I can't find solution how I can read Shelly Add-on temperature sensors data to Shelly script. I have to read two sensors data and change switch if differences of these sensors is bigger than set value. Can someone help me how I can do this?