# Jauge and Zwave controleur

**URL:** <https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327>\
**Category:** Dashboard\
**Created:** [16 August 2018 01:44 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327 "2018-08-16T01:44:39Z")\
**Posts on this page:** 13\
**Page:** 2

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [16 August 2018 18:45 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/21 "2018-08-16T18:45:47Z")

</div>

> [@hotNipi](#):
>
> Fine by me. It is just a recommendation to clear out the basics first.

It's ok, and you are right.  
I have to read carefully the node info.

Thank you again for that.

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [16 August 2018 18:47 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/22 "2018-08-16T18:47:13Z")

</div>

I use °C and you °F so you need to change the range in the gauge e.g. min 40 and max 100

---

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [16 August 2018 18:50 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/23 "2018-08-16T18:50:42Z")

</div>

yes, but I think there is a possibility to change/convert F to C , I will see

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [16 August 2018 18:53 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/24 "2018-08-16T18:53:57Z")

</div>

> [@florent](#):
>
> there is a possibility to change/convert F to C

And again a bit reading first  
[Changing message properties](https://nodered.org/docs/user-guide/messages)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 August 2018 18:53 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/25 "2018-08-16T18:53:59Z")

</div>

Use the range node !

---

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [16 August 2018 18:58 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/26 "2018-08-16T18:58:04Z")

</div>

Lol, i will see, thanks

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [16 August 2018 19:05 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/27 "2018-08-16T19:05:39Z")

</div>

You can do it using node-red but generally this is done in the zwave configuration of you device (CommandClass 49).

Example:

```auto
			<CommandClass id="49" name="COMMAND_CLASS_SENSOR_MULTILEVEL" version="5" innif="true">
				<Instance index="1" />
				<Value type="decimal" genre="user" instance="1" index="1" label="Temperature" units="C" read_only="true" write_only="false" verify_changes="false" poll_intensity="1" min="0" max="0" value="26.2" />
				<Value type="decimal" genre="user" instance="1" index="3" label="Luminance" units="lux" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="0" value="211" />
			</CommandClass>

```

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [16 August 2018 20:16 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/29 "2018-08-16T20:16:29Z")

</div>

And then you need to understand all the converting rules and stuff. Keep those little things managed properly as far as you can and the product will be reliable.  
Also if you are dealing with the some kind of measured environment properties, the numbers become valuable information not only for displaying them but also for calculations to make what ever kind of automation rules or similar stuff.  
The one can do math with strings. Computers like numbers do to it.

---

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [21 August 2018 02:45 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/30 "2018-08-21T02:45:09Z")

</div>

I still have a problem.  
My two jauges are ok, (temperature and humidity) but I have a wrong message in dashboard

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/00f170e0ef77da1e7653c9057eb791760c1f4cb2.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/19a1cd75f10591953e423c6a5026981f1f73ec7e.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/20efb469f9cdb63691970c8f5b31965dbddd3a1c.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c12fc30d033a8e0798d2d36f74be3a2093287816.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/095ffb6bd61aa9c468df647c57617a9cce70ba47.png)

I found somthing like that and I tryed it, but the problem still to be present. Any idea ?

> **[TypeError: Cannot read property 'temp' of undefined in Node-Red recipe](https://developer.ibm.com/answers/questions/29452/typeerror-cannot-read-property-temp-of-undefined-in-node-red-recipe/)**
>
> I am using node-red. I have started with the "registered app" recipe. I have a device sending in data using MQTT (via paho) - all that is working. My device is sending in a "temp" property with the value of: 44 ..like so:  
> var payload = {
> d:...

Thanks again for your help.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [21 August 2018 03:05 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/31 "2018-08-21T03:05:19Z")

</div>

> "TypeError: Cannot read property 'value\_id' of undefined"

Well, since the `msg.payload` is showing as an empty object `{}` there is no property called "value" -- which then returns undefined. So therefore you are trying to get the "value\_id" property from an undefined variable

You should probably add a rule to the `switch` node, before the one you already have, that checks to see if `msg.payload.value` is an empty object (i think this test is new in 0.19?), so you don't hit this error. Another option would be to test for the property using the JSONata expression:

```auto
payload.value.value_id

```

which will return a `null` if either the value or value\_id are missing (without throwing an exception).

You can try it for yourself if you import this flow...

```auto
[{"id":"fef0626a.4288c","type":"inject","z":"9cd675b0.a84be8","name":"empty","topic":"","payload":"{}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":860,"wires":[["1f25fb84.ecf504"]]},{"id":"1f25fb84.ecf504","type":"switch","z":"9cd675b0.a84be8","name":"","property":"payload.value.value_id","propertyType":"jsonata","rules":[{"t":"eq","v":"foo","vt":"str"},{"t":"null"}],"checkall":"true","repair":false,"outputs":2,"x":330,"y":880,"wires":[["6e722dc0.602604"],["2188a0b4.3b47a"]]},{"id":"6e722dc0.602604","type":"debug","z":"9cd675b0.a84be8","name":"value_id","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","x":520,"y":860,"wires":[]},{"id":"2188a0b4.3b47a","type":"debug","z":"9cd675b0.a84be8","name":"undefined","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","x":520,"y":920,"wires":[]},{"id":"201d1003.af829","type":"inject","z":"9cd675b0.a84be8","name":"valid","topic":"","payload":"{\"value\": {\"value_id\": \"foo\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":900,"wires":[["1f25fb84.ecf504"]]}]

```

---

<div class="post-metadata">

**Author:** ![cflurin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cflurin/32/29_2.png) [@cflurin](https://discourse.nodered.org/u/cflurin)\
**Post date:** [21 August 2018 08:47 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/32 "2018-08-21T08:47:44Z")

</div>

@florent  
`node-red-contrib-openzwave` is a node for zwave-devices that just pass the zwave-data in a object. It's up to you to manage the data, that means you should know the zwave protocol at least the basic and know the CC's (Command Classes).

Try this flow to get an idea about the data coming from zwave-in.

![zwave-in](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cab506c92640a8a2606b70c59e1574c8a2ee4775.png)

```auto
[{"id":"a56dd9be.ae31a8","type":"switch","z":"15e75834.6ffca8","name":"topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"zwave: node event","vt":"str"},{"t":"eq","v":"zwave: value changed","vt":"str"},{"t":"eq","v":"zwave: node ready","vt":"str"},{"t":"eq","v":"zwave: notification","vt":"str"},{"t":"eq","v":"zwave: scan complete","vt":"str"},{"t":"else"}],"checkall":"true","outputs":6,"x":310,"y":1120,"wires":[["6630b50.6a40b4c"],["eea0701d.cafe8"],["e5ddeaf8.0e6ac8"],["aa6199e1.eaf868"],["7d22bd73.897914"],["282a5df1.451f82"]]},{"id":"bcc00350.ac0e5","type":"zwave-in","z":"15e75834.6ffca8","name":"","controller":"60688918.a724a8","x":90,"y":1120,"wires":[["9c8747f.8fde4b8","a56dd9be.ae31a8","800eafb9.a8f77"]]},{"id":"eea0701d.cafe8","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1100,"wires":[]},{"id":"6630b50.6a40b4c","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1060,"wires":[]},{"id":"e5ddeaf8.0e6ac8","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1140,"wires":[]},{"id":"aa6199e1.eaf868","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1180,"wires":[]},{"id":"7d22bd73.897914","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1220,"wires":[]},{"id":"282a5df1.451f82","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":510,"y":1260,"wires":[]},{"id":"60688918.a724a8","type":"zwave-controller","z":"","port":"/dev/ttyACM0","driverattempts":"3","pollinterval":"10000","allowunreadyupdates":true,"networkkey":"","logging":"off"}]

```

E.g. you can use the topic `zwave: value changed` to continue and check for your `payload.value.value_id` and I also check `msg.payload.currState` is not null.

But as I said there are so many zwave-devices (CC) so it depends on your data.

---

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [22 August 2018 02:26 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/33 "2018-08-22T02:26:35Z")

</div>

Hi shrickus and thanks for your repply.

I tested your node and it return me a null.  
So, now I have to understund how to add a rule to the switch node.

I think, it's time for me to understund certains concepts and find some Node-Red tutorials explain to me the basics rules.

I had already saw many tutorials of Node-Red, but apparently I need more knowlwege..

I will do that before go more far ..

---

<div class="post-metadata">

**Author:** ![florent](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@florent](https://discourse.nodered.org/u/florent)\
**Post date:** [22 August 2018 02:31 UTC](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327/34 "2018-08-22T02:31:01Z")

</div>

Hi cflurin, and thank you for your help too

Same reflexion here..

I think, it's time for me to understund certains concepts and find some Node-Red tutorials explain to me the basics rules.

Beacause, by what, I begin to be lost...🙂

[Previous page](https://discourse.nodered.org/t/jauge-and-zwave-controleur/2327.md?page=1)
