Netatmo outdoor camera stops working after a couple hours

Hello,
I have two Netatmo outdoor cameras and I’ve integrated them in HA since a couple of months ago.
Everything worked (kinda) fine until 2-3 weeks ago: the two cameras work for a couple of hours, then they suddenly stop updating and they show the same scene over and over again, if I open the stream.
The problem is temporarily fixed by restarting HA, but, after a couple of hours, it presents again.

From the Netatmo app, the two cameras are working properly.

I didn’t change anything in my configuration file.

The issue firstly showed when I updated HA to version 2021.12.5 or 2021.12.6, but that might just be a coincidence, because rolling back to a version where the two cameras were working didn’t solve the problem.

Has anyone experienced the same issue and knows how to fix it?

Thank you

I suggest to restart the cameras, sometimes they stop reporting the correct remote url. We can try to dig into this but usually restarting the cameras resolves such issues. To gain insights on what is going wrong please raise the log level for the Netatmo integration to debug and check the logs for relevant messages.

Thank you for your answer: I’ll try to restart them as soon as I can (because it looks like the only way to restart them is by temporary cut the power) and I’ll let you know!

1 Like

Restarting the cameras didn’t fix the problem: they work for a couple of hours and then they keep showing the same scene over and over, even though the cameras work properly in Netatmo app.
How can I check the logs? Do I just need to go into Configuration/Settings/Logs and look for Netatmo related messages or do I have to do something particular?

Relevant is, to restart ALL cameras and after the cams are back in app to restart HA.
If you miss one it doesn’t work.

1 Like

It looks like only one of the two cameras is working properly again.
I’ve tried restarting them two times: should I try again, hoping for a different outcome?
I’m having errors in the logs such as these:

Error from stream worker: Stream ended; no additional packets

Logger: homeassistant.components.stream
Source: components/stream/__init__.py:305
Integration: Stream ([documentation](https://www.home-assistant.io/integrations/stream), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+stream%22))
First occurred: 14:34:29 (25 occurrences)
Last logged: 15:17:33

* Error from stream worker: Stream ended; no additional packets
* Error from stream worker: Error opening stream http://...
* Error from stream worker: Error opening stream https://...

HTTP error 502 Bad Gateway

Logger: libav.https
Source: components/stream/worker.py:447
First occurred: 14:35:07 (22 occurrences)
Last logged: 15:17:33

HTTP error 502 Bad Gateway
HTTP error 404 Not Found
skipping 2 segments ahead, expired from playlists

Logger: libav.hls
Source: components/stream/worker.py:349
First occurred: 14:15:44 (92 occurrences)
Last logged: 15:03:18

skipping 2 segments ahead, expired from playlists
skipping 1 segments ahead, expired from playlists
skipping 3 segments ahead, expired from playlists
skipping 4 segments ahead, expired from playlists
Failed to reload playlist 0
Setup of light platform netatmo is taking over 10 seconds.

Logger: homeassistant.components.light
Source: /usr/local/lib/python3.9/asyncio/events.py:80
Integration: Light (documentation, issues)
First occurred: 14:14:11 (1 occurrences)
Last logged: 14:14:11

Setup of light platform netatmo is taking over 10 seconds.

Which I think are all related to the Netatmo cameras (because they are the only stream component I’m using).

Please raise the log level for the Netatmo integration to DEBUG and restart HA.

1 Like

Ok, I’ve done it and, as a result, my logs are HUNDREDS of messages like:

2022-01-26 19:46:22 WARNING (stream_worker) [libav.hls] skipping n segments ahead, expired from playlists

Which appear since HA restart (i.e. when the camera is still working).

These messages are then suddenly interrupted by:

2022-01-26 20:00:01 WARNING (stream_worker) [libav.hls] keepalive request failed for 'https://prodvpn-eu-5.netatmo.net/...' with error: 'Server returned 403 Forbidden (access denied)' when parsing playlist

Then

2022-01-26 20:00:01 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-26 20:00:01 WARNING (stream_worker) [libav.hls] Failed to reload playlist 0

And a very long series of messages similar to these:

2022-01-26 20:00:11 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-26 20:00:32 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden
2022-01-26 20:01:02 WARNING (stream_worker) [libav.https] HTTP error 403 Forbidden

I also had these messages, right after the HA restart:

2022-01-26 17:10:59 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://...

2022-01-26 17:11:28 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (...)

2022-01-26 17:11:28 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered

Not sure if they’re relevant

Do you have any clue?

Do you use HA cloud link or your individual netatmo dev account?

I have my Netatmo developer account and I’ve linked my app to HA by writing

netatmo:
  client_id: my_id
  client_secret: my_secret

in configuration.yaml file.

Ok, good. How is your instance exposed to the WAN? Do you run HA behind a reverse proxy? Do you use HA cloud by Nabu Casa?

I have a DuckDNS url and port 8123 and 443 forwarded to port 8123 of my HA instance.
As I’ve said, everything worked fine for months, then suddenly stopped working (works only for a couple of hours after HA restart).

So, your primary external url listens on port 443?

My external url is
https://myurl.duckdns.org:443
while the internal is
https://myurl.duckdns.org:8123.

They used to be both ending with :8123, but, after having this problem, I’ve tried changing the external to port 443, because of the webhooks error I had in the logs.
This seems like it was not the issue, as I don’t get the failed webhook registration errors anymore, but the main problem is still there.

So, if the webhook is not registered successfully the light entity wont work. But this is not your main issue I think.

Why your cameras stop working I can’t say for sure. I’d suggest to restart all your cameras and then restart your HA instance. This has helped in some cases from my experience.

I’ve tried multiple times, without success.
Moreover, this kind of cameras don’t have (afaik) a proper way to be turned off: I have to turn off the house power and that prevents me from doing this very often.
Do you think re-installing the integration could be of any help?
Also, I’m using the picture-glance lovelace card to show my cameras, which gives me a live preview of the stream even without opening it.
Do you know if this could cause any sort of issue? (I’ve been using this card since the very beginning, when everything used to work properly, though)

I would suggest going forward step by step. Try the last point first, deactivate the picture glance card for a few days and see if something changes. If so we can dig deeper.

1 Like

I’ll try and hope for the best.
Thank you for your time, I’ll let you know how it goes.
Have a nice evening/day!

1 Like