I've seen videos about having a light come on dimly at sunrise and slowly brighten over an hour or so to wake you. What's the best way to do this kind of thing in hs3?
Announcement
Collapse
No announcement yet.
Dim or brighten over time?
Collapse
X
-
Hi Tim,
I use a script for that:
Code:Sub Main(ByVal Parms as String) Dim ParmArray() as String ParmArray = Parms.tostring.split(",") dim targetDev as Double = CDbl(ParmArray(0)) 'reference ID of the device for which to increase brightness dim targetDim as Double = CDbl(ParmArray(1)) 'maximum brightness level dim rampRate as Integer = CInt(ParmArray(2)) 'ramprate in seconds dim Debug as Boolean = False Dim logName = "Sunrise Alarm Script" 'set log type for HS log Dim devValue,newdevValue As Double Dim i As Double devValue = hs.DeviceValue(targetDev) If Debug Then hs.writelog(logName,"Current:" & CStr(devValue) & " Target:" & CStr(targetDim)) If targetDim > devValue Then For i = devValue + 1 To targetDim hs.WaitEvents() hs.WaitSecs(rampRate) newdevValue = hs.DeviceValue(targetDev) If newdevValue = 0 Then 'if switch is turned off, stop script If Debug Then hs.writelog(logName,"Exited") Exit For ElseIf newdevValue < i-2 Then 'if dim value is changed on switch, stop script to stay at that dim level If Debug Then hs.writelog(logName,"Exited") Exit For End If hs.CAPIControlHandler(hs.CAPIGetSingleControl(targetDev, false, CStr(i), false, true)) If Debug Then hs.writelog(logName,CStr(i)) Next End If End Sub
Cheers
AlLast edited by sparkman; May 20, 2016, 03:51 PM.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
-
Al
Would you please post an example of the proper syntax to pass the variables to the script.?
many thanksBlair
HomeSeer: HS3 Pro | Blue-Iris 4 on Windows10Pro
| Devices: 832 | Events: 211 |
Plug-Ins: Z-Wave | RFXCOM | UltraRachio3 | Sonos
BLLAN | BLLOCK | NetCAM | Global Cache Pro | Blue-Iris4
Comment
-
Al
Would you please post an example of the proper syntax to pass the variables to the script.?
many thanksBlair
HomeSeer: HS3 Pro | Blue-Iris 4 on Windows10Pro
| Devices: 832 | Events: 211 |
Plug-Ins: Z-Wave | RFXCOM | UltraRachio3 | Sonos
BLLAN | BLLOCK | NetCAM | Global Cache Pro | Blue-Iris4
Comment
-
if the light is z-wave, and scene compatible...
just make a z-wave scene containing the one light, with a 30 minute fade time.
trigger it once, and forget it.
also, if you then take manual control of the light, it just overrides the scene, and you don't have to worry about disabling the script.
Comment
-
Originally posted by BlairG View PostAl
Would you please post an example of the proper syntax to pass the variables to the script.?
many thanks
The first number is the reference ID of the device that you want to control.
The second number is the max dim level you want the script to go to (60% in the example)
The third number is the number of seconds between each increment in dim level (30 seconds in the example)Last edited by sparkman; May 20, 2016, 03:49 PM.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Originally posted by waynehead99 View PostSo silly question, could this be modified, or does someone else have a script to have the lights adjusted for dimness depending on current outside light conditions?
IE dimmer for evening if turned on, vs day would be brighter when turned on.
Cheers
AlHS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Originally posted by S-F View PostAl, that script does nothing for me. I get no error in the log. The event runs but nothing happens. Ideas?
Sorry, forgot to mention that in my event I set the dim level to 1% first and then run the script. Can you try that and see if that works?Last edited by sparkman; May 20, 2016, 03:50 PM.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
I was thinking the same thing Wayne. Al, AGAIN this is a great script and has lot of uses. Nice work.
Originally posted by waynehead99 View PostSo silly question, could this be modified, or does someone else have a script to have the lights adjusted for dimness depending on current outside light conditions?
IE dimmer for evening if turned on, vs day would be brighter when turned on.Tom
baby steps...starting again with HS3
HS3Pro: Z-NET & 80 Z wave Devices,
HSTouch: 4 Joggler (Android Kitkat), 2 iPhone, 3 iPads
Whole House Audio: 5 SqueezePlay Jogglers w Bose Speakers
In The Works: 10 Cameras Geovision, new Adecmo/Envisalink Alarm, Arduinos
System: XP on Fanless Mini-ITX w/ SSD
Comment
-
If you are using lights with a Hue Bridge, check out some of the scenes here:
http://labs.meethue.com/
Not a lot there but there are a couple pleasant good morning scenes.
Comment
-
Originally posted by sparkman View PostSorry, forgot to mention that in my event I set the dim level to 1% first and then run the script. Can you try that and see if that works?
Yep. That did it. Thanks for this one Al. It's a lot less cumbersome than Moskus' script. Though his is great as well!Originally posted by rpradeThere is no rhyme or reason to the anarchy a defective Z-Wave device can cause
Comment
Comment