IFTTT troubleshooting... Maybe duckDNS and let's encrypt issues?

I am. I’m also using nginx instead of HA ssl but I don’t think that should matter.

I also added spaces in my JSON {$“entity_id”$:$“light.desk_lamp”$} ($ represent where i put spaces)

EDIT: I see you have your JSON also spaced out in your screenshot.

The “check now” button only seems to be checking the status of the applet, last run, etc. Edit: It doesn’t seem to do anything.

I actually have to send an sms (the trigger i chose) to ifttt for my light to turn on.

The spaces shouldn’t make a difference. I’m using LetsEncrypt and IFTTT (without nginx) and it’s working fine for me. It’d be nice if there was a record of an error from the IFTTT Maker channel.

Also - is “yes” a correct value for “flash”? Looks like valid values are “short” and “long”

I agree i was just pointing out anything that i had done differently. IFTTT works for me as well. The “check now” button however does nothing, which I believe is what @Aephir is using to test his applet. Does that button do anything for you?

I have this exact same issue - with both IFTTT and API.AP (that returns a Webhook call failed. Error message: Webhook response was empty error). I am on v 0.40.1 and cant for the life of me get this working.

Only difference in my config is that I’m using a non-standard port https://MYDUCKDNSURL.duckdns.org:61443/api/services/light/turn_on?api_password=MYPASSWORD

I can browse to the above URL and as expected get a HTTP 405. I can also access the hass web gui via https on my non-standard port as well.

I have tweaked the baseurl in http to add/remove the non-standard port to no effect.

Will keep an eye on this thread, but will start one of my own for api.ai.

FYI found out my problem. Whilst all browsers seemed to be happy, a tcpdump revealed that IFTTT and api.ai were rejecting my letsencrypt certificate. A bit more digging around showed me that I should have been using fullchain.pem (including intermediate letsencrypt certificates, which you can concatenate onto your cert file if your ACME client doesnt do this for you - mine didnt). Bang. Works great.

You’re right, I don’t think the “check” does anything. I tried activating an applet from external (autoremote in tasker); I got the activation notification fro IFTTT but still no lights. I’ve tried with different lights (just turning on, nothing ‘fancy’ like flashing). Still no luck.

It looks like you’re right, I just copied the “flash”:“yes” from this page: IFTTT - Home Assistant. But I have also tried other versions, just specifying the lamp, and nothing else. (like { "entity_id": "light.hue_lightstrip_plus_1" } ), or an empty body (or only the empty { } brackets).

Sounds good. But… Ehh… Do you mind expanding a bit (explain it like I’m 5 yo :slight_smile: ). I do have a fullchain.pem and a cert.pem file here: /etc/letsencrypt/live/MYIP.duckdns.org/. How do I check if my ACME client does this? And if not, how would I go about doing this manually (and would I have to do this every time I get new certificates)?

I kept it simple, just appended the contents of cert.pem into fullchain.pem and used the updated fullchain.pem file.

cat cert.pem >> fullchain.pem (note the double >> or you will lose contents of your file).

Never append your private key to this file.

Give it a go…

Thanks, and sorry for the alte reply, I’ve been out of the house the last week.

First off, it seems to work now, so thanks for the suggestion!

I’m not quite sure I understand one part though. I started by just looking at the cert.pem and fullchain.pem, and saw that the cert.pem has one certificate, the fullchain.pem has the exact same certificate, followed by another certificate. Then I appended as @acs recommended. Now the first and the last certificate are identical, with another one in the middle. Is there a reason for this? It seems intuitively weird to me, that the same one needs to be there twice? Or does it just have to be the last one?

In any case, thanks a lot!

@aephir - you dont need duplicates in the fullchain.pem file. Just your public cert and the intermediate.

I can’t seem to cat these files at all, even running sudo. Is there some step that I am missing?

pi@raspi1:/etc/letsencrypt/live$ sudo cat cert.pem >> fullchain.pem
-bash: fullchain.pem: Permission denied

Can you manually open, edit and save the file?

Yeah, did it with notepad and that seemed to work.

How will this effect renewing the certs with certbot though?

I have no idea. I would think it didn’t, but I don’t really have any experience to base that on. Maybe you could try just copying the cert.pem and pasting this at the end of the fullchain.pem file and saving, then doing the certbot renewal and see?

Otherwise you just hope someone else can answer better than me.

