Netatmo webhook based event cookbook

You can take a look at the raw webhook event sent by Netatmo by setting:

homeassistant.components.netatmo.webhook: debug

This should give some insights. The component does not treat vehicle events any different. If you can provide me with some test data I can take a closer look. (feel free to PM me here or on Discord)

Hi @cgtobi ,
This is how I found out about the missing keys in the payload, but I’ve just PMed you a fresh extract from my log. You will see that all the vignette* and snaphsot* related keys (*_id, *_key, *_url) are missing when type is vehicle.
Thanks again for your prompt reply!

Thanks @Friedrieck, I’m pretty sure that the events did contain those in the past. Not sure why they are not included right now. Unfortunately I don’t have an outdoor camera or access to a street facing camera. So, since we’re just passing the even along without removing any of that data this is not in our hands. I’ll pass that on to the Netatmo devs.

1 Like

Problem solved!
It appears that to have these vignette and snapshot data in the callback, one has to set in the Netatmo parameters at least to record the vehicle events, which I had not (I guess it is the same for the other types). It must be done in the Netatmo app or on the Netatmo website (as pictured below). Having done so, these keys are now in the netatmo_event (for type: vehicle), as expected.

1 Like

Thanks for sharing those insights.

3 posts were merged into an existing topic: Netatmo_event never fires

@gerad33

Hi, in which file do I have to put the code in? It would be great , if someone could help me :+1:

template:
# Netatmo human
  - trigger:
      - platform: event
        event_type: netatmo_event
        event_data:
          type: human
    binary_sensor:
      - name: netatmo_motion_human
        unique_id: f5b9c5eb-d2ee-46d3-ad6f-dbc9ba917ee9
        # We use auto_off, so just set it to true on each trigger
        state: "true"
        device_class: motion
        # Automatically turn off 120 seconds after the last event
        auto_off: 120
  # Netatmo vehicle
  - trigger:
      - platform: event
        event_type: netatmo_event
        event_data:
          type: vehicle
    binary_sensor:
      - name: netatmo_motion_vehicle
        unique_id: e334e36b-9405-40a8-ac32-e212c73381e2
        state: "true"
        device_class: motion
        auto_off: 120
  # Netatmo animal
  - trigger:
      - platform: event
        event_type: netatmo_event
        event_data:
          type: animal
    binary_sensor:
      - name: netatmo_motion_animal
        unique_id: 12fe2e12-2aab-4409-8fbf-e4d7144db271
        state: "true"
        device_class: motion
        auto_off: 120

You can add this in configuration.yaml.
See here for more info.

2 Likes

Thx …

The problem is, that i have the template.yaml out of configuration.yaml….

So I‘ve got an problem with the correct syntax… because in extern template.yaml is not the same linke in configuration.yaml

Maybe someone could help me to find the right way.

It looks like you don’t have the new template there but the legacy format.
That works different.

Is there a template: part in your config.yaml? If not just copy the code from my example in your config.yaml and it should work.

BTW, copying the actual code and pasting it here is working way better than posting a screen shot. The screen shot is harder to read and it doesn’t show the relevant other parts.

Ok, here is the code of my template.yaml


