Switch object info to diffrent outputs

Hello
I have a output from a energy meter. I can send it to a mqtt broker. But how do i switch the object info from the meter node to diffrent messageses.


I'm intrested inn the values from:
act_pow_pos:
act_pow_neg:
react_pow_pos:
react_pow_neg:
curr_L1:
curr_L2:
curr_L3:
volt_L1:
volt_L2:
volt_L3:

[{"id":"9ed3dad7.fdea18","type":"serial in","z":"47e4bab9.41def4","name":"","serial":"9fe0bf84.66e9a","x":420,"y":320,"wires":[["d76de71a.2bc9c"]]},{"id":"d76de71a.2bc9c","type":"function","z":"47e4bab9.41def4","name":"Buffer to string","func":"msg.payload = msg.payload.toString('hex');\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":320,"wires":[["ae53b2.06107c5"]]},{"id":"ae53b2.06107c5","type":"AMS Decoder Kamstrup","z":"47e4bab9.41def4","name":"","x":780,"y":320,"wires":[["836416f7.c6bb7","62cbcaee.fee3e4","ab3051ad.d6031"]]},{"id":"836416f7.c6bb7","type":"debug","z":"47e4bab9.41def4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":320,"wires":[]},{"id":"2c4461da.c2a49e","type":"json","z":"47e4bab9.41def4","name":"","x":591.5993957519531,"y":482.0909118652344,"wires":[["a4aff834.a95c78"]]},{"id":"7c010d64.bebb94","type":"debug","z":"47e4bab9.41def4","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1190,"y":360,"wires":[]},{"id":"ab3051ad.d6031","type":"switch","z":"47e4bab9.41def4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"curr_L1","vt":"str"},{"t":"cont","v":"volt_L3","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":950,"y":380,"wires":[["7c010d64.bebb94"],["480a346d.940924"]]},{"id":"480a346d.940924","type":"debug","z":"47e4bab9.41def4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1170,"y":420,"wires":[]},{"id":"9fe0bf84.66e9a","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"2400","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"1500","bin":"bin","out":"interbyte","addchar":"","responsetimeout":"10000"}]

Thank you

I'm not sure what this Kamstrup node is or does.

Where are you seeing/getting the output you posted? (Which node)

Let's start there.

I'm guessing the next step will be the split node to split the message.
Then, we can start rearranging things to suit needs.

Hello.
the kamstrup node is a mbus/HAN port converter to get energy values from the energy meters in Norway. node-red-contrib-ams-decoder

I found out that I can use a debug output and use 'msg.payload.curr_L2' then I get the rigth value.
So the next is to get it to send values to the influx database I have.
I get errors


I have setup the node red influxdb with the same adresses and passwords as I use with InfluxDB Studio

But the logg gives me error
Apr 10 03:15:13 piUNFI Node-RED[22342]: 10 Apr 03:15:13 - [error] [influxdb in:20e9f519.e400c2] Error: Request timed out
could it be somting with IP4 vs IP6?

sorry, but any/all database programs are way WAY out of my scope of knowledge.

And I have no knowledge of this mbux/HAN thing.

Sorry. I'm still learning. (Or trying to)

I'm trying to learn to :slight_smile:
Thank you for taking the time to replay. I will post more as I get things working, Maby more people can learn from it

But how do i switch the object info from the meter node to diffrent messageses.

Instead of "switching", use a change node to "extract" the info you are interested in.

Note that most output-nodes can read the values directly in the same manner.
In the debug node you could also use payload.curr_L1 and see the output for example.

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