Shelly Webhook aktivate esphome switch

Hi, I would like tknow how to use Shelly Webhook (url) to activare esphome switch?
From esphome it is working like this
’ - http_request.post: http://192.168.xxx.xxx/relay/0?turn=on
But how to do it the other way around. From shelly to esphome?
Thx in advance
Helmut

Enable the web server and you get the rest api too. Web Server Component — ESPHome

Dear nickrout,
thx so far I followd your sugestion.
I enabled Webserver and now I can read and handle all GPIO in the browser - great!!!
I tried to use “192.168.xxx.xxx/switch/trafo/turn_on” But just reveiced
"{“id”:“switch-trafo”,“value”:false,“state”:“OFF”}
GPIO not switched ON
Any idea?

Try turning logging up per Web Server API — ESPHome

I do note that the esp requires a GET request. I am not sure whether shelly does a GET or a PUT.

Hi @graffiti1de

Did you get this to work?

It won’t work from the browser as it can only perform a GET command and not a POST. See here:

I also tested mine with http (httpie in linux) and it worked ok:

ding_dong@plex:~$ http POST http://10.0.0.68/switch/relay3_direct/turn_on
HTTP/1.1 200 OK
Accept-Ranges: none
Access-Control-Allow-Origin: *
Connection: close
Content-Length: 0