Jauge and Zwave controleur

#1

Hi,

It is surely very simple, but I search and i don't find.

I have a Zwave multisensor (temperature, humidity, ultraviolet, luminance..) that is recognize by my USB Zwave controleur on my Rasperry.

I can see it in Node-Red panel

But I don't know how can I integrate a jauge (UI - interface graphique) use with my temperature sensor.

Somebody has an exemple of node with Node-Red that i have to do ?
image

Thanks for your help

0 Likes

#2

Try to put a Json node between the Zwave-in and the gauge and on the gauge set to {{msg.payload.value}} or maybe {{msg.payload.value.value}}

Gve it a try while some expert will give you a most adequate answer maybe.

Regards

0 Likes

#3

Hi davicgu :wink:

Thanks for your reply I'll try and tell you.

Regards

0 Likes

#4

image

Something like this....

0 Likes

#5

I see..,

I'm looking for the correct json code..
I' come back soon...:wink:

0 Likes

#6

image

But it seems that my jauge dosen't work well..humm.

0 Likes

#7

I don't know what you set exactly on the function but if you try directly something like what I posted you with the screenshots will work most probably.

What you see on the debut after your function?

Regards

0 Likes

#8

I try that:


image

0 Likes

#9

So, I will see tomorrow.

I think it's just my json fonction that is not correct.

Good night and thanks for your help.

0 Likes

#10

I think I have created a inject node with your proper structure, give this a try to see if it helps to better understand or helps somehow

