# Trying to access a message object but not sure how

**URL:** <https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727>\
**Category:** General\
**Created:** [20 November 2025 16:19 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727 "2025-11-20T16:19:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 16:19 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/1 "2025-11-20T16:19:59Z")

</div>

Hi all,

I'm learning Node Red for Home Assistant and want to access the value of the on: part of the object in the picture but can't figure it out,

It doesn't seem to be normal message with a msg.payload format ?

Any help much appreciated

 ![Screenshot 2025-11-20 at 4.06.30 pm](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/703b27340d30ca8c3c1f8bbe39ed2bf148f20179.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 November 2025 16:32 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/2 "2025-11-20T16:32:40Z")

</div>

> [@DaveK](#):
>
> want to access the value of the on: part of the object

Welcome to the forum @DaveK

That is `msg.on`.

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

Also I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 17:53 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/3 "2025-11-20T17:53:29Z")

</div>

Thanks,

I'll check the links again but in the past using the debug and "copy path" usually works - I copy it and paste into a switch node set to msg.on with outputs testing for true or false and it works but not this time it seems?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 November 2025 18:27 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/4 "2025-11-20T18:27:23Z")

</div>

Show is how you have configured the switch node, we are not telepathic.

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 19:13 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/5 "2025-11-20T19:13:16Z")

</div>

> [@Colin](#):
>
> Working with messages : Node-RED

My apologies, here we go...

 ![Screenshot 2025-11-20 at 7.12.38 pm](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/8288e0971f387b9fded02358cb79f278a8a8c628.png)

---

<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:** [20 November 2025 19:34 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/6 "2025-11-20T19:34:59Z")

</div>

What do you have downstream of the switch node?  
Are there other nodes expecting to see hue, bri etc as properties of msg.payload rather than msg.bri etc?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 November 2025 19:57 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/7 "2025-11-20T19:57:32Z")

</div>

You are testing for string true. Change the `az` drop down to Boolean.

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 20:06 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/8 "2025-11-20T20:06:20Z")

</div>

Hi

there isn't a boolean option ??

 ![Screenshot 2025-11-20 at 8.05.32 pm](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8a324620d09fcc4a899fae8c4a213cb214975f1d.png)

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 20:07 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/9 "2025-11-20T20:07:23Z")

</div>

Downstream at present there is just two debug nodes, in the end all i need is an off/on output

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 November 2025 20:09 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/10 "2025-11-20T20:09:14Z")

</div>

The first drop-down == has "is true" (or something similar) (I'm not at a computer to check)

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [20 November 2025 20:18 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/11 "2025-11-20T20:18:02Z")

</div>

You're correct, there is an 'is true' option, i'll set it later and try but i'm confident that will work, i'll post an update when i get back home 🙂

Thanks

---

<div class="post-metadata">

**Author:** ![DaveK](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@DaveK](https://discourse.nodered.org/u/DaveK)\
**Post date:** [21 November 2025 13:07 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/12 "2025-11-21T13:07:34Z")

</div>

Hi all,

happy to say that it works perfectly now, thanks for the help.

---

<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:** [5 December 2025 13:07 UTC](https://discourse.nodered.org/t/trying-to-access-a-message-object-but-not-sure-how/99727/13 "2025-12-05T13:07:44Z")

</div>

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