How to trigger an action via an HTTP url?

I just got a Shelly i3 and would like to trigger an action in Home Assistant via http when a button is pressed

It can have the Shelly turn on and off lights via http by using for example

How do I use a similar http url to switch a group of entities or an automation in Home Assistant?

Use a webhook trigger and an automation.

1 Like

I get

405: Method Not Allowed

You need to use POST, try the same webhook from a curl first

I can only type something in a browser address bar
What should I type?

That’s not possible, that’s not using post

1 Like

Any alternative?
This is what the Shelly interface looks like
I hoped I could keep it simple by using an http url that can trigger an automation in HA

Does MQTT work with the i3 ?

It does, but activating it breaks the connection of the device to Shelly cloud. The Shelly for HASS integration works around this by using CoAP instead, but does not support i3 (yet).

I don’t care about losing the cloud connection; all my shellies use mqtt, but they are all switches, so they can be controlled using mqtt

The Shelly i3 doesn’t have any relay to control, it’s just an input device, so I’m not sure if it can control something else via mqtt

Of course it can, but there seems to be a bug in the i-3 MQTT, there’s a thread in the shelly support group on facebook.

I’m the opener of that thread I think

I also have another similar device not working with POST, I also had a small .php server, so created a workaround… My php is my webhook url, and in the php I call my HA automation with a POST

@jacoscar did you ever work this out? I’m trying to get my Shelly to turn on a smart light via home assistant’s api and/or the lights own API, but the fact that the shelly only accepts a URL is holding me back.

I have sold my Shelly i3 as I couldn’t find a solution, but in hindsight I could have just used an mqtt triggered automation, assuming the shelly publishes an mqtt message at each button pressed

ah i see. Yeah I’m looking for something different then I guess. I’m wanting to toggle the light directly from the shelly via an http command, so in the event of HA going down, my lights and switches will still function.

I have been going down this rabbit hole with the webhook without any luck. Anyone figured this out or another way to call a url from a Shelly device and have it trigger something on HA? I haven’t tried looking in Node-Red yet but I think it also has an HTTP end-point that could possibly be something to look at.

I have created something that would work, but it is ridiculous overcomplex; it involves running your own DNS server an monitoring it’s logs for certain DNS request. You could then use any website you normally never visit to trigger the action. Details explained here: Getting Ezviz DB1 (or Hikision or LaCie) doorbell presses

We can simply use an mqtt trigger fornthe HA automation

I have Node Red running on HA. Using the HTTP IN node with the method set to GET. From the terminal I can run “curl -X GET” and my flow successfully toggles my light. I can also hit the URL via internet explorer and the flow is successful. My Shelly 1 is set to the same I/O URL actions BUTTON SWITCHED ON URL is set to the URL that I already tested with. How ever the Shelly doesnt active the flow in Node Red when turned on. Anyone have an ideas?