jbergler / hass-ttlock

Home Assistant integration for TTLock locks
54 stars 12 forks source link

Is there a trick to enabling the webhook? #60

Closed jpravetz closed 1 year ago

jpravetz commented 1 year ago

I'm not seeing the webhooks being called, and I get a 405 Method not allowed error when using the URL with curl.

curl -i -X GET http://192.169.1.89:8123/api/webhook/<key-goes-here>

I wonder if I am missing something I need to configure to allow this GET through? I'm on Home Assistant 2023.6.3.

jbergler commented 1 year ago

Hey @jpravetz - that looks like an internal IP which won't be accessible from the internet. You'll need some kind of public access to your home assistant instance so that the URL works from the internet.

If you're testing locally, changing -X GET to -X POST should get you a different response.

jpravetz commented 1 year ago

That's my mistake: I wasn't expecting the TTLock callback to use a POST. Or is it? Thanks, and the local IP address is just for isolation testing.

jbergler commented 1 year ago

The docs for the ttlock webhooks are here if this is helpful: https://euopen.ttlock.com/document/doc?urlName=cloud%2FlockRecord%2FnotifyEn.html

Otherwise I'm not sure how I can help at the moment. You can try using webhook.site and pointing your ttlock account there to see if you're receiving webhooks from the ttlock cloud maybe?

jbergler commented 1 year ago

@jpravetz I'm going to close this, but if you feel there's an issue with the integration don't hesitate to report back!