Hi, I am a newbie here, sorry but we all have to start somewhere
Anyway I am not a newbie with BMS (Building Management Systems) also know as BEMS (Building Energy Management Systems).
The BMS control I use (Niagara Tridium N4 controller) has a MQTT pallet which works fine, no issues with sending or receiving MQTT data via my own server MQTT broker.
So my next step is to take a LoRaWan device back into the Tridium Niagara BMS controller.
The LoRaWan device i am using takes MODBUS electric meter network signals and sends the meter values to my LoRaWAN gateway, then I currently send this data to https://www.thethingsnetwork.org/ all fine, no issues.
Now to Node-Red, I take the information for this LoRaWAN device from https://www.thethingsnetwork.org/ into Node-Red and the MQTT in node.
I then create a basic flow which currently sends the data back to the Niagara Tridium N4 controller via MQTT out node, which sends fine and i have added a edit debug node.
Here is the debug data
{"topic":"modbuspowerbar_mcf88/devices/mcf88/up","payload":"{\"app_id\":\"modbuspowerbar_mcf88\",\"dev_id\":\"mcf88\",\"hardware_serial\":\"70B3D58FF1013E38\",\"port\":2,\"counter\":641,\"confirmed\":true,\"payload_raw\":\"CxQAEAABVAaAAasAXQW2AAAAFg==\",\"payload_fields\":{\"CPU_Temp\":34,\"MCB0_Mains\":1.664,\"MCB1_Freezers\":0.427,\"MCB2_Lights\":0.093,\"MCB3_Desk_Sockets_Aircon\":1.462,\"MCB4_Sockets\":0,\"MCB5_Spare\":0.022},\"metadata\":{\"time\":\"2020-08-16T18:04:14.238780126Z\",\"frequency\":868.5,\"modulation\":\"LORA\",\"data_rate\":\"SF7BW125\",\"airtime\":71936000,\"coding_rate\":\"4/5\",\"gateways\":[{\"gtw_id\":\"eui-60c5a8fffe766204\",\"timestamp\":1490131788,\"time\":\"\",\"channel\":7,\"rssi\":-43,\"snr\":8.5,\"rf_chain\":0,\"latitude\":51.88843,\"longitude\":-0.53416,\"altitude\":148}],\"latitude\":51.888424,\"longitude\":-0.53416693,\"altitude\":148,\"location_source\":\"registry\"}}","qos":0,"retain":false,"_msgid":"27e905e3.3f2b4a"}
Now what i would like to do is separate the payload_fields, so i can send each individual field to the Niagara Tridium controller.
{\"CPU_Temp\":34,\"MCB0_Mains\":1.664,\"MCB1_Freezers\":0.427,\"MCB2_Lights\":0.093,\"MCB3_Desk_Sockets_Aircon\":1.462,\"MCB4_Sockets\":0,\"MCB5_Spare\":0.022}
I have looked through the forum, and see detailed information on the topic using a change node and a switch node, but not getting very far, so any help would be appreciated.
Below is the current input into the Tridium Niagara controller, which is a long string input.
Any ideas for the best way to extract the 7 fields in the payload ?
Thanks for reading.