Announcement

Collapse
No announcement yet.

Parent device is not set for version >.435

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

    Parent device is not set for version >.435

    I've been using the same code for years for creating root/parent devices and child devices.

    When I create the root, I also do:
    Code:
            'Setting it as a root device
            rootDevice.Relationship(hs) = HomeSeerAPI.Enums.eRelationship.Parent_Root
    When I then create child devices I do (for each child):
    Code:
            childDevice.Relationship(hs) = HomeSeerAPI.Enums.eRelationship.Child
            rootDevice.AssociatedDevice_Add(hs, childDevice.Ref(hs))
    I had better luck by also adding this:
    Code:
            childDevice.AssociatedDevice_ClearAll(hs)
            childDevice.AssociatedDevice_Add(hs, rootDevice.Ref(hs))
    ... but WHY has this started to be a problem?!
    ... and what am I doing different from others?


    The user can fix it by deleting all devices, restart HomeSeer, and then set it up again. My code stays the same, but the restart makes a difference for some reason.
    HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
    Running on Windows 10 (64) virtualized
    on ESXi (Fujitsu Primergy TX150 S8).
    WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

    Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

    #2
    Race condition I think. If creating devices at the same better to keep the ref returned and use it for the parent instead of calling each time to get it. If not try adding a savedevicesevents after you create and configure each new device.

    Comment


      #3
      I'll try that, and see what I get. I do actually use the ref directly instead of calling .Ref(hs).

      I'll also try to spam the code with hs.SaveDevicesEvents().
      HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
      Running on Windows 10 (64) virtualized
      on ESXi (Fujitsu Primergy TX150 S8).
      WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

      Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

      Comment


        #4
        Also you don’t need to provide hs in every call. That forces a round trip to the server. Using null reads from the local cache. Since you are creating the devices, no chance the cache is out of date.

        Comment


          #5
          Originally posted by bsobel View Post
          Also you don’t need to provide hs in every call. That forces a round trip to the server. Using null reads from the local cache. Since you are creating the devices, no chance the cache is out of date.
          Hmmm... that might on to something. I need to check that.

          I've always wondered why something worsk with just null/Nothing and others needs hs reference.
          HSPro 3.0.0.458, Z-NET with Z-wave plugin 3.0.1.190, RFXCOM + 2x RFXtrx433E, HSTouch, Squeezebox plugin, iTach IP/WF2IR & GC-100-6 with UltraGCIR, BLDenon, NetcamStudio, Jon00s Webpage builder, Harmony Hub plugin, SCSIP (with FreePBX), Arduino plugin, IFTTT, Pushalot plugin, Device History plugin.
          Running on Windows 10 (64) virtualized
          on ESXi (Fujitsu Primergy TX150 S8).
          WinSeer (for Win10) - TextSeer - FitbitSeer - HSPI_MoskusSample

          Are you Norwegian (or Scandinavian) and getting started with HomeSeer? Read the "HomeSeer School"!

          Comment

          Working...
          X