AGRHHHHH… I am going crazy because of this!!! EXACTLY the same issue, cannot control HA from IFTTT. The problem is that IFTTT, webhooks, SSL, are all new to me…

Anyway, I have maker channel configured EXACTLY as in examples, correct URL, correct password, and yet it never actually manages to talk to HA. The best I got to was I was receiving notifications that there was an attempt to connect but failed due to authentication. In IFTTT I am getting “an error with Maker Webhooks prevented your Applet…”

I did appended content of cert.pem in to fullchain.pem (so I have 3 keys in fullchain.pem)

Any ideas?

Thanks

Found it: I copied body messages form examples, and edited them to fit my needs. Turns out those where somehow wrong quotation marks!

1 Like

@hede0n
Frustrating! I can show you what I have set up, so maybe you’ll find something useful?

I assume you have everything set up so you can access you homeassistant instance from outside you home network, with an address starting with https://?

And just to be completely sure (sorry if this sounds condesending, just something I could have screwed up, so better make sure :slight_smile: ), you are using the cert.pem and fullchain.pem in the correct folder? I have three different pairs, but only one pair in the correct folder (/etc/letsencrypt/live/REDACTED.duckdns.org/fullchain.pem)

My IFTTT applet looks like this:

I also tried sending from HA to IFTTT first; I have a scripts.yaml file where I have the following entry for IFTTT

  ifttt_test:
    alias: IFTTT Test
    sequence:
      - service: ifttt.trigger
        data:
          event: testhass

Then you can make an applet on IFTTT that reacts to receiving “testhass”, and does whatever.

So if you can access through SSL (that is, if you can connect to your home assistant when you are not at home, using an address like the one I have in my IFTTT applet, starting with https://, not http://), then I’d start by seeing if you can send out, from HA to IFTTT.
If you can access from outside, but can’t send from HA to IFTTT, then… well, then I don’t know. Maybe re-check you maker api key? I’ve changed mine several times, and somehow I always forget to set the new one in one or two places.

But if you can’t access via https, then that is where you should start.

For reference, my http entry in my configuration file is:

### HTTP ###
http:
  api_password: !secret api_password
  ssl_certificate: !secret my_ssl_certificate
  ssl_key: !secret my_ssl_key
  base_url: !secret secret_base_url
  ip_ban_enabled: True
  login_attempts_threshold: 3

If you’ve set up your certificates etc. like I have (let’s encrypt and duckdns), then you also need to enable port forwarding on you router. Some people said it didn’t matter about the port, but the way it works for me is forwarding the external port 443 to my internal IP (192.168.0.160 for me) for the system running home assistant, and port 8123. But given that you get a connect attempt, this is probably not the problem…?

1 Like

Good troubleshooting guide, thanks for that.
I think I had two problems, first one was probably with .pem files, as soon after I worked on them, I stopped recive notifications about failed login attempts (or something like that). But it still didn’t work, so I was starting to pull my hairs out. At this point I decided to revisit .log and found that problem cascaded down and now I was reciving error messages about not using double quotation marks! I was, but copy/pasted body somehow had different double quotation marks.

Thanks man, I can finally go to bed :wink:

Great! I do remember having some issues with those as well. But glad you figured it out.

Hey! anyone know how to make it work with HassIO (with lets encrypt and DuckDNS)? If I understand things correctly it has to do with the Encryption-certificates. I’ve set up Lets Encrypt and DuckDNS with the addons in HassIO and I had an old Webhook/Maker-connection in IFTTT.

//F

I am also having trouble getting IFTTT and Google Home to work. I am so aggravated. I have spent the whole day reading threads and changing settings. I’m pretty sure my IFTTT webhooks key is right; the Applet has the right stuff in the right parts. But when I give Google Home my command, I get this error in the log file"

2017-08-16 16:05:12 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 422, in start
resp = yield from self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web.py”, line 306, in _handle
resp = yield from handler(request)
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/lib/python3.6/asyncio/coroutines.py”, line 213, in coro
res = yield from res
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/ban.py”, line 58, in ban_middleware_handler
return (yield from handler(request))
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/init.py”, line 424, in handle
result = yield from result
File “/usr/lib/python3.6/site-packages/homeassistant/components/api.py”, line 311, in post
data = json.loads(body) if body else None
File “/usr/lib/python3.6/json/init.py”, line 354, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.6/json/decoder.py”, line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python3.6/json/decoder.py”, line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Here is my Applet:

Any Help out there in Hass.io land?