I’m trying to setup an automation to change the LED color of my Shelly plug S+. I have it working when i enter the REST command below in a browser, but i get stuck at how i have to format the RESTfull command in homeassistant correctly.
If i enter the following into my browser it works: (led turns blue, when shelly is on or off - you can also set different colors for on/off if you want).
http://<ip of shelly>/rpc/PLUGS_UI.SetConfig?config={"leds":{"mode":"switch","colors":{"switch:0":{"on":{"rgb":[0,0,100],"brightness":100},"off":{"rgb":[0,0,100],"brightness":100}},"power":{"brightness":100}}}}
However as this command uses “”, i can not just put in my configuration.yaml on the URL line as that also needs to be between “”, so it gets “cut off”
I assume i have to split it up in a URL part and a payload (or other type ? ) part, but this is where i get lost. I tried to split it up as follows (but this does not work):
shelly_pink_collor_blue:
url: "http://<IP of shelly>/rpc/PLUGS_UI.SetConfig?config="
payload: '{"leds":{"mode":"switch","colors":{"switch:0":{"on":{"rgb":[0,0,100],"brightness":100},"off":{"rgb":[0,0,100],"brightness":100}},"power":{"brightness":100}}}}'
# and also this:
shelly_pink_collor_blue:
url: "http://<IP of shelly>/rpc/PLUGS_UI.SetConfig?"
payload: 'config={"leds":{"mode":"switch","colors":{"switch:0":{"on":{"rgb":[0,0,100],"brightness":100},"off":{"rgb":[0,0,100],"brightness":100}},"power":{"brightness":100}}}}'
To be clear, i do have the shelly_pink_collor_blue as a service, but when i run it with the developertools, nothing changes on the Shelly.
ps if anyone else wants to play with this, be aware that the given numbers for the RGB color are in % (not the actual RGB values for some reason…). so for example 0,0,100 sets your shelly led to 0,0,255 (= blue). If you try to set values above 100, nothing happens. (and you do not get an error message)
my testing is done on the latest stable firmare (version 1.1.0, and my plugs are hardware version v2.)
Details on this API in shelly documentation can be found here: