-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhook #84
Comments
Hi @3web, as I can see you are using an IP address. They no longer work. SmartThings server will only call a webhook with a valid SSL certificate, which only will work with a domain. You need a public IP address, a domain pointing to IP, and a valid SSL certificate to reach your nodered instance. If you don´t have a valid IP address, you can get a look at noip, which provides you a DDNS with SSL certificate. regards, |
Dear Otávio Thanks for your message. The status Code is: 401 Unauthorized (from Node Red/node-red-contrib-smartthings), wenn i call the Endpoint over http and the host ip address, in a internal network? And now i have to move my infrastructure to a cloud provider, call the endpoint over the fqdn with a ssl certificate? Have i understand your solution correct? regards, |
This is not my solution. Unfortunately, Samsung is changing some things within smartthings. Now, SmartApps can not run on the hub anymore, so, no local network. The webhook is called from the Samsung network/cloud infrastructure, then, you need a public IP address, and they will call it only over https, and they will validate the SSL certificate. So, yes, you need a public IP, a domain, and a valid SSL certificate. But, you don't need to move your nodered instance to the cloud. You can keep it with you. You can use solutions like noip, which will provide you with a ddns solution with a valid domain and SSL certificate over a dynamic public IP address. Some people have a proxy on the cloud with a VPN to their house's infrastructure. A tiny machine that just forward those requests. There are some solutions. |
Dear Otávio This dose not solve the problem: `12:05:08.795081 IP localhost.34716 > localhost.1880: Flags [P.], seq 816386050:816386741, ack 3167600180, win 512, options [nop,nop,TS val 998723506 ecr 998723506], length 691 {"id":"67314582-490c-4541-a738-d13fc85d6f60","date":"2022-07-04T16:05:08.618Z","value":"open","name":"contact","display_name":"Fenster B..ro","description":"Fenster B..ro was open","source":"DEVICE","state_changed":true,"physical":false,"location_id":"d281d309-8e36-4cf3-a608-4e5b7d12a09e","hub_id":"e529e143-9335-4974-8cb6-e619c7103c31"} Forbidden` The status code is the same: 401 Unauthorized regards, |
Can you check if this is not your problem? Are you using a proxy? regards |
Yes, i'm using a apache proxy pass. When i testing the "hook" with the Postman, i can see the same error (old and new installation). In the log is to find the folloing entry: This entry is correct, i do not use a authentication. Regards, |
The problem is the same as mine. The proxy is altering a header or not passing through all of them exactly as they were. The "http-signature" is being checked and SOME header has been altered and so the signature is not correct. I've tried, but SmartThings has been no help is explaining exactly what headers are being used in the creation of the signature, and so we don't what to fix. You won't get this working with a proxy unless we can determine exactly what headers are being used to create the signature, so that we can ensure they are passed through cleaning to be verified properly. Scott |
The above would mean opening my NodeRED instance to the internet, without going through a proxy, NO THANKS. The only way I would be willing to do this is by adding the SmartThings Cloud Public IP's to the inbound rule on my firewall. For now I am going to be downgrading to version 0.0.20 SmartThings npm as this version still supports location WebHook. |
The problem is not the version supporting local webhook but Samsung. They will stop supporting it. As far as I know, they should not support it anymore... And the old version is developed using local device handles, which Samsung will also discontinue... I also like the old solution much more... unfortunately not only Samsung but all big techs are proposing cloud solutions for their platforms... regards, |
I understand that the problem is coming from Samsung, the thing is I am running version 0.0.20 and local webhook is still working fine for me. Maybe when they remove the groovy is when I will loss access. It's a shame as having nodeRED open to the outside world posses a security risk for me. The only way to resolve this would be to add the SmartThings Cloud Public IP's into my firewall rule. It's just another thing that SmartThings are killing off when they switch of the groovy at the end of the year. Regards, |
I moved myself to hubitat for now, planning Home Assistant as well. When you move out, you will figure out that to use some things like Alexa, Google Home, and others, you will have to pay for home assistant cloud or open it up to the world equally. As I said, most of those big tech companies will handle their devices on the cloud, and to handle webhooks, you will need to open up home assistant and have an SSL certificate... or... pay for them to use the home assistant cloud, which will proxy all those requests... The good thing with home assistant is that they put in some effort to make it all run locally. regards, |
I configured Home Assistant Smartthings integration for a friend these days, and it is the same thing. I needed to open up home assistant to the world and get a noip account and an SSL certificate from them... This is the only way Home Assistant can handle webhooks from Smartthings as well... you can choose to pay Home Assistant cloud, as I said before... Home Assistant Smartthings integration has changed to use the new webhook system as well... regards, |
And you can always install a Nginx on an external host, configure it as a stream, and proxy all requests to your local nodered, home assistant, etc. This way, you create a bridge and don't need to open up your nodered to the world... This is basically what hubitat and home assistant clouds are doing... regards, |
I have now a NodRed (with MQTT) as a external installation. This installation receive the the SmartThings web hook an save it in the MQTT store. My local NodeRed is connected to the external MQTT and receive the web hook notification. On this way i not have to move the full NodeRed in a external installation or to open the mein local network form outside for a simple web hook. I hope matter will fix this in the future... regards, |
I have used this URL before the version 0.42:
http://XXX.XXX.XXX.XXX:1880/smartthings/webhook
On this URL can not longer receive a webhook. Than i use this URL:
http://XXX.XXX.XXX.XXX:1880/smartthings/smartapp
But the webhook dos also not working. As you can see in the TCP Dump:
Request:
`20:53:48.828333 IP SCR-HOST.60688 > DEST-HOST.1880: Flags [P.], seq 1715952987:1715953518, ack 1427407629, win 913, options [nop,nop,TS val 224966201 ecr 1537292140], length 531
E..G..@[email protected]...(...XfG][U..............
.h.9[.7lPOST /smartthings/smartapp HTTP/1.1
Accept: /
User-Agent: Linux UPnP/1.0 SmartThings
HOST: C0A80128:0758
Content-Type: application/json
Content-Length: 365
{"id":"67314582-490c-4541-a738-d13fc85d6f60","date":"2022-07-03T18:53:48.617Z","value":"open","name":"contact","display_name":"Fenster B\u00fcro","description":"Fenster B\u00fcro was open","source":"DEVICE","state_changed":true,"physical":false,"location_id":"d281d309-8e36-4cf3-a608-4e5b7d12a09e","hub_id":"e529e143-9335-4974-8cb6-e619c7103c31","smartapp_id":null}`
Response:
`20:53:48.924546 IP DEST-HOST.1880 > SCR-HOST.60688: Flags [P.], seq 1:278, ack 531, win 505, options [nop,nop,TS val 1537292245 ecr 224966201], length 277
E..I.t@.?.!n...(...T.X..U...fG_n...........
[.7..h.9HTTP/1.1 401 Unauthorized
Access-Control-Allow-Origin: *
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 9
ETag: W/"9-PatfYBLj4Um1qTm5zrukoLhNyPU"
Date: Sun, 03 Jul 2022 18:53:48 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Forbidden
`
What is the correct webhook URL or what is to do?
The text was updated successfully, but these errors were encountered: