Quantcast
Channel: HomeSeer Message Board
Viewing all articles
Browse latest Browse all 4847

A script perhaps?

$
0
0
Here's the quick background...

I'm using the Harmony Hub plugin to control my A/V setup. I want to have a way of tracking what the current volume setting is... and since there is no way of fetching the current volume level from my A/V receiver, here's what I've done.

I set the receiver to automatically turn on to volume 30 at startup (a setting on the receiver), so I set an automatic event in HomeSeer to set the value of a virtual device called "Virtual AV Volume" to "30" whenever the receiver is turned on. This exists to resync the number each time the home theater is turned on should someone turn the dial by hand or if the value becomes slightly off.

Here's the problem -
I have two events that I trigger, one for volume up, and one for volume down which send the appropriate commands via the Harmony plugin to control the volume accordingly. I'm looking for a way to increment and decrement the value of my virtual device "Virtual AV Volume" as part of this event. It looks like you can only set exact values, and not just "one up" or "one down". So, I think I'm looking at scripting as a solution?

I don't really have experience scripting in HS3, but hobbled this together which doesn't work:

Sub Main()
Dim DevRef As Integer
DevRef = hs.GetDeviceRefByName("Virtual AV Volume")
DevRef = DevRef + 1
hs.SetDeviceValueByName("Virtual AV Volume", DevRef)
End Sub

This isn't working - thoughts, ideas, suggestions? Would I have one script for volume up, and one for volume down? Could it be separate functions within one script for volume control?

Viewing all articles
Browse latest Browse all 4847

Latest Images

Trending Articles



Latest Images