ESP8266 Http request

Hi I have an ESP8266 that is controlling a led-strip. I control it by Http request, like (http://192.168.0.114/on and http://192.168.0.114/off). my question is how do i make this into a simple button in ha.

I tried using Command line Switch whitout sucsess. (or I just dont understand)…

so if anyone have any ideas please help:)

The command line switch is probably easiest, although you might also be able to use the restful switch if you specify get as the method.

If you are running on a pi, the command line switch would be something like

switch:
  platform: command_line
  switches:
    kitchen_light:
      command_on: curl http://192.168.0.114/on
      command_off: curl  http://192.168.0.114/off

On other platforms, you may need some other command.

Thanks for the help now it works. Dont know what I did wrong.

1 Like