Announcement

Collapse
No announcement yet.

JSON Web API for request=pluginfunction with Plugin Z-Wave Broken in HS4?

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

    JSON Web API for request=pluginfunction with Plugin Z-Wave Broken in HS4?

    Hi,

    I'm wondering if anyone else has run into an issue with HS4 when trying to use the JSON Web API with Configuration_Get and Configuration_Set functions on the Z-Wave plugin? My environment is:
    • HS 4.1.8.0 Windows
    • Z-Wave Plugin 3.0.2.4
    (To shed some light on what I'm trying to do, I'd like the ability to control the status LED colors on my HS and Inovell switches from Node-Red, and it seems POSTing to the JSON API from Node-Red is the best approach)

    For reference, here is an example of the HTTP GET request I'm sending to my HS4 server:

    HTTP REQUEST
    http://192.168.29.149/json?request=pluginfunction&function=Configuration_Get&plugin=Z-Wave&P1=D659EA63&P2=23&P3=13

    HTTP RESPONSE (JSON)
    Code:
    {
    "Response": ""
    }
    HS LOG
    Legacy-Plugin // Z-Wave Error // Error in PluginProc: Object of type 'System.String' cannot be converted to type 'System.Byte'

    As seen in the above HS log (and it's weird this was not included in the HTTP response), there appears to be a data casting issue. I've tried numerous combinations of input parameters, different web browsers, as well as using curl and Postman to submit the request, but all fail the same way.

    I do know the JSON interface as a whole is working properly as Node-Red is working just fine, and I am able to properly execute other functions like request=controlDeviceByValue.


    Per the documentation, the request parameters are as follows:
    • P1: Z-wave home ID (string)
    • P2: Z-wave Node Number (for kicks, I tried converting int 23 to hex %17, but that did not work either)
    • P3: Z-Wave Device Parameter Number (for kicks, I tried converting int 13 to hex %D, but that did not work either)

    I also tried with the Configuration_Set function (which takes 5 parameters), but received the same errors.

    Thanks in Advance,
    ~Jeremy

    #2
    Hi Jeremy,

    I'd recommend opening a service desk ticket for this since I don't think the devs are reading forums post much at the moment.

    https://dev.homeseer.com/servicedesk...ion=portal%2F9

    Ken

    Comment


      #3
      Thanks kenm for the feedback, I appreciate it! I’ll log a bug for the HS dev team.

      Take Care,
      ~Jeremy

      Comment


        #4
        Any update on this? I'm running into the exact same thing.

        Also, you mention documentation that tells you which parameters to use - where is that?

        Comment


          #5
          I think this is it: https://docs.homeseer.com/display/HSPI/JSON+API
          HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
          Plugins: Z-Wave (via Nortek USB stick

          Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
          Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
          Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
          Insteon: 2413S Dual Band PLM
          Zigbee: zzh! CC2652R Rev A
          Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

          Comment


            #6
            Just looking around with google-fu, it looks like you need to Base64 encode Byte values to pass them via JSON API. This Z-Wave API needs the NodeID and Parameter value to be Byte values. Might give that a shot, seems to jive with the error message.


            Comment


              #7
              I know this thread is rather old but was anyone successful in getting this to work? I have tried all combinations of base64 and URL encoding of the node ID and parameter values and yet each call still gives the same Error in PluginProc: Object of type 'System.String' cannot be converted to type 'System.Byte' message in the HS log.

              This is using HS4 4.2.6.0.

              jersilver curious if you had logged a bug with Homeseer on this one and/or if you heard anything back about it? It definitely does look like some sort of type casting issue in the parameters but would be nice to know if there is some way to make it work properly...

              Comment

              Working...
              X