Announcement

Collapse
No announcement yet.

Script to store device setting, change setting, run event, reset to orginal

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

    Script to store device setting, change setting, run event, reset to orginal

    Does anyone have an example of a script that saves a device value, does an action and then sets the device back to the orginal setting?

    I am using the HS Russound plugin. I would like to:

    1st Script
    1) Check and save the device setting for a source (e.g. device value 1 = "Media Server")
    (it could be saved in a .ini file or other place)
    2) Change the device setting to the output from HomSeeer (6 = "Computer" )

    Event
    3) Run Event, for example HS.Speak Blah Blah

    Second Script
    4) Check orginal device setting from 1st script
    5) Return source to that device (e.g. 1 = "Media Server" )

    Thanks!
    DSteiNeuro

    HS3Pro

    MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

    Enabled Plug-Ins
    BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

    #2
    See hs.CreateVar, hs.SaveVar, etc. in the hs help file.
    Real courage is not securing your Wi-Fi network.

    Comment


      #3
      I have a couple of Russounds CAV6.6's.

      I wrote a set of scripts to do what I think you are trying to do.

      The way I handled it is to have one script that is recurring every minute that checks the source and volume of each zone and stores those settings in virtual devices.

      I have another script that starts an announcement by running through all the zones and turning those that I want to make the announcement in. I have 12 total zones in my house and I only make announcements in the zones that have had motion recently. I use a different script that determines whether a room is occupied or not based on some simple rules. I also have options for each zone whether I want to be able to use occupancy as the determining factor, or always on or always off. This is handy for when guests are staying over and I can turn off certain zones. I also have a mute all zones virtual device.

      Immediately after this script is finished which has turned on all the appropriate zones, I run my announcement script. This script uses two voices chosen at random and I have four choices for each announcement, to keep things from being too boring.

      After this, I use a final script to return all zones to their original state by referring to their settings in the virtual devices.

      It took a bit of testing to get the timing right. The Russound is touchy and sometimes wont behave. Delays have to be put in. This becomes problematic when many zones are turned on. It takes a few seconds to run through all the zones to turn them on and there can be a bit of a delay before the announcement is heard. I had to add another script that resets stuck zones to off, which can happen and really mess things up.

      If this is what you are after, I can post my scripts when I get home from work tomorrow.

      Comment


        #4
        That is pretty much what I want to do.
        If you could post your scripts, I can modify to what I need.

        Thanks
        DSteiNeuro

        HS3Pro

        MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

        Enabled Plug-Ins
        BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

        Comment


          #5
          When going through my scripts, it turns out I actually combined the announcement script and the return zones script together. I did this to deal with the problem of how to deal with multiple announcements close together. I ended up using a flag that turns on when an announcement starts and turns off when all zones return to normal. I wait till the flag turns off before starting a new announcement. Works pretty well. Let me know if you need help or have questions.

          The virtual devices hold the values as an array. First data is on or off, second is source and third is volume level.

          If you are interested in the occupancy script I can post it. It is pretty customized for my setup but the general ideas are there.

          BTW, I grew up in San Diego.

          Have fun.
          Attached Files

          Comment


            #6
            Thanks, just what I was looking for.
            DSteiNeuro

            HS3Pro

            MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

            Enabled Plug-Ins
            BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

            Comment


              #7
              Script Question

              I am feeling very lucky as I just installed my Russound 6.6cam 2 weeks ago. Needed to do exactly as you two are doing. Loaded the script and created the virtual devices. When the script goes out to grab the status I am getting an error.

              4/4/2013 9:04:29 PM - Error - Running script, script run or compile error in file: Get Russound Status.vb.txt1006:Expected ')' in line 1 More info: Expected ')'

              I am sure this is something very simple but I can't figure it out can you help?

              Comment


                #8
                Run the scriot(s) as .vb not .vb.txt
                DSteiNeuro

                HS3Pro

                MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

                Enabled Plug-Ins
                BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

                Comment

                Working...
                X