Webhook for smartthings not reachable

I just got setup with HA this weekend and was trying to install the smartthings integration but get a message that “SmartThings could not validate the webhook URL. Please ensure the webhook URL is reachable from the internet and try again”.

I have setup port forwarding (443,80,8123) on my router and in HA external_url using duckdns and ssl. I’m confused as to why I can manage my HA externally showing a valid SSL cert in browser https://mydomain.duckdns.org:8123 but can not reach the webhook url: https://mydomain.duckdns.org/api/webhook/**********************

Any advice would be greatly appreciated.

I have the following in my configuration.yml and have confirmed the .pem files are there too and as I’ve stated, I do get a valid cert lock notice in the browser when I login to HA with the duckdns domain:

the only other yaml content other than these three lines were the defaults when installing HA on my PI 4b

yaml

http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

end yaml

Hi,
I have the exactly same issues and I have tried out so many solutions but I can´t solve it. Please is there any one out there who has the solution for this?

If I take a look at the URL that is popping up when I trying to add this integrations in a browser i got 404: Not Found.

image

1 Like

I have the exact same issue. I still cannot find any answers on this.

@1154beach @tomcool30 @IronSheepdog Guys I had the same problem and I’ve just found the solution which worked for me like a charm!
When you are adding the smartthings integration you will have a pop-up window to Confirm Callback URL.
Screen Shot 2021-02-11 at 18.46.15
Check if the URL starting from https:// — local IP — if yes then this is the case. It shoud start from the domain name which you made on duckdns. ex… yourdomain.duckdns.org/api
First click your user name on lower left corner scroll down to the bottom and create Long-Lived Access Token. Name it as you like.
Then added following lines to my configuration.yaml

homeassistant:
  auth_providers:
   - type: legacy_api_password
     api_password: !secret http_password
   - type: trusted_networks
     trusted_networks:
     - 192.168.0.0/24
     - fd00::/8
http:
  base_url: https://your_domain_name.duckdns.org
  server_port: 8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

Then add to secret.yaml

http_password: <your_long-Lived_Access_Token>

Check config and restart. Then add smartthing integration again.
Should work.
Good luck

Didn’t work for me.

Replying in case someone is googling this :slight_smile:

If you get the same issue as above, it’s very possible that Samsung Smartthings cannot reach your homeassistant instance due to your TLS configuration.

Most probably you are using lets encrypt. What worked for me is, I changed the nginx configuration to use as ssl_certificate the full chain fullchain.pem, rather than just the cert.pem.

While you’re there, don’t forget to disable TLS v1 and v1.1!

Check your ip_bans.yaml! Somehow the smartthings servers got banned in my case and that led to the error message showing up.
Try removing anything in that file and restart Home Assistant.

Also, if there’s a file called smartthings in the .storage folder within your config directory, rename that file (and restart HA after that before trying to add the integration).

Took me ages to find that out.

Anyone else still running into this issue? I’m trying to do a fresh install, still getting the same error.

my ssl_cert is pointing to fullchain.pem
I don’t have an ip_bans.yaml.

I’ve already tried deleting the smartthings file, rebooting and starting again.
My external URL is reachable outside my network.

Hi All, I have been struggling with this for the best part of 10 days, followed all recommendation but still no joy, then I recalled something that i read on a different forum and related to a bug around the nabu casa password , essentially if your password has a # then it will try to comment out anything beyond it when writing to the yaml file. Changed my password and it worked straight away, annoying but I am happy now.

Hello I did this and it seemed to work. I did have 2 questions

  1. In doing this I no longer can access HA via my IP address or homeassistant.local. Do I need to do something in the config to make that still available? Only works via duckdns now
  2. For Smartthings, I rebooted it then wanted to log me in as the API user using the token as the password (not sure if this was right but thats what I entered). I then readded the ST integration, it seemed to work. Brought me to a page to confirm, etc etc. However I still do not see the integration shown or any devices in my device list. Oh and I got an email from Smartthings saying welcome to the Dev Portal. Am I missing something?

Thanks!

Finally figured out what i did wrong. My firewall rules in Cloudflare were acting up.

3 Likes

The thing that made the difference for me was following the advice of KPeyanski in his video, which included adding these to my configuration.yaml:

homeassistant:
  external_url: https://YOUR_SUBDOMAIN_HERE.duckdns.org
  internal_url: http://YOUR_INTERNAL_HA_IP_HERE:8123

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  ip_ban_enabled: true
  login_attempts_threshold: 5

Can you please share how do you did it?
I’ve the same issue
Thank you

In cloudflare I am blocking all trafic from
other countries using WAF. As an exception i have added an allow rule for URI paths containing “/api/webhook”. For me the problem was that i had a blank space in the string which broke there rule leading to everything being blocked.

Hope you have been able to solve it.

1 Like

My issue was with Cloudflare, I had to disable Bot detection (Bot Fight Mode, or BFM). The free tier doesn’t let you bypass these with WAF rules, you have to subscribe to get SBFM, or Super Bot Fight Mode to bypass this using query strings in WAF rules.


2 Likes

homeassistant:
external_url: https://YOUR_SUBDOMAIN_HERE.duckdns.org:8123
internal_url: http://YOUR_INTERNAL_HA_IP_HERE:8123

Don’t forget to add port 8123. Both internal an external URL. That solved my issue.

thank you so much, this work for me

thank you, that worked for me

Oh, thank you :v:

I had a similar firewall restriction on my Synology NAS server where the Home Assistant is running (in a VM)… Removing that firewall restriction solved my issue…