##############küchen Sensoren########
binary_sensors:


    combined_door_windows:
      friendly_name: "Fenster/Tür Küche"
      device_class: window
      unique_id:  combined_door_windows
      value_template: >-
        {% if is_state('binary_sensor.fenster_kuche', 'on')
           or is_state('binary_sensor.tur_kuche', 'on')
           or is_state('binary_sensor.fenster_spule', 'on') %}
           on
        {% else %}
           off
        {% endif %}


    tueren_alarmanlage:
      unique_id: tueren_alarmanlage
      friendly_name: "Türen Alarmanlage"
      device_class: door
      value_template: >-
        {% if is_state('binary_sensor.slim_multi_sensor_pir_door_temperature_illumination_door_window', 'on')
           or is_state('binary_sensor.xiaomi_hausture_contact', 'on')
           or is_state('binary_sensor.tur_kuche', 'on')
           or is_state('binary_sensor.hausture', 'on')
           or is_state('binary_sensor.tur_wohnzimmer', 'on') %}
           on
        {% else %}
           off
        {% endif %}

    fenster_alarmanlage:
      unique_id: fenster_alarmanlage
      friendly_name: "Fenster Alarmanlage"
      device_class: window
      value_template: >-
        {% if is_state('binary_sensor.az_caro_links_door_window', 'on')
           or is_state('binary_sensor.slim_multi_sensor_pir_door_temperature_illumination_door_window_2', 'on')
           or is_state('binary_sensor.slim_multi_sensor_pir_door_temperature_illumination_door_window_3', 'on')
           or is_state('binary_sensor.slim_multi_sensor_pir_door_temperature_illumination_door_window_4', 'on')
           or is_state('binary_sensor.door_window_sensor_access_control_window_door_is_open', 'on')
           or is_state('binary_sensor.fenster_spule', 'on')
           or is_state('binary_sensor.fenster_kuche', 'on') %}
           on
        {% else %}
           off
        {% endif %}


    wassermelder:
      unique_id: wassermelder
      friendly_name: "Wasser"
      device_class: moisture
      value_template: >-
        {% if is_state('binary_sensor.shellyflood_b0a2e4_flood', 'on')
           or is_state('binary_sensor.flood_sensor_water_alarm_water_leak_detected_2', 'on')
           or is_state('binary_sensor.flood_sensor_water_alarm_water_leak_detected ', 'on') %}
           on
        {% else %}
           off
        {% endif %}
        

And here a part of my configuration.yaml

template: !include template.yaml
cover: !include cover_group.yaml


So copy Paste of your code is not possible, because there is a template part… linked to template.yaml

:see_no_evil:

Then just copy my code without the template: part to your template.yaml file. I have it the same way.
So start at - trigger: and then it should work.

Thx for your support……
but I don‘t get it work. I“t Shows me a red Icon On file editor , for wrong configuration…

Above I postet my full template.yaml….
Maybe you could put your code in ….
Sitting for hours - wrong Formatation.

@gerard33 maybe you can post your template.yaml

Just trying and trying. Did not work… anyone else who can help me ?

The code I shared is from my template.yaml file. The other stuff in that file is not relevant for you.

Looking at your code from template.yaml you mix up the new and the old (legacy) way of defining templates. You have value_template in your code and that’s legacy stuff. So I doubt if your templates are actually working when you put them in the template.yaml file.

Start with commenting out all code you have in template.yaml and add my code like below:

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

If that works add your previous stuff, but again I don’t think you have those in the proper place and you should have those as part of binary_sensor:. Your code also starts with binary_sensors which is not correct either.

Please have a good look at the links I shared earlier as there all the stuff regarding the new and legacy template methods is explained. There are plenty examples there which you can use.

And if formatation is wrong that will be related to identation, you can use Visual Studio Code or an online yaml checker for that.

1 Like

Thx a lot , now it works .
:+1::+1::+1::+1::+1:

How can I choose only one cam in the code???

I Tried like this:

# Netatmo human
  - trigger:
      - platform: event
        event_type: netatmo_event
        event_data:
          type: human
          camera_id: 70:xx:xx:xx:x:a2
          device_id: 70:xx:xx:xx:x:a2

but it does not work…

The camera_id and device_id are part of another data indendation, so try the code below.
And you can also use developer tools and then events and monitor netatmo_event to show the data you are looking for.

# Netatmo human
  - trigger:
      - platform: event
        event_type: netatmo_event
        event_data:
          type: human
          data:
            camera_id: 70:xx:xx:xx:x:a2
            device_id: 70:xx:xx:xx:x:a2
2 Likes

Hi, new HA / Netatmo user.
Just one rookie question as Netatmo app does not sets presence at home quite accurately… is it possible to send to Netatmo app HA presence status?

I am planning to buy the alarm and would not like to have false triggers while home.
THX