I have set everything up what I think is correctly.
I know my Google Home is talking to IFTTT as I can use GH to send a text message.
On my Raspberry Pi I have set up LetsEncrypt and on my Router I have setup DuckDNS. I can connect to https://my_duckdns_name:8123 both internally and externally (over 4G) So I know that’s working.
I have configured my MiLights/LimitlessLED and it is all working and I can control them from Home Automation.
In IFTTT I have setup an applet to connect Google Home as follows:
If I say Turn on the Lounge Lights it responds with Turning Lounge Lights On.
It them makes a Web request:
https://my_duck_DNS_Name.duckdns.org:8123/api/services/light/turn_on?api_password=my_http_api_password
I also have method: POST, Content Type Application/JSON, Body: {“entity_id”:“light.lounge”}
If I put the web request URL into my browser it says 405: Method Not Allowed.
If I get Google to trigger it, it says Turning the lounge lights on but bothing happens. I do instantly get an error message in Home Assistant saying Login Attempt Failed and the text Login attempt or request with invalid authentication from 52.90.141.10 which I think is Google Home.
Putting the URL into your browser performs the GET method. That’s why you get the 405 error.
If you really want to try it from a third party tool, try the postman app from chrome. That will allow you to construct an HTTP post.
The login error seems to indicate you aren’t passing the password string along in a proper format.
OK. So I put the password into the configuration.yaml file. I then used that same password in the URL web hook in IFTTT - am I supposed to do something else with the password?
Put this in a browser:
https://my_duck_DNS_Name.duckdns.org:8123/api/?api_password=your_api_password
If your browser returns : {“message”: “API running.”} then you have everything set up right locally, and the problem is with your ifttt setup.
If it doesn’t, then you have the local setup wrong.
OK - It says 401 Unauthorised
So what am I doing wrong? I am using tha same password I type in to get into home assistant. Does the password in the yaml file need to be encrypted to use it in a URL?
I am also getting an error in HA when I try and access and it is saying my current IP address so it’s definitely to do with the password. It’s not at all clear how I should change the password to use in the API.
Not sure about “%” but “&” has special meaning in URLs (signifies the end of one argument and the start of another (e.g., http://yourbox.example/script?username=bob&password=fred) You’ d need to delimit or encode at least the “&” before using it/them in an URL.
I have given up an google actions boy that is SO complicated. I want to keep it simple and use IFTTT with Google Home to run a script or automate stuff via my Broadlink.
I wasw wondering if you could provide steps of who to get this working. I have a IFTTT account but after that I am a little lost after that. I have SSL and Lets Encrypt up and running https://*.duckdns.org which resolves to HomeAssistant (HASSIO) :8123.
If I want to turn on ‘switch.lounge_aircon’ entity how do I do this, step by step with IFTTT.
Glad it helped you. No alternative I know of. Make sure you have a complex password is my best advice. Remember it’s an SSL connection so someone should not be able to sniff it out…
I think some other people have it locked down even tighter but I think it’s a small risk really.