In HS2 I had a little script program that would call a randomly selected event and I would like to do the same in HS3 but I am having trouble. Could you give me any help.
HS2 Script:
The old HS2 randomizing program was called "ROC-Rnd" and it had a list category called "Music" which had 9 selections in it (Music01, Music02...Music08, Music09).
I had 9 events that were called Music01, Music02...Music08, Music09 which had different playlists in them.
The random program would select one of them (Music01, Music02...Music08, Music09) and the hs.triggerevent would start that one up.
Here is the old HS2 script:
Sub Main
hs.TriggerEvent hs.plugin("ROC-Rnd").random("Music")
End Sub
HS3 Script:
The new HS3 randomizer program is called "Random" and I have sent up a list category within Random called "Music" which has 9 selections in it (Script Music01, Script Music02...Script Music08, Script Music09).
I have 9 events in an event category called "Script." The events are called Music01, Music02...Music08, Music09. Each has a different playlists in them.
If I do the following script, the music is selected correctly and plays
Sub Main
hs.TriggerEvent ("Script Music01")
End Sub
So I know that the triggerevent is able to call and execute the event "Scirpt Music0#" correctly
Now in the Random program I can select the a list (Random Phrase Category) called "Music" and the program gives me the following
Script Usage:
sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False})
Scripts Music07
Opening up the Random Phrase Category multiple times give me different "Scripts Music0#" so I know the sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False}) is give me randomly selected text back.
So I created the following script
Sub Main
sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False})
hs.TriggerEvent ("sVar")
End Sub
But instead of running I get:
Jan-03 1:59:23 PM Error Running script, script run or compile error in file: C:/Program Files (x86)/HomeSeer HS3/scripts/light_test.txt1025:Expected end of statement in line 2 More info: Expected end of statement
Can you help me with this?
Bill
Current Date/Time: 1/4/2018 10:17:45 AM
HomeSeer Version: HS3 Standard Edition 3.0.0.368
Operating System: Microsoft Windows 10 Home - Work Station
System Uptime: 1 Day 18 Hours 30 Minutes 59 Seconds
IP Address: 192.168.2.101
Number of Devices: 418
Number of Events: 284
Available Threads: 400
Enabled Plug-Ins
3.0.14.0: BLMediaPlayer
2.0.22.0: BLUPS
3.4.1.0: Caddx
3.0.0.1: Random
3.0.0.14: RCSStat
1.0.0.5: Restart
3.0.6542.35207: UltraWeatherWU3
3.0.0.40: UPBSpud
3.0.1.130: Z-Wave
HS2 Script:
The old HS2 randomizing program was called "ROC-Rnd" and it had a list category called "Music" which had 9 selections in it (Music01, Music02...Music08, Music09).
I had 9 events that were called Music01, Music02...Music08, Music09 which had different playlists in them.
The random program would select one of them (Music01, Music02...Music08, Music09) and the hs.triggerevent would start that one up.
Here is the old HS2 script:
Sub Main
hs.TriggerEvent hs.plugin("ROC-Rnd").random("Music")
End Sub
HS3 Script:
The new HS3 randomizer program is called "Random" and I have sent up a list category within Random called "Music" which has 9 selections in it (Script Music01, Script Music02...Script Music08, Script Music09).
I have 9 events in an event category called "Script." The events are called Music01, Music02...Music08, Music09. Each has a different playlists in them.
If I do the following script, the music is selected correctly and plays
Sub Main
hs.TriggerEvent ("Script Music01")
End Sub
So I know that the triggerevent is able to call and execute the event "Scirpt Music0#" correctly
Now in the Random program I can select the a list (Random Phrase Category) called "Music" and the program gives me the following
Script Usage:
sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False})
Scripts Music07
Opening up the Random Phrase Category multiple times give me different "Scripts Music0#" so I know the sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False}) is give me randomly selected text back.
So I created the following script
Sub Main
sVar = hs.PluginFunction("Random","","random", new Object(){"Music",False})
hs.TriggerEvent ("sVar")
End Sub
But instead of running I get:
Jan-03 1:59:23 PM Error Running script, script run or compile error in file: C:/Program Files (x86)/HomeSeer HS3/scripts/light_test.txt1025:Expected end of statement in line 2 More info: Expected end of statement
Can you help me with this?
Bill
Current Date/Time: 1/4/2018 10:17:45 AM
HomeSeer Version: HS3 Standard Edition 3.0.0.368
Operating System: Microsoft Windows 10 Home - Work Station
System Uptime: 1 Day 18 Hours 30 Minutes 59 Seconds
IP Address: 192.168.2.101
Number of Devices: 418
Number of Events: 284
Available Threads: 400
Enabled Plug-Ins
3.0.14.0: BLMediaPlayer
2.0.22.0: BLUPS
3.4.1.0: Caddx
3.0.0.1: Random
3.0.0.14: RCSStat
1.0.0.5: Restart
3.0.6542.35207: UltraWeatherWU3
3.0.0.40: UPBSpud
3.0.1.130: Z-Wave
Comment