Jauge and Zwave controleur

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

Thank you again for that.

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

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

And again a bit reading first
Changing message properties

Use the range node !

Lol, i will see, thanks

1 Like

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

Example:

			<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>

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.

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

image

image

image

image

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

Thanks again for your help.

"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:

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...

[{"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"]]}]

@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

[{"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.

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 ..

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...:slight_smile: