Plug S

How to control Shelly plug S via RCP

Firmware Update

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Shelly.GetDeviceInfo"
{"name":"Shelly1","id":"shellyplusplugs-ShellyMAC","mac":"ShellyMAC","slot":1,"model":"SNPL-00112EU","gen":2,"fw_id":"20231031-152250/1.0.7-g5db02bd","ver":"1.0.7","app":"PlusPlugS","auth_en":true,"auth_domain":"shellyplusplugs-ShellyMAC"}

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Shelly.CheckForUpdate"
{"stable":{"version":"1.3.3","build_id":"20240625-122851/1.3.3-gbdfd9b3"}}

As you can see above, the installed version is: 1.0.7
It offers newer version 1.3.3

Lets install that

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Shelly.Update?stage=stable"
null

That will return null, which is ok.
Wait some minutes and check the version

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Shelly.GetDeviceInfo"
{"name":"Shelly1","id":"shellyplusplugs-ShellyMAC","mac":"ShellyMAC","slot":0,"model":"SNPL-00112EU","gen":2,"fw_id":"20240625-122851/1.3.3-gbdfd9b3","ver":"1.3.3","app":"PlusPlugS","auth_en":true,"auth_domain":"shellyplusplugs-ShellyMAC"}

Commands

Get Status

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.GetStatus?id=0"
{"id":0, "source":"HTTP_in", "output":false, "apower":0.0, "voltage":0.0, "current":0.000, "aenergy":{"total":196551.609,"by_minute":[0.000,0.000,0.000],"minute_ts":1775806999},"temperature":{"tC":37.1, "tF":98.8}}

Reset Counters

Reset aenergy.total and aenergy.by_minute values to zero.

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.ResetCounters?id=0"
{"aenergy":{"total":196551.609}}

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.GetStatus?id=0"
{"id":0, "source":"HTTP_in", "output":false, "apower":0.0, "voltage":0.0, "current":0.000, "aenergy":{"total":0.000,"by_minute":[0.000,0.000,0.000],"minute_ts":1775806999},"temperature":{"tC":37.1, "tF":98.8}}

Turn on/off

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.Set?id=0&on=true"

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.Set?id=0&on=false"

Set Timer

Turn on power and toggle status after 3600 seconds (1h) to off

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.Set?id=0&on=true&toggle_after=3600"

Turn off power and toggle status after 3600 seconds (1h) to on
(this will not turn off again automatically)

$ curl -k --digest -u admin:password "http://<ShellyIP>/rpc/Switch.Set?id=0&on=false&toggle_after=3600"

Leave a Reply