Announcement

Collapse
No announcement yet.

SA US28-40 doesn't know state of light when toggling?

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

    #16
    Originally posted by anogee View Post
    JKaplan:

    There is actually another solution, but it never has been documented that I've seen, and few really understand it. This works for ALL button controls that I've seen, and NOT just HAI buttons with lighted buttons.

    If you want a "real" toggle for a button, select custom for your button in the transmit tab, and you will see TWO rows of controls appear. Ever wonder what that second row does? The first row is the action to be performed when the link is DEACTIVATED. The second row is when its ACTIVATED. Lighted button or not, the switch does keep the state of the link and can perform differently if the link is active or not.

    So how do you use it? On the first row, for a single tap, set it to "Activate Link" on the row below it, select "Deactivate Link" Now, a single tap to that button will always toggle it, even if another controller set or deactivated the link. And no Homeseer required and no double tapping. It works because the SWITCH decides if it should activate or deactivate based on the actual state of the link.

    I use this technique on several controllers, with and without lighted buttons, and it works great on both.

    Maybe someday they will even document this feature.

    Allen
    Could you, or someone here, clarify something for me. I am not clear on how the custom definition with two rows for each button works. (US2-40 pushbuttons).

    If I understand your explanation, the first row is used based upon the current status of the assigned link currently being DEACTIVATED, and the second row if the link is currently ACTIVATED, and this is so even if the link status is changed by some other switch (or Homeseer) activating or deactivating that link.

    I thought that the function of the two rows were just simply alternating. For successive pushes, Row1/row2/row1/row2 etc. So if you set row1 to ACTIVATE the link and row2 to DEACTIVATE the link, successive presses will send out alternating ACTIVATE/DEACTIVATE, even if some other switch sent ACTIVATE or DEACTIVATE for the same link.

    Here is what I am experiencing. I have 2 separate switches, each with a button that has row1/row2 set as Activate/Deactivate the same link to a light. Multiple presses of button1 toggles the light properly. But, if I press button2 to toggle the light, I then have to press button1 twice to toggle the light. In looking at captured events from homeseer, it appears to me that the button is alternating activate/deactivate no matter what transpires with the same link between button presses.

    Do I perhaps have the buttons defined incorrectly?

    Any clarification would help.

    tenholde
    tenholde

    Comment


      #17
      Originally posted by Oman View Post
      You can use HomeSeer as a helper to try to sync the buttons. This is how I do it. When HomeSeer sees the light go ON but the link that normally controls the light from the controller is not ACTIVATE, then I transmit an activate from HomeSeer. The same is true for DEACTIVATE and OFF.

      This doesn't work for dimming though but I only use dimming from Palmpads. In fact I think you might be happier using a palmpad rather than a US2-40, I know we were. Each button on the PalmPad controls a different event in HomeSeer. It is just as fast as direct UPB.

      Jon
      Do you know if this works the same for US2-40 switches with push button face plates? My experience seems to be that the buttons just alternate between the two defined link actions, and does not react to link commands from other switches/Homeseer.

      I'm wondering if I have the switches defined incorrectly?

      tenholde
      tenholde

      Comment


        #18
        I finally have a script that works that handles when my UPB pushbuttons get out of sync.

        Here is the problem. SA toggle push buttons work as follows. Each time you push the button it alternates between sending the first defined link command in UPStart and the second defined link command. Usually I define them as Snap On, and Snap Off for the device to control. As long as the only way to change the state of the controlled device is through this single toggle push button, then life is good. If, however, the device's state is changed elsewhere (by another button or HomeSeer), then the toggle push button will get out of sync. Seeing it is only alternating between Snap On and Snap Off, if the Device's state changes between button pushes, it will not work and require the button to be pushed again. The toggle button will send, for example, Snap On even if the light is now On from another action, and nothing happens. To get it to Snap Off, the button must be pushed again.

        The following script is run from an Event that triggers when the Link transmitted by the toggle push button changes value. It should be defined as priority event, do not queue, and runs the script with two parameters (separated by "|"): Parm1: DeviceCode for the transmitted Link and Parm2: DeviceCode for the Device targeted by the link. The Entry Point is "Toggle", the Script Name is "ToggleHelper".

        Code:
        Public Sub Toggle(ByVal Parms As String)
                ''
                '' Toggle Push Button Helper Script
                ''
                ''   Toggles Device Even if Push Button State is Out of Sync
                ''
                Dim p() As String, i As Integer
                Dim LinkValue, DevStatus As Integer
        
                '' Get Parms
                p = Parms.Split("|")
                LinkValue = hs.DeviceValue(p(0))
                DevStatus = hs.DeviceStatus(p(1))
                '' Determine What the Link is Trying to Do
                Select Case LinkValue
                    Case 0
                        '' UPB Value Change to Force 'Value Change Events'
                        '' Ignore it
                    Case 3
                        '' Link is trying to Activate the Device
                        If DevStatus = 2 Then
                            '' Device is Already On, so turn it Off
                            i = 0
                            hs.WaitSecs(1)
                            Do While hs.DeviceStatus(p(1)) <> 3
                                '' Keep trying until it is really OFF
                                i = i + 1
                                hs.ExecX10(p(1), "Off", , , True)
                                hs.WaitSecs(1)
                            Loop
                            hs.WriteLog("ForceToggle", p(1) & " Toggled OFF (" & i.ToString & ")")
                        End If
                    Case 4
                        '' Link is trying to Deactivate the Device
                        If DevStatus = 3 Then
                            '' Device is Already Off, so turn it On
                            i = 0
                            hs.WaitSecs(1)
                            Do While hs.DeviceStatus(p(1)) <> 2
                                '' Keep trying until it is really ON
                                i = i + 1
                                hs.ExecX10(p(1), "On", , , True)
                                hs.WaitSecs(1)
                            Loop
                            hs.WriteLog("ForceToggle", p(1) & " Toggled ON (" & i.ToString & ")")
                        End If
                    Case Else
                        '' Link not Activate or Deactivate, Log it
                        hs.WriteLog("ForceToggle", p(0) & " Value is " & LinkValue.ToString & " ???")
                End Select
            End Sub
        A few things to note:

        >> When a Link Command is sent (Value Changes) the UPB plugin creates two value changes. (1) from the current value to 0 and (2) from 0 to the new value. This is to make sure ValueChange events are triggered even if the value is changed from/to the same value. The script ignores the first value change to 0.

        >> A hs.WaitSecs(1) is required before changing the UPB device to the proper state. Otherwise the hs.ExecX10 does nothing. I'm assuming this is because of collisions with the other UPB link commands that are being repeated on the line. While this works, it means that if an 'out of sync' toggle needs to be 'helped', there will be a one second delay before the device changes to the proper state. If anyone knows a way around this, it would be greatly appreciated.

        >> The script assumes the toggle push button has been defined in UPStart to send alternating Snap On and Snap Off commands (values 3 and 4). Modify appropriately if your links are defined differently (ie, Activate/Deactivate)

        Here are two events defined to use the script:



        Any thoughts on an easier way to accomplish this would be appreciated. I would love to eliminate/shorten the 1 second delay.

        tenholde
        tenholde

        Comment


          #19
          Originally posted by Oman View Post
          Check out custom. Map anything any way you want.

          Jon
          If someone can tell me this...

          With the US2-40, I'd like single tap to be link1, and double tap to be link2.

          I know that for the 11-30s, you can make them NOT transmit a link for single, and transmit a link for double...then you set it up for transmitting their status on change. So...kind of what I'm looking for...except I have 2-40's everywhere else in the house (all but the 3 11-30s).

          Any idea how to handle that case?

          --Dan
          Last edited by drozwood90; January 20, 2009, 11:32 AM. Reason: Spelling...
          Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

          Comment


            #20
            US2-40 allows only a single link specification for each button on the US2-40.

            You could have single-click send activate and double-click send Deactivate and use events to catch each and do the action you want.

            I do not know how to do what you want without HS helping.

            tenholde
            tenholde

            Comment

            Working...
            X