This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Shelly http command
#6
Anyone already tried to implement the Shelly 4PM measurment functionality? The HTTP API is very easy accessable, bit how do I get the current, apower, aenergy for each channel?
(switching the channels is no big deal)

After commanding...
require('socket.http')
socket.http.TIMEOUT = 5
data = socket.http.request('http://xxxx.xxx.xxx.xxx/rpc/Shelly.GetStatus')

if data then
log(data)

... the result is:
string: {"ble":{},"cloud":{"connected":false},"eth":{"ip":"xxx.xxx.xxx.xxx"},"input:0":{"id":0,"state":false},"input:1":{"id":1,"state":false},"input:2":{"id":2,"state":false},"input:3":{"id":3,"state":false},"mqtt":{"connected":true},"switch:0":{"id":0, "source":"init", "output":false, "apower":0.0, "voltage":225.2, "freq":50.0, "current":0.000, "pf":0.00, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490}, "ret_aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490},"temperature":{"tC":20.8, "tF":69.5}},"switch:1":{"id":1, "source":"init", "output":false, "apower":0.0, "voltage":225.2, "freq":50.0, "current":0.000, "pf":0.00, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490}, "ret_aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490},"temperature":{"tC":20.8, "tF":69.5}},"switch:2":{"id":2, "source":"init", "output":false, "apower":0.0, "voltage":225.4, "freq":50.0, "current":0.000, "pf":0.00, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490}, "ret_aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490},"temperature":{"tC":20.8, "tF":69.5}},"switch:3":{"id":3, "source":"init", "output":false, "apower":0.0, "voltage":225.4, "freq":50.0, "current":0.000, "pf":0.00, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490}, "ret_aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1701113490},"temperature":{"tC":20.8, "tF":69.5}},"sys":{"mac":"xxxxxxxx","restart_required":false,"time":"20:31","unixtime":1701113491,"uptime":11903,"ram_size":241544,"ram_free":127636,"fs_size":524288,"fs_free":196608,"cfg_rev":16,"kvs_rev":0,"schedule_rev":0,"webhook_rev":0,"available_updates":{"stable":{"version":"1.0.8"}}},"ui":{},"wifi":{"sta_ip":null,"status":"disconnected","ssid":null,"rssi":0},"ws":{"connected":false}}
Reply


Messages In This Thread
Shelly http command - by victor.back - 03.12.2022, 17:54
RE: Shelly http command - by admin - 05.12.2022, 12:53
RE: Shelly http command - by victor.back - 05.12.2022, 16:00
RE: Shelly http command - by admin - 05.12.2022, 16:02
RE: Shelly http command - by victor.back - 05.12.2022, 16:11
RE: Shelly http command - by ivob - 27.11.2023, 19:36
RE: Shelly http command - by admin - 28.11.2023, 07:04
RE: Shelly http command - by ivob - 28.11.2023, 07:50
RE: Shelly http command - by Daniel - 28.11.2023, 08:10
RE: Shelly http command - by ivob - 28.11.2023, 10:16
RE: Shelly http command - by ivob - 30.11.2023, 09:41
RE: Shelly http command - by admin - 30.11.2023, 09:42

Forum Jump: