REST Switch

Hello,
i have a new issue.

My RestSwitch hast the following options
ttp://xx:xx@host:port/api/device/Steckdose/toggle
ttp://xx:xx@host:port/api/device/Steckdose/turnOn
ttp://xx:xx@host:port/api/device/Steckdose/turnOff

When the config looks like This:

switch:
  platform: rest
  resource: http://xx:xx@host:port/api/device/SteckdoseB2/toggle
  name: "Switch LEDLeiste"
#  body_on: "turnOn"
#  body_off: "turnOff"

he turns the light/plug every 30 seconds on and off, and on and off… :slight_smile:

When im using:

switch:
  platform: rest
  resource: http://xx:xx@host:port/api/device/SteckdoseB2/
  body_on: "turnOn"
  body_off: "turnOff"

then nothing happens.

my thinking was that hass completes the url with the body_off/body_on states to get working.
But it’ s not working…

Help…

edit: the h @ ttp is missing because of just two link per new user

mfg
Chris

The REST switch uses POST to send the payload to the device. It seems that your device only works with GET requests. Take a look at the MyStrom switch (this one is working with GET to set the state) and create a custom component, I suggest.