{
"content": "function encodeInp(msg,topic)\n local json = require(\"json\")\n local jsonTable = json.decode(msg)\n if jsonTable.services[1].service_id == \"CO2\" then \n jsonTable.services[1].properties.current = 200 .. topic \n end\n local newJsonString = json.encode(jsonTable)\n return newJsonString \n end",
"analog_input": "{\"services\":[{\"service_id\":\"CO2\",\"properties\":{\"current\":100}},{\"service_id\":\"CO1\",\"properties\":{\"current\":98}}]}",
"topic": "device/attributes"
}