How to get IFTTT working with new auth


#1

How do you use IFTTT with the new user authentication? Getting authentication failures

Like this is the old way

https://myinfo.duckdns.org/api/services/script/turn_on?api_password=passwordhere


#2

You can’t. It’s not supported yet. That’s why you still enable legacy api for now. There will eventually be a solution.


#3

I see the next version of HA (76) will have the new auth enabled by default. I know you can keep legacy auth enabled easy enough (I have that set up now). Was wondering if anyone knew if there was any guesses on support of the new auth with stuff like IFTT. I have a few IFTTT webhooks, and it would be great to get rid of the password being stored within IFTTT.


#4

So I’ve just started converting over to the new webhook introduced in 80.x

Just to make sure i understand, I just need this exact automation set up to handle all IFTT requests? Is that right?

automation:
  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 }}'


#5

Exactly, I set that up and removed my api_password (only needed it for ifttt before) and it works great!


#6

Is there a way to hit the /api/states endpoint from IFTTT using new-style auth? I would just add the “bearer XXXXXX” header if I could. Can this value be specified in the JSON?


#7

There is a great walk through about how to use the new Auth, I cannot find it at the moment, but it was part of the documentation of the previous version (81.x I believe).


#8

I don’t have a problem using the new authentication mechanism. I have written code to use it already. I just can’t find a way to use it from IFTTT. I was wondering if anyone had found a way to do so.


#9

Can you give an example of what you want to do? I have a few IFTTT automations set up to turn on/off Switches or scripts from IFTTT to HA.


#10

I want to avoid using the legacy password and instead use a long-lived access token. The only way I know of to do this is to add an http header like, “authorization: bearer xxxxxxxxx”, but I don’t know how to do this in IFTTT.


#11

Ok, go into COnfiguration, then Select Integrations, then select IFTTT Configuation. You’ll get the info you need, then go to IFTTT and use the info you get from the configuration like so. (This is one of mine).


#12

what need to be but at “Your Code HERE”?


#13

When you go into configuration, and then integrations and then click on IFTTT, it will provide you a unique webhook ID.


#14

So im not sure where I am having an issue at the moment. I have this automation my config.yaml file. Only difference is I have it at automation old: Since I am using some of the new automatons from the GUI.

I did set up my ifttt integration with my unique ID and i am attempting to run a script that I have set up. I have tested the script so I know it works.

I think it is 1 of 2 things, im not sure if i have the correct json inside the body of IFTTT for my applet to run the script and Im also not sure if the “automation old:” is working or how to possibly build that automation with the new GUI

This is what i have in the body of my applet on IFTTT

{ "action": "call_service", "service": "script.1538381217121" }


#15

It should look something like below. Change turn on to toggle or off:

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

#16

Even though I can go to my developer services and call script.1538381217121 without anything else?

Ill try it:

Yup still nothing, i think it has to do more with my automation not receiving the webhook properly, this is what my automation looks like in my configuration.yaml file looks like

automation old:
  alias: 'Wake on LAN'
  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 }}'

Ifttt webhook configuration on nginx reverse proxy
#17

Did you get this fixed in the end @asuramin?

I have been pulling my hair out for a while trying to get webhooks working, finally got it working by adding :8123 after duckdns.org !

When you go to Configurations and Integrations for some reason Home Assistant gives you:

https://mydomain.duckdns.org/api/webhook/xxx

but I added the the port number like:

https://mydomain.duckdns.org:8123/api/webhook/xxx

Into the url box on IFTTT.com


#18

I did get it working great. I had to get rid of old automation and import it into the new format to get it to work.