# Filtering message from Tesla Node

**URL:** <https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871>\
**Category:** General\
**Created:** [22 August 2020 08:36 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871 "2020-08-22T08:36:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobTester](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RobTester](https://discourse.nodered.org/u/RobTester)\
**Post date:** [22 August 2020 08:36 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871/1 "2020-08-22T08:36:02Z")

</div>

Hi, I'm new to Node Red, and have a question.

How do i filter the msg.payload output from a Tesla Node. So that I have only the output "battery\_level" value that I can send with a Mqtt node to a Domoticz Device with IDX 1

msg.payload : Object  
object  
battery\_heater\_on: false  
battery\_level: 84  
battery\_range: 249.64  
charge\_current\_request: 6  
charge\_current\_request\_max: 6  
charge\_enable\_request: true  
charge\_energy\_added: 10.29  
charge\_limit\_soc: 80  
charge\_limit\_soc\_max: 100  
charge\_limit\_soc\_min: 50  
charge\_limit\_soc\_std: 90  
charge\_miles\_added\_ideal: 42

Regards Robin

---

<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:** [22 August 2020 08:42 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871/2 "2020-08-22T08:42:19Z")

</div>

Hi Robin and welcome to the forum.

On this particular question (getting values from a message) - there’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

To answer your immediate question, i would use a `change` node to `set` `msg.payload` to `msg.payload.battery_level` then connect the `change` node to an `MQTT out` node (with appropriate topic set).

> [@RobTester](#):
>
> I'm new to Node Red

As you are new to node-red - I highly recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). It is by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in less than an hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![RobTester](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RobTester](https://discourse.nodered.org/u/RobTester)\
**Post date:** [22 August 2020 09:16 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871/3 "2020-08-22T09:16:22Z")

</div>

Hi, thanks for info.

A node red flow example would be welcome

Thanks Robin

---

<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:** [22 August 2020 09:28 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871/4 "2020-08-22T09:28:10Z")

</div>

> [@RobTester](#):
>
> A node red flow example would be welcome

Hi again,

Its covered in that first link i posted under the heading [changing-message-properties](https://nodered.org/docs/user-guide/messages#changing-message-properties)

And it really is as simple as I said: Attach a `change` node to your `MQTT in`, set `msg.payload` to `msg.payload.battery_level` link that to an `MQTT out` node

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

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

TBH, this is one of the most basic and fundamentals of node-red. You would do yourself a great favour watching that playlist (and perhaps work your way through the [cookbook](https://cookbook.nodered.org/))

---

<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:** [21 October 2020 09:28 UTC](https://discourse.nodered.org/t/filtering-message-from-tesla-node/31871/5 "2020-10-21T09:28:17Z")

</div>

Closed on 21 October 2020 09:28 UTC

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