www.homeseer.com    
 

Go Back   HomeSeer Message Board > Developer Support > Scripts & Plug-Ins:Development and Libraries > Script & Plug-In Development

Script & Plug-In Development Discuss scripting for HomeSeer and general VBScript assistance. Use this forum to post incomplete scripts, script snippets or code samples.

Reply
 
Thread Tools Display Modes
  #1  
Old February 21st, 2013, 09:56 PM
DSteiNeuro DSteiNeuro is offline
Seer Master
 
Join Date: Jan 2001
Location: Audrey Land (Somewhere near San Diego CA USA)
Posts: 755
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!
Reply With Quote
  #2  
Old February 21st, 2013, 10:32 PM
Wadenut's Avatar
Wadenut Wadenut is offline
OverSeer
 
Join Date: May 2007
Location: Nova Scotia, Canada
Posts: 3,344
See hs.CreateVar, hs.SaveVar, etc. in the hs help file.
__________________
Real courage is not securing your Wi-Fi network.
Reply With Quote
  #3  
Old February 22nd, 2013, 10:57 PM
prsmith777 prsmith777 is offline
Seer Master
 
Join Date: Oct 2001
Location: Colorado
Posts: 571
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.
Reply With Quote
  #4  
Old February 23rd, 2013, 04:16 AM
DSteiNeuro DSteiNeuro is offline
Seer Master
 
Join Date: Jan 2001
Location: Audrey Land (Somewhere near San Diego CA USA)
Posts: 755
That is pretty much what I want to do.
If you could post your scripts, I can modify to what I need.

Thanks
Reply With Quote
  #5  
Old February 23rd, 2013, 12:52 PM
prsmith777 prsmith777 is offline
Seer Master
 
Join Date: Oct 2001
Location: Colorado
Posts: 571
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 Images
  
Attached Files
File Type: txt Get Russound Status.vb.txt (1.3 KB, 29 views)
File Type: txt announcement.vb.txt (31.1 KB, 20 views)
File Type: txt reset stuck russound. vb.txt (784 Bytes, 18 views)
Reply With Quote
  #6  
Old February 24th, 2013, 12:58 AM
DSteiNeuro DSteiNeuro is offline
Seer Master
 
Join Date: Jan 2001
Location: Audrey Land (Somewhere near San Diego CA USA)
Posts: 755
Thumbs up

Thanks, just what I was looking for.
Reply With Quote
  #7  
Old April 4th, 2013, 09:08 PM
Tonyl Tonyl is offline
Seer
 
Join Date: Mar 2013
Location: NC
Posts: 16
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?
Reply With Quote
  #8  
Old April 4th, 2013, 09:12 PM
DSteiNeuro DSteiNeuro is offline
Seer Master
 
Join Date: Jan 2001
Location: Audrey Land (Somewhere near San Diego CA USA)
Posts: 755
Run the scriot(s) as .vb not .vb.txt
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:55 AM.


Copyright HomeSeer Technologies, LLC