Announcement

Collapse
No announcement yet.

IncrementLight for HS3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moskus
    replied
    Originally posted by S-F View Post
    Nice!

    I'm assuming that if I change Value = 100 to Value = 30 it will stop at 30%? 100% volume is pretty loud!
    Yes, it should.

    Leave a comment:


  • S-F
    replied
    Nice!

    I'm assuming that if I change Value = 100 to Value = 30 it will stop at 30%? 100% volume is pretty loud!

    Leave a comment:


  • Moskus
    replied
    OK, try this. It now stops if the value = 100, and is increasing the volume by 2 instead of 1.

    Code:
        Public Sub Main(ByVal _deviceRef As Object)
            Dim deviceRef As Integer = Integer.Parse(_deviceRef)
            Dim deviceValue As Integer = hs.DeviceValue(deviceRef)
    
            'Exit if the device is already at maximum, i.e. Status =  "On" or Value = 100
            If hs.CAPIGetStatus(deviceRef).Value = 100 Then Exit Sub
    
            'Find the correct CAPI control to execute. I really miss Linq!!!
            For Each cc As HomeSeerAPI.CAPIControl In hs.CAPIGetControl(deviceRef)
                If cc.ControlValue = (deviceValue + 2) Then
    
                    'Set the correct dim level
                    hs.CAPIControlHandler(cc)
    
                    'We're done, so let's exit!
                    Exit Sub
                End If
            Next
        End Sub

    Leave a comment:


  • S-F
    replied
    Here you go!
    Attached Files

    Leave a comment:


  • Moskus
    replied
    Post the next tab too (the "Status Graphics" tab), then I can see what needs to be changed.

    Leave a comment:


  • S-F
    replied
    Originally posted by Moskus View Post
    I have no idea. But you can check that by looking at the ValueStatus'es for the device.

    Can you post a screenshot?

    I thing I've found the issue. The plugin volume can only be set to even numbers. The amp has volume settings from 1 to 50. Can the script be modified to increment the device by 2 instead of 1?

    Attached is a screenshot of the advanced tab for one of the volume devices.
    Attached Files

    Leave a comment:


  • Moskus
    replied
    Originally posted by S-F View Post
    Should this be able to control a BLRussound volume device? I'm trying to get this to slowly increase the volume of a Russound zone as well as a light.
    I have no idea. But you can check that by looking at the ValueStatus'es for the device.

    Can you post a screenshot?

    Leave a comment:


  • S-F
    replied
    Should this be able to control a BLRussound volume device? I'm trying to get this to slowly increase the volume of a Russound zone as well as a light.

    Leave a comment:


  • LeoS
    replied
    Originally posted by Moskus View Post
    No, it will only send a command each XX seconds.
    Good to hear that, thanks

    Leave a comment:


  • Moskus
    replied
    Originally posted by LeoS View Post
    Will this script flood the zwave bus, so to speak; making all other zwave transmissions and receptions paused until it's done?
    No, it will only send a command each XX seconds.

    Leave a comment:


  • LeoS
    replied
    Will this script flood the zwave bus, so to speak; making all other zwave transmissions and receptions paused until it's done?

    Leave a comment:


  • Gogs
    replied
    Thanks for quick reply.

    I am looking for a way to ramp X10 and z-wave to a desired level, say 60%, rather than them just coming straight on and off.

    Soft start if you like.

    Leave a comment:


  • Moskus
    replied
    Originally posted by Gogs View Post
    I understand it is called from parameters, is it possible to set the perimeter to the dim level rather than just on or off?
    I'm not sure what you are asking.

    The parameter here is the device ID for the device to be controlled. It basically just adds 1 to the current devicevalue, finds the correct CAPI control, and runs that so that the command is actually executed.

    How fast the light will turn brighter is therefore just dependent on how often you execute the script. If you run it every second, it takes 1 minute and 40 seconds for a light to go from Off to On. If you run it every 18 seconds, it takes 30 minutes.

    Leave a comment:


  • Gogs
    replied
    OK, this script looks like it will do what I am trying to do, that is, soft start and soft off z-wave dimmable devices.

    I understand it is called from parameters, is it possible to set the perimeter to the dim level rather than just on or off?

    Could you post and example event?

    Thanks,

    Leave a comment:


  • Moskus
    started a topic IncrementLight for HS3

    IncrementLight for HS3

    This script will just take the current dim level for a device, and then add +1 to it. You need to call the sub Main, of course, and then use the device reference of the device you want to control as the parameter.

    Code:
        Public Sub Main(ByVal _deviceRef As Object)
            Dim deviceRef As Integer = Integer.Parse(_deviceRef)
            Dim deviceValue As Integer = hs.DeviceValue(deviceRef)
    
            'Exit if the device is already at maximum, i.e. "On"
            If hs.CAPIGetStatus(deviceRef).Status = "On" Then Exit Sub
    
            'Find the correct CAPI control to execute. I really miss Linq!!!
            For Each cc As HomeSeerAPI.CAPIControl In hs.CAPIGetControl(deviceRef)
                If cc.ControlValue = (deviceValue + 1) Then
    
                    'Set the correct dim level
                    hs.CAPIControlHandler(cc)
    
                    'We're done, so let's exit!
                    Exit Sub
                End If
            Next
        End Sub
Working...
X