I would like to create a virtual device or button to control devices like dimmers or volume controls. However I would prefer to not use sliders. Is it possible to create something that can increase or decrease a device's value by ten points? For example my volume control is at 40%, and I want to hit a button twice to change it to 60%. How would I do this?
Announcement
Collapse
No announcement yet.
Increase or decrease device's value
Collapse
X
-
You could create an HSTouch button that runs a script like this one (untested). ('Ref' is the reference number of your device.)
Code:Public Sub Main(ByVal Parms As Object) hs.SetDeviceValueByRef(Ref, hs.DeviceValueEx(Ref) + 10) End Sub
Mike____________________________________________________________ __________________
HS3 Pro Edition 3.0.0.548, NUC i3
HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti
-
Originally posted by Uncle Michael View PostYou could create an HSTouch button that runs a script like this one (untested). ('Ref' is the reference number of your device.)
Code:Public Sub Main(ByVal Parms As Object) hs.SetDeviceValueByRef(Ref, hs.DeviceValueEx(Ref) + 10) End Sub
The reason I ask is because I have zero experience with scripts.
Comment
-
Originally posted by jogentry View PostIs it possible to accomplish the same thing with an event or with JSON? Or is it only possible through scripting?
The reason I ask is because I have zero experience with scripts.
Set Device to Variable
Set Device to another Device
http://board.homeseer.com/showthread...27#post1182227
Comment
-
Originally posted by spud View Posthave a look at the EasyTrigger plugin and the actions:
Set Device to Variable
Set Device to another Device
http://board.homeseer.com/showthread...27#post1182227
Comment
-
I'm trying to run a script to increase or decrease the value of a device (Dev Ref 9696) by using Uncle Michael's method, however when I run it I am getting an error Running script(2) &Temperature Up.vb, init error: Syntax error
Any ideas where I am going wrong? I am using HSTouch and HS4 to run the script..
Public Sub Main(ByVal Parms As Object)
hs.SetDeviceValueByRef(9696 hs.DeviceValueEx(Ref) + 1)
End Sub
Comment
-
I'm still receiving an error when trying to send this command
&hs.SetDeviceValueByRef(9704, hs.DeviceValueEx(Ref) - 1)
Running script(2) &hs.SetDeviceValueByRef(9704, hs.DeviceValueEx(Ref) - 1), init error: Invalid procedure call or argument: 'hs.SetDeviceValueByRef'
I can set the value of the device with this command, however I just want to increase/reduce the Value by one
&hs.SetDeviceValueByRef(9704, 100, True)
Any ideas?
Comment
-
Jon, you have helped me out numerous times with scripts, so I'll see if I can try this one on you (if anyone else knows of a solution please feel free to chip in)
I have created a touch screen for my central heating, hence the reason above where I needed to increase/decrease the value of a device
So I now have a House Temperature Device (Device Ref 6960) which polls every 5 minutes and sets the temperature to a Device, along with a House Target Temperature (Device 9704) which is adjustable up or down using your script above
The last link is a script where a reoccurring event takes place every 5 minutes and checks the House Temp against the Target Temperature and once it is reached it switches off the heating, and alternatively if it drops below the Target Temp can switch on the heating
Hope this makes sense..
Thanks in advance
Comment
-
Originally posted by DaveMunn View PostJon, you have helped me out numerous times with scripts, so I'll see if I can try this one on you (if anyone else knows of a solution please feel free to chip in)
I have created a touch screen for my central heating, hence the reason above where I needed to increase/decrease the value of a device
So I now have a House Temperature Device (Device Ref 6960) which polls every 5 minutes and sets the temperature to a Device, along with a House Target Temperature (Device 9704) which is adjustable up or down using your script above
The last link is a script where a reoccurring event takes place every 5 minutes and checks the House Temp against the Target Temperature and once it is reached it switches off the heating, and alternatively if it drops below the Target Temp can switch on the heating
Hope this makes sense..
Thanks in advance
https://forums.homeseer.com/forum/th...al-description
Steve
Comment
Comment