Netatmo in HA 0.105

Thanks for the quick reply :+1:
I just tested it with this

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

but that didn’t work.
When I use:

trigger:
  - platform: event
    event_type: netatmo_event

so without any event_data it works fine, at least for human movement, but that should work for any movement.

Oh, sorry, you are right. outdoor is actually for when multiple things are detected in the scene, like animal and human.

I’d still suggest to use event_data + type but use multiple triggers for finer control. Like react to animals and humans only, but not cars for example. With just netatmo_event the automation would also react to smoke alarms (if you have them) for example or any other kind of event that the Netatmo API happens to send over that might not be relevant for that automation.

That’s a good suggestion indeed.
Based on the previous binary_sensors I would say the following event_data types are possible for a Presence:

  • motion -> or should we use outdoor for this now?
  • human
  • vehicle
  • animal
1 Like

Yes, here is the full (official) list: https://dev.netatmo.com/apidocumentation/security#events

In case an outdoor event is triggered, there will be the outdoor event itself but also an event for every subevent fired in HA.

Thanks. I didn’t see the outdoor event when the human trigger happened though, but using the subevents will be working fine.

1 Like

Did some testing with the triggers for the Netatmo Presence and these are really fast with the new solution you have implemented. I see an update in HA just before the Netatmo app gives me a message. Nice work :+1: and looking forward to the light implementation.

Using the events I have enabled binary sensors again which work as presence detection. If anyone is interested, here is the code.
First make input_boolean entities like this:

# Netatmo motion detection
netatmo_motion_human:
 name: Netatmo detected a person
 initial: off
 icon: mdi:motion-sensor
netatmo_motion_vehicle:
 name: Netatmo detected a car
 initial: off
 icon: mdi:car
netatmo_motion_animal:
 name: Netatmo detected an animal
 initial: off
 icon: mdi:dog

And then binary_sensor templates which use the status of the input_boolean entities:

# Netatmo camera presence detection
- platform: template
  sensors:
    netatmo_motion_human:
      friendly_name: "Netatmo beweging persoon"
      device_class: motion
      value_template: >-
        {{ is_state('input_boolean.netatmo_motion_human', 'on') }}
    netatmo_motion_vehicle:
      friendly_name: "Netatmo beweging auto"
      device_class: motion
      value_template: >-
        {{ is_state('input_boolean.netatmo_motion_vehicle', 'on') }}
    netatmo_motion_animal:
      friendly_name: "Netatmo beweging dier"
      device_class: motion
      value_template: >-
        {{ is_state('input_boolean.netatmo_motion_animal', 'on') }}

And use these automations to use the new triggers to switch on the input_booleans and switch them off after 2 minutes (you can of course change this delay):

- alias: input_boolean to on if Netatmo camera detects a person
  trigger:
    - platform: event
      event_type: netatmo_event
      event_data:
        type: human
  action:
    - service: input_boolean.turn_on
      entity_id: input_boolean.netatmo_motion_human
    - delay: '00:02:00'
    - service: input_boolean.turn_off
      entity_id: input_boolean.netatmo_motion_human
- alias: input_boolean to on if Netatmo camera detects a vehicle
  trigger:
    - platform: event
      event_type: netatmo_event
      event_data:
        type: vehicle
  action:
    - service: input_boolean.turn_on
      entity_id: input_boolean.netatmo_motion_vehicle
    - delay: '00:02:00'
    - service: input_boolean.turn_off
      entity_id: input_boolean.netatmo_motion_vehicle
- alias: input_boolean to on if Netatmo camera detects an animal
  trigger:
    - platform: event
      event_type: netatmo_event
      event_data:
        type: animal
  action:
    - service: input_boolean.turn_on
      entity_id: input_boolean.netatmo_motion_animal
    - delay: '00:02:00'
    - service: input_boolean.turn_off
      entity_id: input_boolean.netatmo_motion_animal
3 Likes

Thanks @gerard33 for the kind feedback and the great example.

1 Like

Was the “Light Implementation” dropped? I noticed it went “Stale” and then “Cancelled” :frowning:

No, but it was not the right approach and needs more work.

value is not allowed for dictionary value @ data['sensors']['netatmo_motion_animal']['device_class']. Got 'motion'

I’m getting config parse fail on this. Had to remove the device_class line, any idea why ?

EDIT: found the error, I had made a sensor, not a binary_sensor

I cannot seem to get this working. “netatmo_event” isn’t producing data.

So after a lot of poking around, I found this on netatmo my apps page:

"Your app has been webhook banned. To avoid being banned, your application must always return '200' and answer quickly to our server (< 10sec). If your application did not answer quick enough or if it returned another code more than five times in a row, your webhook will be deactivated during 24 hours. To manually unban your app, click on the button below."

Any idea why this is happening ? I tried to unban it, but still cannot get this working, netatmo_event isn’t producing data.

EDIT: Solution, my base_url was missconfigured missing the https:// in front of the url.

How do you expose your instance? Which port do you use? Any proxy?

I use hassos with “nginx proxy manager” addon.
Like I posted above the problem was base_url was configured badly.

http:
  base_url: xx.xxxx.xxx:443

I needed to change that to

http:
  base_url:  https://xx.xxxx.xxx:443

I guess I should have picked up on this earlier, because I ran into issue a while back with the IOS app sending http calls to https port and thus not working. Didn’t connect the dot’s then, but I guess it’s same issue.

Sorry, missed your edit.

HA 0.108.0
All Netatmo sensors report as unavailable.
Tried to delete integration from HA UI, deleted thrid party app on Netatmo site/App and readded netatmo integration from UI.

Now the linking is stuck on the Nabu Casa Message " Please Wait we are linking your acount"

When checking in the netatmo app it show Home assistant Cloud as a third party app again.

My all sensors also went out… but it seems to be related to Netatmo itself. I started separate thread about this: Weird Netatmo behavior (perhaps not HA related)
Could you check if symptoms you observe are the same, please?

HA 108.0
Sensors report propery to my.netatmo.com
But show unavailable in HA.
Tried to delete and readd Integration.
But Linking the Accounts hangs at Nabucasa.

Eh… not used to much to using my.netatmo.com directly… I just realized that I misread the graph. Indeed not only sensors report properly, but also graphs are OK.
So bottom line my issue might be exactly the same as yours… the difference being that I did not tired yet to delete and reenable the integration, so did not faced issue with Nabucasa…

And one more thing - I just read the main thread about 0.108 and it seems that there was something wrong with 0.108.7 regarding Nabucasa and is fixed now in 0.108.8 - perhaps you should try to update and relink now.

EDIT: just updated to 0.108.8 and no change… no Netatmo sensors available…