Page 1 of 1

Is it possible to start a Domoticz script by sending a HTTP request?

Posted: Tuesday 02 July 2019 0:30
by pgielen
I's like to send a HTTP request from IFTTT to start a dzvents script in Domoticz. Is this possible? How? :?:

Re: Is it possible to start a Domoticz script by sending a HTTP request?  [Solved]

Posted: Tuesday 02 July 2019 6:43
by felix63
I would create a dummy switch in Domoticz. Then in IFTTT create an action using ‘Webhooks’ to flip the switch and use that as a trigger to start your script.

In webhooks you can use this (after replacing the appropriate parts with real values):

Code: Select all

https://USERID:PASSWORD@URL:PORT/json.htm?type=command&param=switchlight&idx=IDX&switchcmd=On

Re: Is it possible to start a Domoticz script by sending a HTTP request?

Posted: Tuesday 02 July 2019 13:38
by pgielen
Thanks. I've got a lot of virtual devices already :-)

Re: Is it possible to start a Domoticz script by sending a HTTP request?

Posted: Tuesday 02 July 2019 14:38
by waaren
pgielen wrote: Tuesday 02 July 2019 13:38 Thanks. I've got a lot of virtual devices already :-)
If you prefer you can also use a domoticz uservariable as trigger for your script.
JSON/API would then look like

/json.htm?type=command&param=updateuservariable&vname=USERVARIABLENAME&vtype=USERVARIABLETYPE&vvalue=USERVARIABLEVALUE

where USERVARIABLETYPE can be
a digit (0,1,2,3,4) or a string (Integer, Float, String, Date, Time) (string only when domoticz version = 4.10906 or later)

Re: Is it possible to start a Domoticz script by sending a HTTP request?

Posted: Monday 01 July 2024 2:07
by mikedavies1953
I know this question was answered some years ago but I have a related problem with which I’m hoping somebody can help.

I’m using IFTTT to send a webhook request to set a user variable (forecast high and low temperatures) within Domoticz. The URL is the updated version of the one suggested above:

http://IFTTT:xxxxxxxxxxxxxxxxxxxxxxxxxx/json.htm?type=command&param=updateuservariable&vname=Narboroughhigh&vtype=0&vvalue=18

My problem is that, although the IFTTT applet runs correctly and sends the request to Domoticz, it doesn’t set the variable but just generates an error message: “Error: User: IFTTT tried to update a uservariable!”

However, if I open the link manually from within IFTTT, it sets the variable without a problem!

The Domoticz user IFTTT successfully uses other webhooks to set the state of virtual switches and has “sharing” set to ON but cannot seem to change a user variable. Is there another permission that I have missed?

Any suggestions would be most welcome! Thanks

Re: Is it possible to start a Domoticz script by sending a HTTP request?

Posted: Thursday 04 July 2024 16:28
by waltervl
mikedavies1953 wrote: Monday 01 July 2024 2:07 I know this question was answered some years ago but I have a related problem with which I’m hoping somebody can help.

I’m using IFTTT to send a webhook request to set a user variable (forecast high and low temperatures) within Domoticz. The URL is the updated version of the one suggested above:

http://IFTTT:xxxxxxxxxxxxxxxxxxxxxxxxxx/json.htm?type=command&param=updateuservariable&vname=Narboroughhigh&vtype=0&vvalue=18
Already answered here https://www.domoticz.com/forum/viewtopi ... 28&t=42471