[{"id":"6314ec96.230b94","type":"inject","z":"fff2015f.77964","name":"","topic":"","payload":"{\"value\":{\"value\":\"7\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":600,"wires":[["32382e0c.4c5602","5b78cd5a.f54584"]]},{"id":"32382e0c.4c5602","type":"debug","z":"fff2015f.77964","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":580,"wires":[]},{"id":"57c6ff06.9f1be","type":"ui_gauge","z":"fff2015f.77964","name":"","group":"b965a9b0.dec558","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{msg.payload.value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":590,"y":660,"wires":[]},{"id":"43be6616.519048","type":"inject","z":"fff2015f.77964","name":"","topic":"","payload":"{\"value\":{\"value\":\"5\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":660,"wires":[["5b78cd5a.f54584"]]},{"id":"5b78cd5a.f54584","type":"function","z":"fff2015f.77964","name":"var","func":"var temp;\ntemp = msg.payload.value;\nmsg.payload = temp;\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":620,"wires":[["432b80a.f376a8","57c6ff06.9f1be"]]},{"id":"432b80a.f376a8","type":"debug","z":"fff2015f.77964","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":640,"y":620,"wires":[]},{"id":"b965a9b0.dec558","type":"ui_group","z":"","name":"Menu","tab":"7bce52b3.7d109c","disp":true,"width":"6","collapse":false},{"id":"7bce52b3.7d109c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

In case you should filter depending on the label, as example:

[{"id":"6314ec96.230b94","type":"inject","z":"fff2015f.77964","name":"temperature:7","topic":"","payload":"{\"value\":{\"value\":\"7\",\"label\":\"temperature\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":600,"wires":[["32382e0c.4c5602","e0aecf6c.7ba5b"]]},{"id":"32382e0c.4c5602","type":"debug","z":"fff2015f.77964","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":580,"wires":[]},{"id":"57c6ff06.9f1be","type":"ui_gauge","z":"fff2015f.77964","name":"","group":"b965a9b0.dec558","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{msg.payload.value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":590,"y":680,"wires":[]},{"id":"43be6616.519048","type":"inject","z":"fff2015f.77964","name":"temperature:5","topic":"","payload":"{\"value\":{\"value\":\"5\",\"label\":\"temperature\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":660,"wires":[["e0aecf6c.7ba5b"]]},{"id":"5b78cd5a.f54584","type":"function","z":"fff2015f.77964","name":"var","func":"var temp;\ntemp = msg.payload.value\nmsg.payload = temp;\n\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":680,"wires":[["432b80a.f376a8","57c6ff06.9f1be"]]},{"id":"432b80a.f376a8","type":"debug","z":"fff2015f.77964","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":610,"y":620,"wires":[]},{"id":"30c080e1.1688c","type":"inject","z":"fff2015f.77964","name":"humidity:50","topic":"","payload":"{\"value\":{\"value\":\"50\",\"label\":\"humidity\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":540,"wires":[["e0aecf6c.7ba5b","32382e0c.4c5602"]]},{"id":"e0aecf6c.7ba5b","type":"switch","z":"fff2015f.77964","name":"","property":"payload.value.label","propertyType":"msg","rules":[{"t":"eq","v":"temperature","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":300,"y":680,"wires":[["5b78cd5a.f54584"]]},{"id":"b965a9b0.dec558","type":"ui_group","z":"","name":"Menu","tab":"7bce52b3.7d109c","disp":true,"width":"6","collapse":false},{"id":"7bce52b3.7d109c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

This last one as you told there is a combined sensor and I guess it will give you as "value" changing the "label" but this is just an assumption....

0 Likes

#11

Thank you for that.

It help me to understund something.
Now, Inject node is ok for me.

I just have to understand how can i catch my temperature in the node.
Could you see me your json code ?
image

Thank you

0 Likes

#12

The zwave-in output is already an object, so you don't need thejson-node.

I use msg.payload.currState to get the temperature.

0 Likes

#13

Thank you for your repply,

Could you see me your node ?

0 Likes

#14

Sorry,

Could you show me your node ?

Thanks

0 Likes

#15

The zwave-inis wired to a switchto select your value-id 3-49-1-1and the output is wired to the gauge
zwave-temp

flow:

[{"id":"bcc00350.ac0e5","type":"zwave-in","z":"15e75834.6ffca8","name":"","controller":"60688918.a724a8","x":90,"y":1000,"wires":[["9c8747f.8fde4b8","a56dd9be.ae31a8","89ae4385.ff744"]]},{"id":"89ae4385.ff744","type":"switch","z":"15e75834.6ffca8","name":"node_id","property":"payload.value.value_id","propertyType":"msg","rules":[{"t":"eq","v":"3-49-1-1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":260,"y":1000,"wires":[["f5b9cf27.ff01","471903a6.cb9eec"]]},{"id":"f5b9cf27.ff01","type":"ui_gauge","z":"15e75834.6ffca8","name":"","group":"4f411fb7.c5281","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{msg.payload.currState}}","min":"10","max":"40","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":430,"y":1040,"wires":[]},{"id":"471903a6.cb9eec","type":"debug","z":"15e75834.6ffca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":450,"y":960,"wires":[]},{"id":"60688918.a724a8","type":"zwave-controller","z":"","port":"/dev/ttyACM0","driverattempts":"3","pollinterval":"10000","allowunreadyupdates":true,"networkkey":"","logging":"off"},{"id":"4f411fb7.c5281","type":"ui_group","z":"","name":"Temperature","tab":"c7bcf4f0.ee2928","disp":true,"width":"6","collapse":false},{"id":"c7bcf4f0.ee2928","type":"ui_tab","z":"","name":"Zwave","icon":"dashboard","order":6}]

Check the zwave-controller (my port is: /dev/ttyACM0)

0 Likes

#16

Thank you verry much !
But it doesn't work yet.
I copied your flow and put on ttyACM0 controler but the pb is always present.

I understund well what i have to do, but my gauge doesn't work..
It should work..
But it doesn't work yet.
I copied your flow and put on ttyACM0 controler but the pb is always present.

I understund well what i have to do, but my gauge doesn't work..
It should work..
image




image

I can see my controleur with ssh
image

Verry strange..

0 Likes

#17

First at all, if you bring any node to flow, you should carefully read the node info. Mostly it has info about basic behavior and what kind of input and output you may expect from the node.

So the gauge node expects NUMERIC value from incoming message.payload
By using debug node you can see your input. Is it a number?

Then in gauge node configuration

The name of the field says Value format and it does what it says. It formats the value. It does not search the value from the object you trying to send to gauge.

Delete everything from Value format field and be sure that your input msg.payload is number.

0 Likes

#18

??? I've tested the flow and it works perfectly for me!

0 Likes

#19

Well done !
image

I had to wait sometime.
So, now, I just have to do some modifications to have the correct temperature.

Thank again cflurin !

And thank you Hotnipi for your help and advice, it will help me

0 Likes

#20

Fine by me. It is just a recommendation to clear out the basics first.

0 Likes