No announcement yet.

JSON and Button/Number issues

  • Filter
  • Time
  • Show
Clear All
new posts

    JSON and Button/Number issues

    Two things: (on latest version)
    1. I used to be able to send a JSON packet {Value:0,String:0 (gals)} and it entered the values into HS correctly. Since updating (can't 100% say it started on this version), I now have to delimit the values (eg. {Value:"0",String:"0 (gals)"}
    2. While debugging #1, I changed from Button mode to Number mode on the value HS device. Once changed, I can't return to Button mode and all of the VSP values are gone and can't be readded.


    For a couple updater versions now, the plugin uses Newtonsoft library for JSON decoding. It requires proper JSON syntax while the inline decoding was more forgiving. For 1. the compliant JSON syntax will be {"Value":0,"String":"0 (gals)"}
    For 2. there should be some feedback in either the HS log or the mcsMQTT Debug log when trying to enter the VSP. When I try to replicate the problem with HS4 plugin I can toggle between Control/Status UI or Number and Button and the VSP disappear and reappear on the Edit tab. They do not exist when Control/Status UI is not either Button or List.


      1. That's what I thought. Only needed to change two devices, as none of the others use JSON packets.
      2. Error reported for both Button->Number & Number->Button:
      PostBack 6 IEdit030837243SubType=2 at MCSMQTTHS4_2020.MqttAppModule.UpdateCommandType(String sSourceTopic, String sValue) at MCSMQTTHS4_2020.MQTTASP.postBackProcThread() in C:\Users\Public\Documents\TFVC\HS\MQTT\MCSMQTTHS4_2020\MQTTA SP.vb:line 2993 Line 8619 Method not found: 'Boolean HomeSeer.PluginSdk.Devices.PlugExtraData.AddNamed(System.Str ing, !!0)'.

      I think I may see the problem. I removed the VSP values, so it maybe the lack of them that keeps it from reverting. All changes from/to Button/Number give the same error, but it reverts if there are VSP entries. Doesn't if they are empty (and won't let you manually enter them)

      It's not a problem, it works as either Button or Number, so I'm good.