Netatmo Presence Camera - toggle light, toggle motion detection

Yeah, the livestream uses a different connection than the webhook. To use events you have to expose your instance in some way.

thank you, I will look into that

1 Like

Hi guys,

I have an issue when trying to turn on the floodlight on Netatmo presence.
It looks like it is correctly setup but when I try to turn it on I get this

Logger: pyatmo.helpers
Source: /usr/local/lib/python3.8/site-packages/pyatmo/camera.py:545 
First occurred: 19:19:02 (5 occurrences) 
Last logged: 19:21:18

400 - Bad request - Invalid device_id, 70:ee:50:28:1d:22 (21) when accessing 'https://api.netatmo.com/api/setstate'

any suggestion?

Mine disappeared yesterday for a whole day then come back today.
Probably an issue on the Netatmo server side ?

Mmm don’t think so: it never worked for me.

I read above to make sure “webhook is working”: how to check that?

Look at Configuration > Home Assistant Cloud, scroll down and you can see the list of all webhooks HA is listening to. When you install the Netatmo integration, there should be a webhook Netatmo created automatically.
But AFAIK webhook should not be used when you issue a command to the camera, but rather to receive a message from the camera. Your issue seems to come from something else than webhook. Did you try to uninstall and reinstall the integration ?

No, didn’t try to remove and re-add the integration mainly because I have a lot of Netatmo sensors and automation relying on them so I was a bit reluctant.

Will remove and re-add change the names of my entities?

Cameras did not working at all. Weather sensors did. I removed integration. Readded it. Now only weather entities show up. All Cameras gone.

When cameras don’t work the problem often is because HA Cloud Link is used instead of an individual Netatmo dev account configured in your configuration.yaml.

Normally it does not change, but it’s just my experience once.

Agreed, I used the cloud link installation. Sorry. I removed the integration, restarted HA. It finds the integration. I install it again. Only the weather entities. Not the cameras are found. I am lost. Any idea how I can debug this?

For starters, activate the debug logging for the netatmo integration and check the logs after a restart.

Sure, you are welcome.

2021-04-19 20:46:18 ERROR (MainThread) [homeassistant.components.camera] Error while setting up netatmo platform for camera
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 53, in async_setup_entry
    await data_handler.register_data_class(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 166, in register_data_class
    await self.async_fetch_data(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 129, in async_fetch_data
    self.data[data_class_entry] = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 91, in __init__
    self.update_camera_urls(camera_id)
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 164, in update_camera_urls
    temp_local_url = check_url(vpn_url)
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 154, in check_url
    resp = self.auth.post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 172, in post_request
    f"{resp.status_code} - "
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This does not include any debug log infos. Can you check a few lines before the error?

Tobi, do you know the term “rubber duck debugging”. This is what we did. Its works now. Dont ask me why. Thanks - as always - for being so dedicated and responsive. Apologies.

1 Like

I’ve heard of camera related issues from others. Could have been caused by the Netatmo backend.

2 Likes

The switch for the light is greyed out. What can I do?

Video is visible.

When the camera works and the switch is greyed out the reason usually is that the webhook is not established.

1 Like

A post was split to a new topic: Netatmo webhook not workig

how I can see Netatmo motion detection entity in HA?