How to convert automation in Node Red - Based on event data

Hi, I’m trying to convert a HA automation into Node Red, but I’m still new and don’t know how to manage this.

This automation is working:

- id: '1590223080774'
  alias: Presence - Home based on Netatmo John
  description: ''
  trigger:
  - event_data:
      type: person
    event_type: netatmo_event
    platform: event
  condition:
  - condition: template
    value_template: '{{ trigger.event.data["data"]["name"] == ''John'' }}

      '
  action:
  - data:
      dev_id: virtual_john
      location_name: home
    service: device_tracker.see

I figured I should use the events: all node to trigger, but I can only get to the level of netatmo_event (and not the sublevel ‘person’ like in the automation.

How do I do this?

Thanks!

I used the debugger in node red and the following data comes out of the event:all trigger. I want to retrieve the “name” from this message, but I cannot get it to work. Can anybody help?

(sorry for the long code block. Don’t know how to do it otherwise).

{
    "event_type": "netatmo_event",
    "topic": "netatmo_event",
    "payload": {
        "event_type": "netatmo_event",
        "event": {
            "type": "person",
            "data": {
                "user_id": "5eb2fdfd5ae897108d36d1ad",
                "persons": [
                    {
                        "id": "0ed6bc75-639e-4137-bc3c-45cacee9f50d",
                        "face_id": "5eb304069c794a2eff6153e7",
                        "face_key": "37cac33461ee648a2d76f56690fa3e99a1058d42d5a0b3c50fe1652448ef70c4",
                        "is_known": true,
                        "face_url": "XXX"
                    }
                ],
                "event_type": "person",
                "camera_id": "70:ee:50:57:c6:25",
                "device_id": "70:ee:50:57:c6:25",
                "home_id": "5eb3026176b24679b80a3b75",
                "home_name": "Home",
                "event_id": "5ecd4df9e847893a5f3f7cdd",
                "message": "John seen by Living room",
                "push_type": "NACamera-person",
                "id": "0ed6bc75-639e-4137-bc3c-45cacee9f50d",
                "name": "John",
                "is_known": true,
                "face_url": "XXX"
            }
        }
    },
    "_msgid": "86a7eafd.fc6848"
}

Solved it myself. Was really easy actually using the switch node (and not template).