Webhook e Shelly device

Bruco1987

New member
C.Hi everyone. I have successfully set up a macro with webhook and If I type the string on a browser, it is correctly executed. I have some Shelly devices (specifically a Shelly button1) that allows you to send a url request when pressed Of the button. The problem is that if I put the trigger string on this button, macrodroid doesn't get the trigger. But the button I'm sure works, because another command sent to ifttt works fine. Do you have any ideas about it? I am attaching a configuration image where you can see that I also tried http as well as https IMG_20220122_180349__01.jpg
 

Bruco1987

New member
I would recommend you to try using original url (trigger.macrodroid.com) rather than tinyurl if you didn't already tryed.
hello yes I have already tried but the result does not change. I would like to understand if the request on the server arrives or not ... maybe the macrodroid developer could help me in this. I believe that an integration with shelly buttons can offer great opportunities
 

tanutanu

Well-known member
C.Hi everyone. I have successfully set up a macro with webhook and If I type the string on a browser, it is correctly executed. I have some Shelly devices (specifically a Shelly button1) that allows you to send a url request when pressed Of the button. The problem is that if I put the trigger string on this button, macrodroid doesn't get the trigger. But the button I'm sure works, because another command sent to ifttt works fine. Do you have any ideas about it? I am attaching a configuration image where you can see that I also tried http as well as https View attachment 2136
How do you send the parameters to trigger the MD macro on your device?
Shelly button seems to support restful api, so your button have possibility to send them as post method:unsure:
IFTTT webhook supports both post and get. I'm not sure the MD webhook server supports post as well or get only, because all the examples in the Jamie's blog post show it in get method.
 

Bruco1987

New member
Come si inviano i parametri per attivare la macro MD sul proprio dispositivo?
Il pulsante Shelly sembra supportare le API riposanti, quindi il tuo pulsante ha la possibilità di inviarle come metodo di pubblicazione:incerto:
Il webhook IFTTT supporta sia il post che il get. Non sono sicuro che il server webhook supporta anche il post o, perché tutti gli esempi nel post del blog di JamieMD lo dimostrano nel metodo get.
sorry i didn't understand the question I just enter the URL of the trigger that ifttt (and also tasker) gave me and I point it out from the button settings. and what he's doing works. it would be interesting to receive, instead of a could trigger, a message via http which, recognized by macrodroid, activates the macro. I do this for example with eventghost on PC and it works very well.
 

tanutanu

Well-known member
sorry i didn't understand the question I just enter the URL of the trigger that ifttt (and also tasker) gave me and I point it out from the button settings. and what he's doing works. it would be interesting to receive, instead of a could trigger, a message via http which, recognized by macrodroid, activates the macro. I do this for example with eventghost on PC and it works very well.
Which procedure is correct, 2-A to 2-C?
(1)You -- press the button --> Shelly button device
(2-A) Shelly device -- get param on url string --> MD webhook server
(2-B) Shelly device -- access with unique url string(or with JSON) --> IFTTT --> get param on url string --> MD webhook server
(2-C) Shelly device -- post param on JSON --> MD webhook server
(3) MD webhook server -- firebase web relative service? --> MD macro trigger

I talked it might be impossible if 2-C on the comment #4. Both 2-A(if possible) and 2-B are ok, but I don't see real url string(such as http://trigger.macrodroid.com/device_uuid/unique_macro_identifier?intparam=intval&strparam=strval) and your macro trigger setting, so I have no way to confirm where and how the issue is. You need to check the method and the log(s).
 
Last edited:

Bruco1987

New member
Which procedure is correct, 2-A to 2-C?
(1)You -- press the button --> Shelly button device
(2-A) Shelly device -- get param on url string --> MD webhook server
(2-B) Shelly device -- access with unique url string(or with JSON) --> IFTTT --> get param on url string --> MD webhook server
(2-C) Shelly device -- post param on JSON --> MD webhook server
(3) MD webhook server -- firebase web relative service? --> MD macro trigger

I talked it might be impossible if 2-C on the comment #4. Both 2-A(if possible) and 2-B are ok, but I don't see real url string(such as http://trigger.macrodroid.com/device_uuid/unique_macro_identifier?intparam=intval&strparam=strval) and your macro trigger setting, so I have no way to confirm where and how the issue is. You need to check the method and the log(s).
I think A mixture of 2-b and 2-c because when I press the button on the Shelly, all I do is open that url (if that url. instead I put it on a browser, the macro works and I read ok) just to understand, with macrodroid it doesn't work but with autoremote and tasker it does. As for the log, I have already checked but the trigger is not detected at all with the Shelly Instead with a browser yes.
 

tanutanu

Well-known member
I think A mixture of 2-b and 2-c because when I press the button on the Shelly, all I do is open that url (if that url. instead I put it on a browser, the macro works and I read ok) just to understand, with macrodroid it doesn't work but with autoremote and tasker it does. As for the log, I have already checked but the trigger is not detected at all with the Shelly Instead with a browser yes.
The url you post on #1 seems to be generated by the target MD macro trigger.
So, if you actually set it on your shelly button and access the MD webhook server directly or a IFTTT applet as the proxy, the MD trigger should be called:unsure: Please check the shelly or IFTTT log if you don't want to attach the setting and your macro screenshots.
 

Bruco1987

New member
I think A mixture of 2-b and 2-c because when I press the button on the Shelly, all I do is open that url (if that url. instead I put it on a browser, the macro works and I read ok) just to understand, with macrodroid it doesn't work but with autoremote and tasker it does. As for the log, I have already checked but the trigger is not detected at all with the Shelly Instead with a browser yes.

Try using this url:

Then check this site if you see your message:

I tested once. So there may be already 1 message. Just check tine of message.
ok i did and it works perfectly (but only using http and not https. You can see that i added an ok to the message to make sure it happened.
 

Attachments

  • Screenshot_20220124-000730.jpg
    Screenshot_20220124-000730.jpg
    507.7 KB · Views: 5
Last edited:

MacroDroidDev

Administrator
Staff member
I think Shelly button's don't properly support https unless I am mistaken? Unfortunately MacroDroid will redirect http -> https and thus requires a valid certificate.

If it was a simple fix to just support http then I would do it right away but unfortunately the webhook trigger functionality is deep within all my backend code which I cannot allow http access for. Therefore it will be a considerable job for me to unbundle this or work out the magic configuration settings to allow all this to happen. It's definitely one thing to look at in future but right now given that I'm not in any way a backend engineer or devops whizz then I'll avoid accidnetally breaking everything for the time being!
 
Top