metbosch / homebridge-http-temperature

HomeBridge HomeKit Plugin for HTTP temperature endpoints
https://www.npmjs.com/package/homebridge-http-temperature
Apache License 2.0
33 stars 18 forks source link

Help Parse JSON #18

Closed r4zr1 closed 4 years ago

r4zr1 commented 5 years ago

Hi, please help to parse multi-level JSON

{
  "system": {
    "hostname": "ESP8266",
    "uptime": 273,
    "rssi": -44,
    "freemem": 30608
  },
  "sensors": {
    "bmet": 27.3,
    "bmeh": 45.9,
    "bmep": 748.49,
    "dsw1": 21.2
  }
}

What should i place in field_name to parse bmet If I write "field_name": "bmet" or "field_name": "sensors.bmet" ERROR appears:

Error processing received information: Received value is not a number: "NaN"

metbosch commented 5 years ago

@RAZRu Currently there is no support for such format. If you can develop a solution for such cases, I will be happy to merge your code and release a new version. Otherwise, I'm a little busy and I cannot give you a date when I will release the fix.

metbosch commented 4 years ago

@RAZRu The pull request https://github.com/metbosch/homebridge-http-temperature/pull/19 added support for what you need. I'm closing the issue, let us know if you have further problems.