Announcement

Collapse
No announcement yet.

Help with JSON parsing

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

  • Help with JSON parsing

    I just flashed a Sonoff S31 and I have the binary switch working perfect. I can't figure out how to pull the rest of the data, though.

    Using MQTT.fx I can receive all of the data with the topic of "tele/sonoff1/SENSOR" and it gives me this response:

    {
    "Time" : "2018-11-22T05:00:57",
    "ENERGY" : {
    "TotalStartTime" : "2018-11-21T01:48:15",
    "Total" : 3.953,
    "Yesterday" : 1.552,
    "Today" : 2.401,
    "Period" : 28,
    "Power" : 1691,
    "ApparentPower" : 1702,
    "ReactivePower" : 199,
    "Factor" : 0.99,
    "Voltage" : 116,
    "Current" : 14.613
    }
    }

    What do I need to set the "Device Type (String)" to in order to get the "Current" reported.

    I tried various combinations of things and nothing seems to be working.

    Anybody have any ideas?

  • #2
    MQTT:sonoff1/Current

    Be sure that the device you've created has the correct options in status graphics tab (e.g. status only, 0-500, suffix A, include values, 3 dec places) and don't forget to unload and reload the plug-in for changes to take effect.

    Comment


    • #3
      Originally posted by GEN View Post
      MQTT:sonoff1/Current

      Be sure that the device you've created has the correct options in status graphics tab (e.g. status only, 0-500, suffix A, include values, 3 dec places) and don't forget to unload and reload the plug-in for changes to take effect.
      Thank you!!

      I'm thinking it was the unload/reload that fixed it. I know I tried "MQTT:sonoff1/Current" but it didn't work. As soon as I recycled the plugin it worked.

      Thank you so much for the quick feedback!

      Comment

      Working...
      X