Netatmo webhook based event cookbook

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

Hi,

There are several services to communicate with the Netatmo API. And one of them is to set a person away and another one to set a person at home.

Hello guys, I spent whole day with reading all the discussions here, but I am stuck, because I didn’t get any data when I start listening the “netatmo_event” and have no idea, what I am doing wrong.

I am running with latest HA with Nabucasa + Netatmo integration, where I can see all my Netatmo devices (for example camera image works great and always „streaming“ to HA).

In the configuration.yaml file I have this:

homeassistant:
  external_url: "https://myuniqueurl.ui.nabu.casa"
  internal_url: "http://homeassistant.local:8123"

I’ve also set Netatmo dev account (and created app by the tutorial) + added the Netatmo Application Credentials (Oauth and unique key). I have no Netatmo errors in log, but when I go to Developer Tools – Events and type “netatmo_event” into Listen to Events (and start listening), I didn’t get any data.

And when I go to Services in Developer Tools and select “netatmo.unregister_webhook” and click on Call Service, and then run “netatmo.register_webhook”, I got success message.

Could please anyone help me? I am going away from my home for 8 weeks (in next few days) and I will be really happy if I can set events based on data from the camera.

I’ve also created this automation just for test purpopes (sent notification when Netatmo camera detect a human move):

alias: "Netatmo Presence move test"
trigger:
  - platform: event
    event_type: netatmo_event
    event_data:
      type: human
    id: 70:ee:xx:xx:xx:xx
condition: []
action:
  - service: notify.notify
    data:
      title: It works
      message: Maybe, one time, it will…
mode: single

Tested webhooks on CO detector today with a small “special” fire

event_type: netatmo_event
data:
  type: co_detected
  data:
    user_id: *XXXXXXXXXX*
    event_type: co_detected
    device_id: *XXXXXXXXXX*
    home_id: *XXXXXXXXXX*
    home_name: Home
    camera_id: *XXXXXXXXXX*
    event_id: 63652f8ca2cb09155c0b5bfb
    sub_type: 1
    push_type: NCO-co_detected
origin: LOCAL
time_fired: "2022-11-04T15:28:12.905647+00:00"
context:
  id: 01GH1M3FK9TEP3W3X1PTVDPYA7
  parent_id: null
  user_id: null

event_type: netatmo_event
data:
  type: co_detected
  data:
    user_id: *XXXXXXXXXX*
    event_type: co_detected
    device_id: *XXXXXXXXXX*
    home_id: *XXXXXXXXXX*
    home_name: Home
    camera_id: *XXXXXXXXXX*
    event_id: 63652fbda2cb09155c0b5c00
    sub_type: 1
    push_type: NCO-co_detected
origin: LOCAL
time_fired: "2022-11-04T15:29:02.270292+00:00"
context:
  id: 01GH1M4ZSYFMM4KVZ82CDEKEV3
  parent_id: null
  user_id: null

event_type: netatmo_event
data:
  type: co_detected
  data:
    user_id: *XXXXXXXXXX*
    event_type: co_detected
    device_id: *XXXXXXXXXX*
    home_id: *XXXXXXXXXX*
    home_name: Home
    camera_id: *XXXXXXXXXX*
    event_id: 63653006a2cb09155c0b5c02
    sub_type: 2
    push_type: NCO-co_detected
origin: LOCAL
time_fired: "2022-11-04T15:30:18.204286+00:00"
context:
  id: *XXXXXXXXXX*
  parent_id: null
  user_id: null

You can trigger with for the two different steps of CO detection. 0 = clear

event_type: netatmo_event
platform: event
event_data:
  type: co_detected
  data:
    sub_type: 1

event_type: netatmo_event
platform: event
event_data:
  type: co_detected
  data:
    sub_type: 2
1 Like

smoke alarm

webhook

type: smoke
data:
  sub_type: 1

or

type: smoke
data:
  sub_type: 2
1 Like

Just thought I’d chime in here as I was struggling to get this to work.
Turns out you can implement the condition in the trigger as follows:

event_type: netatmo_event
platform: event
event_data:
  type: person
  data:
    name: person's_name

hello,

I’m sorry I’m newer in HA.
I’m interested by integrating netatmo webhook.
I’d like to stop my climate automatically when one door or window is open.

can you just tell me where I can put your code webhook. Is it in configuration.yaml or in integration’s interface?