Announcement

Collapse
No announcement yet.

RESOLVED - Unable to parse JSON that has a dot in it...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    RESOLVED - Unable to parse JSON that has a dot in it...

    I'm trying to read some JSON from a local PurpleAir sensor.

    Some example JSON:

    {
    "pressure": 984.22,
    "pm2.5_aqi_b": 20,
    "pm1_0_cf_1_b": 2.72,
    "pm2.5_aqi": 20
    }

    Using the Sandbox:
    ${JSON(input,"pressure")} = 984.22
    ${JSON(input,"pm1_0_cf_1_b")} = 2.72
    ${JSON(input,"pm2.5_aqi")} = No Value
    ${JSON(input,"pm2.5_aqi_b")} = No Value

    Best I can tell here is that it won't parse the value because of the "." in the key name.

    Doing this in Homeseer4 itself has the same problem, I can get the values for "pressure" and "pm_1_0_cf_1_b", but not the other two with the "."

    Any suggestions?


    Thanks!
    pace

    #2
    pace

    ​​​​​​​Yes, I came to the same conclusion. As far as the JSON is a valid one the ball is in our court. We will work to make sure that the "." doesn't confuse Big5. I will let you know when ready.

    Comment


      #3
      pace

      Resolved. No need of new version. Current Big5 does work you just need to apply an escape sequence to avoid the confusion.

      Replace:
      Code:
      JSON(input,"pm2.5_aqi_b")
      By
      Code:
      JSON(input,"['pm2.5_aqi_b']")

      Comment

      Working...
      X