Announcement

Collapse
No announcement yet.

Global Object across several scripts

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

    Global Object across several scripts

    Hi,

    Currently making a solution for a multiroom system with several sources and zones.
    Would need to pass on full zone and source objects with many assooiated variables beween different scripts.

    Devices are too messy for this application and Globals too simple.
    Both are not dynamic enough. No need for saving the data in the database.

    Would therefore like to publish an object that can get picked up across a HomeSeer instance.
    Some time ago, I read a stub of a topic (3 posts) that I cannot find anymore on how to solve this. It was~10 yrs old.

    I do remember that the solution was to attach the object to a HomeSeer library? Inherit?

    Anyway, would appreciate input on how this can be done and how the object should be declared.


    Many thanks,


    Bob


    #2
    Why do you think Global Variables are too simple? They are defined as an Object so you can store what you like in them?
    Jon

    Comment


      #3
      Thank you!

      What you are saying is important news for me.

      Do you mean that I can define a (public) class object with dependent variables, create a new object and save it as one Global variable?

      This would be very powerful.

      How about a Collection, such as a Hashtable of objects?

      Comment


        #4
        I've never tried a Collection (only arrays) but its should work fine

        See under Purpose here: https://help.homeseer.com/help/HS3/s...rvar_createvar
        Jon

        Comment


          #5
          Wow! Thank you very much.

          Comment


            #6
            Works nicely:
            Click image for larger version

Name:	GlobalObject.jpg
Views:	149
Size:	28.0 KB
ID:	1514782

            Comment


              #7
              Great! Problem solved!
              Jon

              Comment


                #8
                Originally posted by Bobone View Post
                Works nicely:
                Click image for larger version

Name:	GlobalObject.jpg
Views:	149
Size:	28.0 KB
ID:	1514782
                Hi Bob - Quick question. What OS is your HS4 system running on - Windows or Linux?

                Comment

                Working...
                X