Sending events from IFTTT to Home Assistant - webhooks broken?

I’m looking for something similar. Need to pass 2 variables from IFTTT to HomeAssistant.
Basically i want:
(Open/close) the gate after (xxx) minutes

hello, how to check that? I have troubles as well, I can see that my ewelink button was pressed but nothing happens on hassio side. My automation is that when ewelink power plug is off web request is sent to home assistant, but cannot find if it was sent successfully.
When I fire ifttt event it gives such error:
Error while executing automation automation.automation_0. Error rendering template for call_service at pos 1: UndefinedError: 'light' is undefined

I did the following:

Set up an input_number in HASS to hold the incoming variable (in this case “myair_inputsettemp”)

Set up your automation to trigger on a state change of the input number:

Set up your IFTTT recipe similar to:

2 Likes

Hello, please, someone help me? It cannot work.
Ifttt without errors, just ran.
Sript work without problems
Where is problem??

IFTTT
URL: https://xyz.ui.nabu.casa/api/webhook/ID-what-i-find-in-url-in-integration-ifttt-hassio
Method: POST
Content Type (optional): JSON
Body: { “action”: “call_service”, “service”: “script.turn_on”, “entity_id”:“script.1545748537688” }

Hassio automation.yaml

- id: '1573383106726'
  alias: automate_ifttt
  trigger:
  - platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: 'call_service'
  action:
  - service_template: '{{ trigger.event.data.service }}'
    data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'

SCRIPT

'1545748537688':
  alias: Clean the kitchen
  sequence:
  - data:
      command: app_zoned_clean
      entity_id: vacuum.xiaomi_vacuum_cleaner
      params:
      - - 22042
        - 25387
        - 25792
        - 29187
        - 1
    service: vacuum.send_command

Also i trying active webhooks url from nabu casa, nothing works

Hello @pejotigrek,

i copy/paste your formated code in my automation in configurator :

- id: '1573417319547'
  alias: IFTT GH
  trigger:
  - event_data:
      action: 'call_service'
    event_type: ifttt_webhook_received
    platform: event
  condition: []
  action:
  - service_template: '{{ trigger.event.data.service }}'
    data_template:
       entity_id: '{{ trigger.event.data.entity_id }}'

and the result when i go to configuration ----> automation is :

Action non supportée :

{
  "data_template": {
    "entity_id": "{{ trigger.event.data.entity_id }}"
  },
  "service_template": "{{ trigger.event.data.service }}"
}

i search for space and everything you explain but without success …

What i am doing wrong pls?

Thanks if you have time to have a look :wink:

@Bojkas in your “params:” section there are two dashed before “22042” - is it a mistake or straight copy from config? if a copy - then maybe this is the problem?

hi @Olivier974! I’ve looked now, and read your code back&forth few times, also compared it to mine - everything seems to be fine… except the “condition: []” part, but I guess that it’s just configurator’s way to tell that there’s no condition, and this isn’t an issue here - but did you tried to remove it? besides that I’m stuck, can’t see the trouble in your code… it looks exactly like mine :frowning:

Hi, i got the issue with the last update. I am moving to the new authentication method (no more api_password).

I paste here my automation:

- id: spegniluci
  alias: spegniluci
  trigger:
  - event_data:
      action: call_service
    event_type: ifttt_webhook_received
    platform: event
  condition: []
  action:
  - data_template:
      entity_id: '{{ trigger.event.data.entity_id }}'
    service_template: '{{ trigger.event.data.service }}'

the Ifttt url:
https://myname.duckdns.org:8123/api/webhook/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

body:
{ “action”: “call_service”, “service”: “script.turn_on”, “entity_id”: “script.allarme_disinserito” }

If i trigger the script manually the TTS works, seems that the Ifttt trigger doesn’t work.

Any advice?
Thank you!

did you try to delete the empty condition line?
I’m guessing that it can be the issue.

when triggering manually, automation skips the trigger block, doesn’t check the conditions in the condition block and jumps to action at the start. so it’s not only skipping two blocks, but also you can’t check your conditions [if any] for problems.

on the side note: that’s why I ditched the condition block in all my automations, and moved conditions into the action block.

I will try asap,
BTW my iphone decided to update automatically the new IOS App and everything doen’t work again.
I quite pissed off, i am an IT manager, regression tests are the ABC of solid platforms. Here every update makes u code all the config file and automations all over again.

I will let u know if the issue of ifttt is conditions.
Thanks

I’m guessing that the downside of opensource project is that not always they obey the rules and ABCs - due to the group of often a random people that works on it. but mostly a) this does no harm b) the harm is a small cost of having great software at no price.

at least this is how I explain it to myself whenever any opensource project I use/used messed up something with my configs :smiley:

I think that all nowadays changes made to the core of Home Assistant nowadays and propagated to all the addons, have the purpose of eradicating those situations where update can F* everything up. or maybe it’s the second think I’m trying to explain to myself :wink:

1 Like

I have exactly the same issue. Trigger the webhook with api tester (apitester.com) everything is fine.
sometimes IFTTT works, but that is 1 out of 100.

Given up on hue, integrated Alexa with IFTTT, very true the pasted speech marks stopped it working, changed to standard and all good, thanks!

Hi,
In my configuration it doesn’t work.
when I was using the API password everything was working perfectly.
With this new authentication it doesn’t work anymore.
Every update there is tons of work to fix the configuration…
Did u find a solution?

What do you mean?

The speech marks around the webhook text in IFTTT were slanted, must have been where I copied from. Needed to be " not ” .

I tried also with the different speech marks you suggested me.
BTW i didn’t find any solution.

i paste here my configs hoping someone can help me.

id: this_is_the_automation_id
- alias: Recieve information from IFTTT
trigger:
  platform: event
  event_type: ifttt_webhook_received
  event_data:
    action: call_service
action:
  service_template: '{{ trigger.event.data.service }}'
  data_template:
    entity_id: '{{ trigger.event.data.entity_id }}'

my webhook url:

https://myname.duckdns.org:8123/api/webhook/00000000000000000

As body i have:

{ "action": "call_service", "service": "script.turn_on", "entity_id": "script.allarme_disinserito" }

I don’t understand why the script works (if i trigger it from home assistant), and the IFTTT applet also seems to work…

Thank you for your help
Marco

No didn’t find a solution. Stopped this part. Don’t want to use IFTTT in the first place but had to read a motion sensor. Now i solved with a Zigbee one so don’t need webhooks anymore.

I think based on my testings the problem is somewhere between Tuya and IFTTT. When running the webhook directly everything works fine. But the request from the Tuya motion never reached IFTTT

You’re my God. Thank you very much.

where do I enter the URL, Method, Content type, and Body? I have IFTTT set up to send from Hassio to IFTTT and that works great, but can not set up to send from IFTTT to Hassio. In my config I have IFTTT: and my API key . Can not seem to get it flowing the other way, never found anywhere to enther that URL info. I use duckdns and Nabu Casa.

url, method, content and body are in the ifttt configuration - in the “THEN” part, when you select “webhook” there’re action fields to fill up, and those are the mentioned url, method, content and body :slight_smile: