I have a python code which send 2 values to the same channel.
"sensor/X" and "sensor/Y", and I would like to merge them into a single Json object
{X : value of sensor/X, Y : value of sensor/Y}.
I have done this node :
[{"id":"6497f22a.847fd4","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"7843571.5b8c028","type":"debug","z":"6497f22a.847fd4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":600,"wires":[]},{"id":"400510c2.75256","type":"json","z":"6497f22a.847fd4","name":"","property":"payload","action":"","pretty":false,"x":410,"y":600,"wires":[["7843571.5b8c028"]]},{"id":"3af33205.2fc486","type":"inject","z":"6497f22a.847fd4","name":"","topic":"","payload":"{\"topic\":\"tele/Mysonoff_TH10/SENSOR\",\"payload\":\"{\\\"Time\\\":\\\"2018-12-21T16:51:09\\\",\\\"AM2301\\\":{\\\"Temperature\\\":69.4,\\\"Humidity\\\":33.9},\\\"TempUnit\\\":\\\"F\\\"}\",\"qos\":0,\"retain\":false,\"_topic\":\"tele/Mysonoff_TH10/SENSOR\",\"_msgid\":\"dae7f7bc.36e5f8\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":880,"y":1360,"wires":[[]]},{"id":"fd6553d8.f5fda","type":"mqtt in","z":"6497f22a.847fd4","name":"","topic":"sensor/#","qos":"2","datatype":"auto","broker":"2ad9c0c8.618a48","x":230,"y":600,"wires":[["400510c2.75256"]]},{"id":"2ad9c0c8.618a48","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
but it does not work.. I am probably sure that I have to write a function in javacript to do it in order to specify how the json will be written but I am kind of lost at this point..
Thank you