Announcement

Collapse
No announcement yet.

Guidance on creating root device with 3x feature devices

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

    Guidance on creating root device with 3x feature devices

    Can someone point me in the right direction on creating a root device and features from within a script?

    Is the HS3 hs.NewDeviceRef() still relevant? Do I just use that and then modify the parent/child properties and parent reference in the child devices?

    Thanks,
    Ken
    "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

    #2
    https://docs.homeseer.com/pages/view...ageId=35717355

    It says "Create, delete, and reference your devices using the functions outlined here"

    But I couldn't find how to create a device

    Comment


      #3
      Unless something changed recently the HS3 Scripting API is the only published mechanism to work with HS using scripts. Your referenced method is still relevant. The other properties of the device model that you will want to deal with are the Relationship where you specify root or child and the Association where you provide forward and backward Ref pointers to the child and parent devices.

      In essense you willl be createing four deivces using hs.NewDeviceRef. The first is the parent so remember it's Ref. The next three will be the children/features. In the Association property of each of these four, put the Ref of the parent or child. In the Relationship property put root for the first and child for the others.

      Comment


        #4
        Originally posted by Michael McSharry View Post
        Unless something changed recently the HS3 Scripting API is the only published mechanism to work with HS using scripts. <snip>
        This is far above my pay grade, but I did notice this statement that implies to my limited understanding that something major has changed:

        "In HomeSeer HS3, the high level meaning is very similar, but the functionality is different enough that NOTHING in reference to the previous versions should be re-used." Found here.

        HomeSeer Version: HS4 Pro Edition 4.2.19.0 (Windows - Running as a Service)
        Home Assistant 2024.3
        Operating System: Microsoft Windows 11 Pro - Desktop
        Z-Wave Devices via two Z-Net G3s
        Zigbee Devices via RaspBee on RPi 3b+
        WiFi Devices via Internal Router.

        Enabled Plug-Ins
        AK GoogleCalendar 4.0.4.16,AK HomeAssistant 4.0.1.23,AK SmartDevice 4.0.5.1,AK Weather 4.0.5.181,AmbientWeather 3.0.1.9,Big6 3.44.0.0,BLBackup 2.0.64.0,BLGData 3.0.55.0,BLLock 3.0.39.0,BLUPS 2.0.26.0,Device History 4.5.1.1,EasyTrigger 3.0.0.76,Harmony Hub 4.0.14.0,HSBuddy 4.51.303.0,JowiHue 4.1.4.0,LG ThinQ 4.0.26.0,ONVIF Events 1.0.0.5,SDJ-Health 3.1.1.9,TPLinkSmartHome4 2022.12.30.0,UltraCID3 3.0.6681.34300,Z-Wave 4.1.3.0

        Comment


          #5
          While there is an API used by plugins such as the link to DeviceType, I do not think a mechanism exists from a HS4 script to use it. Scripting uses the HS3 API and since HS4 also supports the HS3 API the scripts work in HS4. The examples in the Scripting section of the link provided by Alex show use of the HS3 API methods. There may be a way to reference the HS4 API libraries, but the documentation that I have seen does not provide any instances of doing it.

          Comment


            #6
            Thanks all. It looks like I've got a lot of reading to do.
            "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

            Comment


              #7
              Take a look at the file SkyLib.vb from here.

              The last function is 'AddChildDevice', which creates and links a child device. Call it with rtRef (root reference) set to zero to create the root (parent) device, then provide that reference in rtRef in subsequent calls to create child devices.

              Comment


                #8
                Thanks zwolfpack I'll take a look and let you know if I have any questions.
                "if I have seen further [than others], it is by standing on the shoulders of giants." --Sir Isaac Newton (1675)

                Comment

                Working...
                X