I am trying to use IFTTT to send a webhook request to set user variables (forecast high and low temperatures) within Domoticz and thus trigger an event. The request format is:
http://IFTTT:password@serverURL:port/json.htm?type=command¶m=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 or even just a browser, it sets the variable without a problem!
The Domoticz user IFTTT has “User” rights and “sharing” set to ON. It successfully uses other webhooks to set the state of virtual switches but cannot seem to change a user variable. Is there another permission or something else that I have missed?
Any suggestions would be most welcome! Thanks
IFTTT and Webhooks
Moderators: leecollings, remb0
-
- Posts: 6
- Joined: Thursday 09 January 2020 19:24
- Target OS: Windows
- Domoticz version:
- Contact:
- waltervl
- Posts: 5904
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: IFTTT and Webhooks
When you use a browser to test the url are you also using the IFFFT user?
If you login into Domoticz using the IFFFT user can you modify the user variable from the Domoticz webinterface? I suppose you cannot as it is not assigned to the user and cannot be assigned to the user.
If you login into Domoticz using the IFFFT user can you modify the user variable from the Domoticz webinterface? I suppose you cannot as it is not assigned to the user and cannot be assigned to the user.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: IFTTT and Webhooks
Only administrators are able to add/update/delete uservariables
Not sure what 'forecast high' means, but if you are trying to update a Temp+Barometer, you could also add this as a dummy in domoticz and update the device (json udevice call), this is allowed as User
Not sure what 'forecast high' means, but if you are trying to update a Temp+Barometer, you could also add this as a dummy in domoticz and update the device (json udevice call), this is allowed as User
Quality outlives Quantity!
-
- Posts: 6
- Joined: Thursday 09 January 2020 19:24
- Target OS: Windows
- Domoticz version:
- Contact:
Re: IFTTT and Webhooks
Thank you for your responses.
@gizmocuz. That would explain why the User Variable isn’t changed, as “IFTTT” is a User rather than an Administrator. However, it doesn’t explain how the same URL can change the variable when run from a browser on a different machine. The URL calls the Domoticz server, which runs on a Windows machine, using a port on the server’s external IP and the user “IFTTT”.
The IFTTT applet is <<IF forecast high temperature in [location] > 22 THEN send a web request using the URL webhook to set the User Variable at the forecast figure>>. That variable in turn triggers a Domoticz event, ie, heating on/off.
I hope that explains the situation better.
@waltervl. Thank you also - I hope this also answers your question.
@gizmocuz. That would explain why the User Variable isn’t changed, as “IFTTT” is a User rather than an Administrator. However, it doesn’t explain how the same URL can change the variable when run from a browser on a different machine. The URL calls the Domoticz server, which runs on a Windows machine, using a port on the server’s external IP and the user “IFTTT”.
The IFTTT applet is <<IF forecast high temperature in [location] > 22 THEN send a web request using the URL webhook to set the User Variable at the forecast figure>>. That variable in turn triggers a Domoticz event, ie, heating on/off.
I hope that explains the situation better.
@waltervl. Thank you also - I hope this also answers your question.
- waltervl
- Posts: 5904
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: IFTTT and Webhooks
As gizmocuz already mentioned you perhaps better use a switch to trigger the dzvents script instead of a User variable.
When you test with the url in a browser did you check that user IFTTT is logged in? Probably the admin user logs in instead of the IFTTT user because of a cookie.
When you test with the url in a browser did you check that user IFTTT is logged in? Probably the admin user logs in instead of the IFTTT user because of a cookie.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: No registered users and 1 guest