# Struggling to retrieve the payload from a Home Assistant event

**URL:** <https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [3 March 2026 12:25 UTC](https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489 "2026-03-03T12:25:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WJ4IoT](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wj4iot/32/98332_2.png) [@WJ4IoT](https://discourse.nodered.org/u/WJ4IoT)\
**Post date:** [3 March 2026 12:25 UTC](https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489/1 "2026-03-03T12:25:46Z")

</div>

I am struggling to extract the payload from a Home Assistant event. The event comes from a HA integration Meshcore and is multi-purpose hence the additional event\_type and the payload can be found 1 level "lower".

```auto
event_type: meshcore_raw_event
data:
  event_type: EventType.NEW_CONTACT
  payload:
    public_key: 9f8aa3c6253eae5fad7507b76d5
    type: 2
    flags: 0
    out_path_len: -1
    out_path: ""
    adv_name: WJ Solar
    last_advert: 1772540052
    adv_lat: 52.17269
    adv_lon: 4.42771
    lastmod: 1772537581
  timestamp: 1772540080.2545466
origin: LOCAL
time_fired: "2026-03-03T12:14:40.254561+00:00"
context:
  id: 01KJSSYC3YKBBPZWD96FTBG1SZ
  parent_id: null
  user_id: null

```

So I only require from the event\_type "EventType.NEW\_CONTACT" the payload but I think I got stuck with changing the default setting `$outputData("eventData").event_type`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34a3314757e52534f2523ce853b6ccbcae8da224.png)

Perhaps the solution is simple but the syntax is at the moment for me slightly abracadabra.  
Hope someone can help me with the proper syntax

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [3 March 2026 12:50 UTC](https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489/2 "2026-03-03T12:50:52Z")

</div>

If it was Node-red I would use a switch node to only pass messages where msg.data.event\_type == "EventType.NEW\_CONTACT" and a change node to move msg.data.payload to msg.payload.

Alas things work differently in Home Assistant land.

---

<div class="post-metadata">

**Author:** ![mikefila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikefila/32/95223_2.png) [@mikefila](https://discourse.nodered.org/u/mikefila)\
**Post date:** [3 March 2026 15:58 UTC](https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489/3 "2026-03-03T15:58:23Z")

</div>

Try setting the event type only with no data.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38ed3dfda4442a09c60753f38986473d3e433a87.png)

Edit: On second thought to isolate the following should do it.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d553a6a02b3b8e4e93fbf181ceb404973d0a8fbc.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [1 June 2026 15:58 UTC](https://discourse.nodered.org/t/struggling-to-retrieve-the-payload-from-a-home-assistant-event/100489/4 "2026-06-01T15:58:58Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
