Hey there,
My smart power meter exposes OBIS Codes a MQTT middleware. But I got stuck in terms of parsing them in the mqttthing homebridge plugin.
Please help me, thanks !!
The issue is about the dots e.g. 1.7.0 in the attributes object.
topic: SHRDZM/serial/sensor
response:
{
"timestamp":"2023-04-15T18:53:55",
"32.7.0":"229.90",
"52.7.0":"227.60",
"72.7.0":"232.60",
"31.7.0":"0.68",
"51.7.0":"1.31",
"71.7.0":"2.12",
"1.7.0":"840", this is the attribute/value I need****
"2.7.0":"0",
"1.8.0":"749864",
"2.8.0":"0",
"3.8.0":"309",
"4.8.0":"226048",
"16.7.0":"840",
"uptime":"0000:01:54:05"
}
with trying "apply": "return JSON.parse(message).'1.7.0';"
I receive an error, "Exception while creating services: SyntaxError: Unexpected string"
also with every other tried characters.
Hey there, My smart power meter exposes OBIS Codes a MQTT middleware. But I got stuck in terms of parsing them in the mqttthing homebridge plugin. Please help me, thanks !!
The issue is about the dots e.g. 1.7.0 in the attributes object.
topic: SHRDZM/serial/sensor response: { "timestamp":"2023-04-15T18:53:55", "32.7.0":"229.90", "52.7.0":"227.60", "72.7.0":"232.60", "31.7.0":"0.68", "51.7.0":"1.31", "71.7.0":"2.12", "1.7.0":"840", this is the attribute/value I need**** "2.7.0":"0", "1.8.0":"749864", "2.8.0":"0", "3.8.0":"309", "4.8.0":"226048", "16.7.0":"840", "uptime":"0000:01:54:05" }
with trying "apply": "return JSON.parse(message).'1.7.0';" I receive an error, "Exception while creating services: SyntaxError: Unexpected string" also with every other tried characters.
Could you help with a clue?
THX!!