It’s pretty easy to send out a rest_command
from HA.
I want to send a specific rest_command
to a Shelly device.
For example the following works fine:
rest_command:
shelly_toggle_basic:
# 192.168.1.33 is just an example, enter your shelly IP address
url: "http://192.168.1.33/relay/0?turn=toggle"
shelly_toggle_with_more_options:
# you can use the payload option and keep only the topic as basic REST URL:
url: "http://192.168.1.33/relay/0"
# shelly always expects a POST command, but GET works fine too:
method: POST
# if you enabled restricted access on the device specify the user and password:
username: !secret restricted_user
password: !secret restricted_password
# break the command into pieces with the payload option:
payload: "turn=toggle"
# content type according to Shelly documentation:
content_type: "application/x-www-form-urlencoded"
But it’s much better use the shelly integration to with a device on and off.
The rest_command
is very useful for more advanced settings.
Now I want to enable/disable URL actions for a shelly, I can do that with a rest_command
as well.
These examples are taken from their API documentation:
# setting two URLs for out_on_url action on channel 0:
http://192.168.33.1/settings/actions?index=0&name=out_on_url&enabled=true&urls[]=http://192.168.1.4/on&urls[]=http://192.168.1.5/on
# disable only action out_on_url on channel 0:
http://192.168.33.1/settings/actions?index=0&name=out_on_url&enabled=false
# delete URLs for action out_on_url action on channel 0:
http://192.168.33.1/settings/actions?index=0&name=out_on_url&urls[]=
# IP is default 192.168.33.1 in this example - AP mode for Shelly
I spent a full day and have tried every combination of parameters I could come up with but they won’t function in a HA rest_command
. Is there anyone who can help me out here???