Announcement

Collapse
No announcement yet.

How to set up a device as a variable

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

    How to set up a device as a variable

    Hi guys,

    I'm basically new to Homeseer and like a lot of people with technical backgrounds I was expecting variables. Heck stamp controllers have variables!

    Anyway, I've set up a "device", and made it "dimmable" but it's still only allowing me on/off. Without jumping through too many hoops, how do I:

    * Support values of let's say 0-255 (or am I silly asking for strings?)?
    * Make that settable from the web interface (preferably without having to do something like "Immediate Script Command")?
    * Make the value visible on the web interface?

    I'm fine that most everything I need will require scripting but I need some basic tools....

    Thanks for info or pointers!

    Tahl

    #2
    Have you looked at this thread:

    https://forums.homeseer.com/showthread.php?t=181973

    I tried to cover how to create and modify virtual devices to do individual values, rang values or a combination of both. You can control the devices with the web interface, HSTouch, voice commands and a number of other user interfaces.

    I find that most everything I need to do can be done with events. I probably only run a small handful of scripts, including Jon00's excellent scripts.
    HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

    Comment


      #3
      Curious....

      The lack of explicit support for variables -- something so basic to computer science -- is surprising to me. I couldn't even find anything suitable on a forum search! Hope the rest of Homeseer isn't that, well, odd.

      Thanks @rprade for the response!

      Tahl

      Comment


        #4
        Originally posted by tahl View Post
        The lack of explicit support for variables -- something so basic to computer science -- is surprising to me. I couldn't even find anything suitable on a forum search! Hope the rest of Homeseer isn't that, well, odd.

        Thanks @rprade for the response!

        Tahl
        You're welcome. This is not computer science, this is a home automation controller. Virtual Devices are durable global variables. You can declare a global variable if you desire, but they are not durable, they will have to be recreated when HomeSeer is restarted. Since Virtual Devices are connected to the database they are durable and the variable as well as the stored value will survive a restart.

        If you think about it, a global variable in any other language is volitile, unless you specifically write it out to a file before shutting down the program. I think a Virtual Device is actually a better alternative because it automatically is durable and it's value can be readily be viewed in the Device Manager. I have hundreds of Virtual Devices used as global variables, they are organized in special locations and hidden.

        If you want to use global variables, there is explicit support. There are 4 functions to create, delete, read and write as described here:

        https://help.homeseer.com/help/HS3/s...obal_variables

        Since you stated you plan to use scripting for most everything you plan to do, the scripting documentation would be a better resource than searching the forums.

        If you are expecting HomeSeer which is based specifically on a triggered event engine to look like a "basic" programming language, it will definitely seem odd. I find HomeSeer to be very capable, manageable and even logical, only if you treat it as a different language and learn it.
        Last edited by randy; August 16, 2017, 11:22 AM.
        HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

        Comment

        Working...
        X