All the configs I made in the add-ons via the UI I posted above.
I don’t know this add-on at all, I just can tell that webhooks do work with an nginx reverse proxy.
Your external url looks weird. Try dropping the www.
.
Also the trusted proxy IP is wrong. It most certainly is not 127.0.0.1
but the IP or FQDN of the proxy container.
I thought as the reverse proxy is running on the same machine as the hass.io, I put there the localhost address.
Sorry for delayed feedback, I am currently not at home.
I will check when I get the chance and report back.
Nicely spotted! From what I could do from away at least the webhook registered successfully and the light is now visible in the netatmo integration.
I do not yet see the events under the development tools, but I cannot fire some to check.
Thank you. I guess I am at least one step closer!
You need to listen for netatmo_event
.
Okay, being back home. I do not yet get any netatmo_events in Home Assistant.
I guess the correction of the external URL in the Home Assistant settings allowed the webhook registration to be successfull. I have copied in the log I am now getting.
2020-10-18 19:46:06 INFO (MainThread) [homeassistant.components.netatmo.config_flow] Successfully authenticated
2020-10-18 19:46:07 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://myexternaladdress.duckdns.org/api/webhook/'somehexstring'
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeData added
2020-10-18 19:46:07 WARNING (MainThread) [homeassistant.components.light] Platform netatmo not ready yet. Retrying in 30 seconds.
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No weather station available
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class WeatherStationData added
2020-10-18 19:46:07 WARNING (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from untrusted proxy 172.30.33.3, headers not processed
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.webhook] Got webhook data: {'user_id': 'someotherhexvalues', 'user': {'id': 'someotherhexvalues', 'email': '[email protected]'}, 'push_type': 'webhook_activation'}
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.webhook] None: {'user_id': 'someotherhexvalues', 'user': {'id': 'someotherhexvalues', 'email': '[email protected]'}, 'push_type': 'webhook_activation'}
2020-10-18 19:46:07 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook successfully registered
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No weather station available
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeCoachData added
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class CameraData added
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.camera] Adding camera 70:ee:50:27:c5:10 Haustür
2020-10-18 19:46:07 DEBUG (MainThread) [homeassistant.components.netatmo.netatmo_entity_base] New client camera.netatmo_haustur
2020-10-18 19:46:37 DEBUG (MainThread) [homeassistant.components.netatmo.light] Adding camera light 70:ee:50:27:c5:10 Haustür
2020-10-18 19:46:37 DEBUG (MainThread) [homeassistant.components.netatmo.netatmo_entity_base] New client light.netatmo_haustur
I got rid of the untrusted proxy warning. It seems to be the internal IP address hass.io uses for add-ons. so this must be the IP for my reverse proxy, which I have added to the configuration.yaml. However no further changes.
According to your logs you are obviously receiving webhook events.
At least the registration seemed to be working.
netatmo_events however is not listed in the developer tools.
And trying to listen to
netatmo_event
or netatmo_human
is unsuccessful.At least it does not receive any events, even though I am in front of the camera triggering a notification on the Netatmo app on my smartphone.
If you’re receiving the event about the registration being successful and the webhook is not being banned by Netatmo afterwards, I don’t see why you shouldn’t receive events when listening for them.
{'user_id': 'someotherhexvalues', 'user': {'id': 'someotherhexvalues', 'email': '[email protected]'}, 'push_type': 'webhook_activation'}
This is proof that the registration has been successful and the first actual webhook event.
You can listen for netatmo_event
down in the events panel:
Yes I know, but neither is the the netatmo_event
listed under the available events, nor is it recording it, when listening to it. Any idea what to look for, when monitoring the network traffic?
I am thinking about monitoring a snippet using wireshark to then analyse if any communication of that webhook/netatmo_event is visible on my local network.
A data recording on my router was not very helpful to me at least. I was able to find out that the camera contacted netatmo, when a person was detected, but I couldn’t make sense about content as it is probably all secured. The same is for the communication towards the home assistant. Me personally couldn’t make sense of the content send to it. So I have no idea, if the event was send by the netatmo dev app and if it was received by home assistant.
I only see within home assistant, that no event is shown. The webhook seems to be registered correctly now. The dev app is not banning it anymore.
Is there by any chance an idea left… I don’t know what to check…
On the netatmo side, do I need to enter anything in the URL area? The integration guide did not specify this, however it looks like I cannot only set a webhook URL, I need to specify both if they need values…
@cgtobi I much appreciate your support. Have you got any other clue, why I do not receive netatmo_events
?
There is nothing to be specified here it will be generatet by HA. Other than that I have no idea what’s causing the issue.
You have to listen for netatmo_event
, not netatmo_events
.
Yes, but neither are they listed under the event pane, not do I receive any when listening.
Since you’re obviously receiving webhook events and HA is processing them, I don’t know what’s going wrong here.
Looking through your cookbook thread I found some automations to set input boolean helpers based on motion detected by netatmo presence.
I have created the exacte same helper input boolean, copied the sensor definition into my sensor.yaml that is included in my configuration and added the automation.
When checking my configuration I am receiving an error message. Maybe this is also the reason I am not seeing the events in general.
Invalid config for [sensor.template]: value is not allowed for dictionary value @ data['sensors']['netatmo_motion_animal']['device_class']. Got 'motion'
value is not allowed for dictionary value @ data['sensors']['netatmo_motion_human']['device_class']. Got 'motion'
value is not allowed for dictionary value @ data['sensors']['netatmo_motion_vehicle']['device_class']. Got 'motion'. (See ?, line ?).
Any idea what this could be and how to resolve this? Home Assistant seems to have an issue with the device_class
definition being motion
EDIT: The motion device_class
is of course a binary sensor and not a sensor -.-
EDIT2: Also these automations triggered by netatmo_event
are not triggered
After setting both, the redirect URI and the webhook URI to my external homeassistant URL (i.e. https://myexternaladdress.duckdns.org) and calling the netatmo.unregister_webhook
/ netatmo.register_webhook
the events are finally listed in home assistant!
Interesting that this helped in your case. Normally this should not be necessary.