*** this is now working, not sure how/why but data is now coming through. I will leave here for reference ***
I am struggling to get the webhook working so I can get updated information from my doorbell.
I have the binding running on a OH3.4.0M4 setup and the standard information is coming through ok.
However no matter what I try I cannot get any luck using the webhook.
The account info was manually entered, and the rest was automatically configured using the scan function of the binding.
Log from openhab.log - logging set to DEBUG
2022-11-16 11:48:12.832 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Initializing Netatmo API bridge handler.
2022-11-16 11:48:12.865 [INFO ] [etatmo.internal.servlet.GrantServlet] - Registered Netatmo servlet at '/netatmo/connect/"Client ID"'
2022-11-16 11:48:20.789 [DEBUG] [etatmo.internal.servlet.GrantServlet] - Netatmo auth callback servlet received GET request /netatmo/connect/"Client ID".
2022-11-16 11:48:47.030 [DEBUG] [etatmo.internal.servlet.GrantServlet] - Netatmo auth callback servlet received GET request /netatmo/connect/"Client ID".
2022-11-16 11:48:47.031 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Connecting to Netatmo API.
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Registered Netatmo servlet at '/netatmo/webhook/"Client ID"'
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Setting up WebHook at Netatmo to http://"IP Address of router":88/netatmo/webhook/"Client ID"
2022-11-16 11:51:07.463 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'netatmo:home:"Account ID":"Home ID"' to inbox.
2022-11-16 11:51:07.467 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'netatmo:doorbell:"Account ID":"Home ID":"Doorbell ID"' to inbox.
2022-11-16 11:51:28.791 [DEBUG] [tatmo.internal.handler.DeviceHandler] - Initializing handler for bridge netatmo:home:"Account ID":"Home ID"
2022-11-16 11:51:44.428 [DEBUG] [tatmo.internal.handler.ModuleHandler] - Initializing handler for thing netatmo:doorbell:"Account ID":"Home ID":"Doorbell ID"
2022-11-16 11:51:47.087 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 180 s
From events.log
2022-11-16 15:59:59.412 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 137879 bytes to raw type (image/jpeg): 135674 bytes
2022-11-16 15:59:59.412 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_SubEventTimestamp' changed from 2022-11-16T15:56:13.000+0000 to 2022-11-16T15:57:56.000+0000
2022-11-16 15:59:59.412 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_EventTimestamp' changed from 2022-11-16T15:56:13.000+0000 to 2022-11-16T15:57:56.000+0000
2022-11-16 15:59:59.412 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_VideoLocalURL' changed from http://"Rest of line deleted for securtiy"
2022-11-16 15:59:59.412 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_VideoVPNURL' changed from https://"Rest of line deleted for securtiy"
2022-11-16 16:03:00.666 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 135674 bytes to raw type (image/jpeg): 127746 bytes
2022-11-16 16:03:00.666 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Signal' changed from 57 dBm to 60 dBm
2022-11-16 16:06:02.565 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 127746 bytes to raw type (image/jpeg): 122738 bytes
2022-11-16 16:09:03.717 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 122738 bytes to raw type (image/jpeg): 120332 bytes
2022-11-16 16:09:03.717 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Signal' changed from 60 dBm to 57 dBm
2022-11-16 16:12:04.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 120332 bytes to raw type (image/jpeg): 125154 bytes
2022-11-16 16:12:04.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Signal' changed from 57 dBm to 58 dBm
2022-11-16 16:15:06.598 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 125154 bytes to raw type (image/jpeg): 121121 bytes
2022-11-16 16:18:07.926 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 121121 bytes to raw type (image/jpeg): 121754 bytes
2022-11-16 16:18:07.926 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Signal' changed from 58 dBm to 57 dBm
2022-11-16 16:21:08.813 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_LiveSnapshot' changed from raw type (image/jpeg): 121754 bytes to raw type (image/jpeg): 111315 bytes
2022-11-16 16:21:08.813 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Doorbell_Signal' changed from 57 dBm to 58 dBm
In OH I have set the client ID and Client Secret and authenticated using
http://<your openHAB address>:8080/netatmo/connect/<_CLIENT_ID_>
This appears to work correctly I then take the redirect URL from this page and add this to the Netatmo website.
This also appears to work as I get
2022-11-16 11:48:47.030 [DEBUG] [etatmo.internal.servlet.GrantServlet] - Netatmo auth callback servlet received GET request /netatmo/connect/"Client ID".
I then try and set the webhook I enter the IP of my router and port 88 to webhook field of OH. (I have enabled port forwarding for this port) I used the syntax http://“my router IP”:88
This shows
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Registered Netatmo servlet at '/netatmo/webhook/"Client ID"'
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Setting up WebHook at Netatmo to http://"IP Address of router":88/netatmo/webhook/"Client ID"
But no data comes through.
Eventually the webhook gets blocked by Netatmo.
I tried manually filling in the webhook url on the Netatmo website but get the same result.
Not sure where this is breaking down, I would appreciate any guidance on testing this.
Update, changed port to 443 and changed the logging to TRACE and noticed that when OH is restarted I get
2022-11-17 14:18:22.133 [INFO ] [atmo.internal.servlet.WebhookServlet] - Error setting webhook : Unexpected error deserializing '<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
'
After
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Registered Netatmo servlet at '/netatmo/webhook/"Client ID"'
2022-11-16 11:48:47.136 [INFO ] [atmo.internal.servlet.WebhookServlet] - Setting up WebHook at Netatmo to http://"IP Address of router":443/netatmo/webhook/"Client ID"
Changed port to 80, no error message but no data?
Hope this helps.