How to trigger an action via an HTTP url?

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 http://192.168.50.50:1880/endpoint/FamilySwitch” 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?

Hello! I stumbled on your question. All though you found another workaround, I’d would like to post my proposed solution for controlling a Shelly device from command line with CURL, which is confirmed working here. To turn the relay 0 on on a device, use this command:

🐟 ~$ curl -s -X POST "<device name or ip>/relay/0?turn=on" -d ""

To turn the same relay off, you can use this curl command:

🐟 ~$ curl -s -X POST "<device name or ip>/relay/0?turn=off" -d ""

I have the same problem, and I can’t find any solution. You have been able to solve it.
Thanks

I have this issue as well and it seems a pretty silly limitation of both HA and Shelly TBH.

The issue with MQTT (my first attempt at solving this) is that the i3 does not publish many messages. It has a channel on / off and input_event. input_event seems pretty temperamental though. Sometimes event is S or L (for long or short press) but sometimes it’s blank and a long press is missed.

There are action urls for short and long press (and several others) but HA doesn’t work with these. I am now considering a solution where I’ll use a long press to trigger node red which will then trigger HA which just seems a bit silly - and I am bound to forget how it works when I come to alter it in months or years time.

Hi there, any update on this topic?
I have the same problem. I would like to control an old HomeWizard using HomeAssistant. But there is no addon available and the product is discontinued… So I realized it via http requests (in openHAB). For several reasons I want to switch to HomeAssistant, but I could not find a solution for this http request so far.
What I want to do: including as an action/service in a rule the http request (e.g. “http://192.168.178.xx/password/sw/1/settarget/20” to set the radiator temperature).
Can anyone help?
Thank you!