Netatmo Presence Camera - toggle light, toggle motion detection

I’m receiving notifications with this automation and it works perfectly:

- alias: Mouvement arrière 
  trigger:
    - event_type: netatmo_event
      platform: event
      event_data:
        type: human
  condition:
    - condition: state
      entity_id: input_boolean.present
      state: 'off'
  action:
    - service: script.turn_on
      entity_id: script.person_detected

Moreover, the webhook management by Nabu Casa seems to be correct:

I guess I will have to try the event detection again; I was never able to get it to work.
Looks like you have the exact opposite issues as I do. My cameras display but I get not events.
Everything that you have in you states display seems to match mine; so I don’t see how you are getting the events from the entity.
What do you have listed on the integration for entities. I only have the cameras listed.

Maybe I am misunderstanding you. What does not work? Streaming and webhook events seemingly do work as you’ve shown.

Yes Streaming and Webhooks are working, but this trigger doesn’t:

trigger:
  - platform: event
    event_type: netatmo_event
    event_data:
      type: 'off'

To the opposite, this one is working:

  trigger:
    - event_type: netatmo_event
      platform: event
      event_data:
        type: human

I just tough it was caused by the state which is not refreshing.

I still think the triggers are a little off.

Try this:

platform: event
event_type: netatmo_event
event_data:
  data:
    event_type: human

and

platform: event
event_type: netatmo_event
event_data:
  type: 'off'

or

platform: event
event_type: netatmo_event
event_data:
  data:
    event_type: 'off'

I have some Netatmo Presence and some UniFI G4 Pro.
I have no issue to get notification for “person” using the G4 Pro , however I can’t manage to make it work with “human” for the Netatmo.

I’m using node-red

Are you sure that the events are actually triggered in HA? You gotta listen for netatmo_event not for state changes.

1 Like

That must be it, I was listening to netatmo_event but nothing was found at all.
Even though the livestream is working I just realised I have a lot of issue in the logs

2021-03-22 19:31:47 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing ‘https://api.netatmo.com/api/addwebhook

2021-03-22 19:31:44 WARNING (MainThread) [homeassistant.components.light] Platform netatmo not ready yet. Retrying in 30 seconds.

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.