Announcement

Collapse
No announcement yet.

Index was outside the bounds of the array. Error

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

    Index was outside the bounds of the array. Error

    Michael,

    I've recently updated my HE plugin to v.3.3.14.1 and that, or me doing something stupid in parallel, broke connection between the plugin and MakerAPI.
    In multiple attempts, it may initially connect but then, stops updating devices almost immediately.

    Reboots and Token update did not help.

    I am now on v3.4.0.2 but the problem persists.

    In hubitat_debug.txt, I get:

    2/26/2021 1:38:02 PM 0 | HubitatStart Progress 0.1, Error: Index was outside the bounds of the array.
    2/26/2021 1:41:46 PM 223629 | HubitatStart Progress 0.1, Error: Index was outside the bounds of the array.
    2/26/2021 1:48:29 PM 627334 | HubitatStart Progress 0.1, Error: Index was outside the bounds of the array.

    Simulation process seems to be doing something for 3-4 seconds but does not generate the output file.

    Would you please point me in the right direction?

    Thanks!

    #2
    You are posting in the HS4 forum, but using the HS3 plugin. Don't know if you think you are using HS4 or HS3 plugins. The error is based upon the MakerAPI that was entered and is contained in \Config\Hubitat.ini. Mine is
    Code:
    MakerURI=http://192.168.0.36/apps/api/1/devices/all?access_token=xxxxxxxxxxxxxxxxxxxxxx
    The code segment where the error was generated is

    Code:
    var uriList = _settings.MakerURI.Split('/');
    
    //Console.WriteLine(uriList[0]); // http:
    //Console.WriteLine(uriList[1]); // blank line
    //Console.WriteLine(uriList[2]); // ip address
    //Console.WriteLine(uriList[3]); // apps
    //Console.WriteLine(uriList[4]); // api
    //Console.WriteLine(uriList[5]); // maker app id
    //Console.WriteLine(uriList[6]); // devices
    //Console.WriteLine(uriList[7]); // token
    sLine = "0.1";
    _ip = uriList[2];
    _makerId = uriList[5];
    _makerToken = uriList[7].Split('?')[1];
    _path = "/" + uriList[3] + "/" + uriList[4] + "/" + uriList[5] + "/" + uriList[6] + "/" + uriList[7];
    The bottom line is that there are insufficient number of slashes (/) in this entry. Make certain you are picking up the URL for all info from MakerAPI.

    Comment


      #3
      Thanks again!

      The error was indeed in the URL. Instead of "/devices/all?access_token", the URL only contained "devices?access_token".
      I guess I copied Get All Devices link, not the Get All Devices with Full Details.

      Well, at least, I was smart enough to put a disclaimer in my original question .

      Thanks and I am sorry for posting in a wrong place.

      Comment

      Working...
      X