Vera & IFTTT integration - it can be done today!

Its my understanding that you can also call IFTTT webhooks in normal Vera scenes (without PLEG) using os.execute and curl. Someone mentioned this as a response to a post I made on reddit a few weeks ago.

to recieve webhooks from ifttt i use automate android app on a android box. automate then passes the request on locally to vera. It does this with cloud messaging to recieve and http request locally, so no need to open any ports. It has been very reliable and quick.

Hi, would you be able to give more detail how you set this up?

Thanks

yes just ask for specifics. you need to install automate and ifttt. i have a flow that will recieve webhooks from ifttt and one that will send webhooks. so my flow receives a webhook from ifttt and then passes the webhook on locally with a http request to my vera

https://llamalab.com/automate/doc/block/http_request.html
https://llamalab.com/automate/doc/block/cloud_message_receive.html
https://llamalab.com/automate/cloud/

log in to ifttt website and go to


and follow link to documentation, there you will get your secret key.

then you will need to make flows for automate or download from the community and edit for your needs.

you only need to purchase automate if you use more than 30 blocks. i would purchase it any way as it is a excellent app and has many other uses. to make a flow to recieve webhooks and pass it on in http request would only need about 20 blocks.

i can let you have my flows if required

Ok, I’m a little late to the party, but this saved my bacon. Just one thing - is it possible to send parameters this way? Say I have a dimmer triggering the IFTTT webhook, the dimmer stops at 66% and I want to send the 0.66 along with the request.

Yes you can add a optional json body, query or form data with the webhook according to ifttt documentation

Make a POST or GET web request to:

https://maker.ifttt.com/trigger/{event}/with/key/fdhjhh5jj3433334M35KMhddddDFgfg

With an optional JSON body of:

{ “value1” : “”, “value2” : “”, “value3” : “” }

The data is completely optional, and you can also pass value1, value2, and value3 as query parameters or form variables. This content will be passed on to the Action in your Recipe.

I dream of the day Vera finally links natively with IFTTT, as do many others I’m sure. The joke used to be that Google kept its beta programs languishing forever… now, they are getting some competition in that department. :thinking:

ElCid I am seeing that it is possible to perform this integration with ifttt. Only now I ask you this question, if I want that when my phone’s wifi is detected by my local network, my vera will go to Home mode. How can I perform this action with this application?

No need for IFTTT, you can use the app WOLplusping as a scene trigger to set the home mode. You would need to set up a IP reservation on your router to assign a static IP to the phone.

you could use automate on your phone to send a local http request to vera when phone connects to wifi. This request would start the the home mode addon ie. http://***.***.**.***:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=24.

No need to have static ip. When i leave home my phone sends cloud message to local android running automate, then the local automate sends local request to turn on away mode. When i return home and my phone connects to local network it sends request to turn on home mode.

Continuing the discussion from Vera & IFTTT integration - it can be done today!:

Hello EICid, I try to setup this webhook between automate and ifttt but I am not succeed.
Can you please give me your flows and a more details steps how to set this up.
Thanks.

Try getting this flow working https://llamalab.com/automate/community/flows/28829.
this is the basic webhook from iftt to auto mate. you will need to add your secret key generated at https://llamalab.com/automate/cloud/. once you get webhook working then you can add the local http requests.

Show us what you tried as my flow is more complexed once you get the webhook working i will show you a http request flow.

After some struggles I succeed to send a webhook message via ifttt to automate. I have used the site example webform request in the ifttt webhook.
However I don’t understand what this “catch failure” part does in this totaal flow example. But it works.:grinning:

The next step will be to send a http request to my vera system, can you give an example how to proceed with this challenge. Thanks.

the catch failue is there tokeep the flow running if a failure happens it will stop the flow stopping.

i will upload an example to the community for you to look at
https://llamalab.com/automate/community/flows/32493
You will need to edit the variable set block with your vera’s local ip address

The payload would be “vera_on 23 1”
this will turn device 23 to on
or
“vera_dim 23 75|vera_on 24 0”
this will turn device 24 off and set dimming level of device 23 to 75%

here is link to possible http request to vera http://wiki.micasaverde.com/index.php/Luup_Requests#action

@ElCid, thanks for your example, but I don’t get it working.
I replaced the “app start” block from flow example https://llamalab.com/automate/community/flows/28829 by the example you upload and replace the tekst in variable set block by my vera configuration
http://192.168.1.48:3480/data_request?id=action&output_format=xml&DeviceNum=45&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1
See screenshot from my automate flow. Any idea what I am doing wrong?

delete blocks 3, 8 and 6

remove ok link from block 24

block 4 change messagearray to payload

link ok block 22 back to in block 4.

block 22 edit “payload[0]” to read just “payload”

That should sort it.

edit/

http://192.168.1.48:3480/data_request?id=action&output_format=xml&DeviceNum=##1##&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=##2##

The ##1## and ##2## need to be there.

Webform

secret=fggrrght5fr4trgty6t555444tgggr4rfgt5&to=thetest%40gmail.com&device=&priority=normal&payload=vera_on%2023%201

You could add a fork to make the cloud message recieve respond to multiple requests, as without fork, cloud block will not be waiting till all http requests are made. As example image below


Once your flow is running in setting of automate check run after restart, then your flow will restart after your android device restarts.

I succeeded to get the flow working now. I also added the fork as in the example.
First it was also working with the static http message in automate. But with the last remark I understand now that the flow is dynamically, depending of the webhook payload. So the flow can stay the same.

I want to use this now to send the status of 3 sensors in ifttt to a vera virtual sensor. So I have to create 6 webhooks, one for switch on and one for switch off, in ifttt to transfer this status. Or is there an easier way to do this? Thanks for your support.

Yes you would probably have to create 6. Unless the ifttt sensors can trigger on toggle and report state, then you may get away with 3. In developer section of ifttt, there is the ability to make more complicated applets https://platform.ifttt.com .

edit/

the payload can be multiple commands to.

vera_on 23 1|vera_on 24 1|vera_on 25 0

each command seperated with a |

Okay, I’ll try this

© 2019 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy