Announcement

Collapse
No announcement yet.

How do I change the "Control Use" property of a device so that sliders work?

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

    How do I change the "Control Use" property of a device so that sliders work?

    Does anybody know how to change the "Control Use" property of a device in the status/graphics page? (see attached images).

    I have over a 100 xAP devices (lighting via Clipsal C-Bus) setup with the xAP plugin (mcsxap). The sliders work on devices that have "_Dim" as the value for "Control Use". Those that are "Not_Specified" have problems in that the sliders won't cause a change, but the sliders do respond to a change.

    The field is greyed out. And I have not heard anything back from the author of the plugin. He may be away.

    I know people are having problems with sliders but I'm not sure if this is the cause of their problems. It is for my setup.

    If this property can't be easily changed I will have to recreate over 100 devices, and rewrite associated events.......groooaan.

    Marty
    Attached Files
    iCore5 Win 10 Pro x64 SSD

    HS3 Pro Edition 3.0.0.435 Windows

    BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

    #2
    If you are any good with scripting you could write a script to enumerate through the devices and update the properties.

    However as these devices are created by the plug-in you really should work with the plug-in author first. Updating the devices on your own could mess with other plug-in functionality.
    Nicolai L

    Comment


      #3
      As I said here http://forums.homeseer.com/showthrea...ghlight=VSPair this is the only way I can think to do it and NicolaiL is right in saying this should come from the plugin author because it is not known how or if the plugin is using this for another purpose (being as though it is not specified I doubt it is but you never know). I don't necessarily blame the author of the plugin though as this is not advertised in the SDK that this controluse property would have this implication in HSTouch. And I don't know whether or not that device when it is set up by the plugin could be used for non-dimming devices so it might not make sense to set it by default. I even looked at the database tables but it looks as if this data is just in a blob in the table so not in an editable format (I was hoping an SQL command could save your time).

      Originally posted by NicolaiL View Post
      If you are any good with scripting you could write a script to enumerate through the devices and update the properties.

      However as these devices are created by the plug-in you really should work with the plug-in author first. Updating the devices on your own could mess with other plug-in functionality.
      I think the issue is there is no command (unless I am missing it) to just change the use property as the use is attributed to each VSPair (of which of course there could be many). I think you then need to look at each VSPair, take it out, change the .controluse property and then put it back in the device but every other property then needs to be duplicated across from the old device. I'm not sure whether that would be successful or just end up causing issues.

      Comment


        #4
        Against my absolute better judgement I have decided to at least test whether it works by a script and it appears that it does. Now there are a number of features of the VSPairs that would need some additional work to properly duplicate (HasScale, HasAdditionalData and I am worried about the StringList also) so I have left those out - this could have many implications depending on whether the plugin is using these - however your plugin may not even be using them at all.

        I really can't stress enough how this could end up absolutely trashing your device value pairs needing you to set them again from the plugin so use it at your risk. What I can say is that on the couple of devices I have tested with it does change the controluse pair to _Dim - I have not tried HSTouch but see no reason why it won't work.

        To use it you just need to set DVRef to your device reference and then Value to a value somewhere in your dimming value pair, then you need to run the script. You could do it by batch if you wanted by having an array of device references but I would just do it for a couple of devices first. The issue surrounding whether you need to use _On and _Off is something that you should be able to work out doing from this script

        Code:
        Sub Main(ByVal Parm As Object)
        
            Dim LT As String = "ControlPairs"
        
            Try
                Dim DVRef As Integer = 75
                Dim Value As Integer = 50 'value in the middle of your device value pair set just to be sure
                Dim CStatus As ePairStatusControl
        
                CStatus = ePairStatusControl.Both 'set this to the correct, I imagine it is both already
        
                Dim OldPair As VSPair = hs.DeviceVSP_Get(DVRef, Value, CStatus)
                Dim NewPair As New VSPair(CStatus)
        
                If OldPair Is Nothing Then
                    hs.WriteLog(LT, "Could not find the value/status pair for the value " & Value.ToString & " on the device " & hs.DeviceName(DVRef))
                    Exit Sub
                Else
                    hs.writelog(LT, "Building New VSPair")
        
                    If OldPair.HasAdditionalData Then
                        hs.WriteLog(LT, "Device Uses Additional Data - No Method For This")
                    ElseIf OldPair.HasScale Then
                        hs.WriteLog(LT, "Device Uses Has Scale - No Method For This")
                    Else
                        With NewPair
                            .PairType = OldPair.PairType
                            .Render_Location.Row = OldPair.Render_Location.Row
                            .Render_Location.Column = OldPair.Render_Location.Column
                            .Render_Location.ColumnSpan = OldPair.Render_Location.ColumnSpan
                            .RangeStart = OldPair.RangeStart
                            .RangeEnd = OldPair.RangeEnd
                            .Value = OldPair.Value
                            .RangeStatusPrefix = OldPair.RangeStatusPrefix
                            .RangeStatusSuffix = OldPair.RangeStatusSuffix
                            .RangeStatusDecimals = OldPair.RangeStatusDecimals
                            .RangeStatusDivisor = OldPair.RangeStatusDivisor
                            .IncludeValues = OldPair.IncludeValues
                            .ValueOffset = OldPair.ValueOffset
                            .HasScale = OldPair.HasScale
                            .ZeroPadding = OldPair.ZeroPadding
                            .ControlUse = ePairControlUse._Dim 'main point of this script
                            .Render = OldPair.Render
                            .PairButtonImageType = OldPair.PairButtonImageType
                            .PairButtonImage = OldPair.PairButtonImage
                            '.StringList = OldPair.StringList 'be careful with this one also
                        End With
        
                        hs.WriteLog(LT, "End Of VSPair")
                        'put the new pair back into the device
        
                        Dim Result As Boolean = hs.DeviceVSP_AddPair(DVRef, NewPair)
                        hs.WriteLog(LT, "Added To Device:" & Result)
        
                    End If
                End If
            Catch ex As Exception
                hs.WriteLog(LT, "Error: " & ex.Message.ToString)
            End Try
        End Sub

        Comment


          #5
          mrhappy

          You are a genius! You script worked almost perfectly for me. The "Control Use" changed to "_Dim" after running the script on a device. And the HSTouch slider works...almost.

          I say almost because even though the slider works as expected the scale is not correct. The device value ranges from 0 to 255. But the slider maxes out at 100. The ON and OFF buttons set the device value to 255 and 0 respectively, so that's good. Just the scale of the slider, i.e. I can't use the slider to set a value above 100.

          The xAP (C-Bus devices) all have a scale from 0 to 255. But of note is that the "Has Scale" box is not checked.

          I'm not very strong with scripts....a weakness considering HS is very script dependent. But I'm learning. I'll try and figure it out myself but any advice would be greatly appreciated.

          Thank you for spending time helping me with this.

          Marty
          Last edited by mminehan; October 6, 2014, 12:51 AM. Reason: mention "has scale" not ticked
          iCore5 Win 10 Pro x64 SSD

          HS3 Pro Edition 3.0.0.435 Windows

          BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

          Comment


            #6
            I think that may be an issue in HSTouch, are you using the default project or your own project? When you drop a slider onto the page there is a maximum value a slider can be and I wonder whether this is either fixed or has some issue with getting the maximum value from the device (if you are in the default project I wonder if queries the device somehow for it's maximum value).

            If you have access to the designer I would just drag a slider onto the page and look in the element properties window at ValueMax, see what this is set to as by default it is set to 100.

            Comment


              #7
              Hi mrhappy,

              I had a look at the VSPair information (http://homeseer.com/support/homeseer...htm?vspair.htm) and couldn't see any multiplier/divisor values. And I reached the same conclusion that you just mentioned. It's an issue in HSTouch.

              I am indeed using the default project file. So I will fire up HSDesigner and change the range of the sliders.

              Thanks again. And thanks for the prompt reply.
              It's this kind of support (users like yourself in the forums) that makes HS a good product.

              Regards, Marty.
              iCore5 Win 10 Pro x64 SSD

              HS3 Pro Edition 3.0.0.435 Windows

              BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

              Comment


                #8
                Just a quick update.
                Thanks to mrhappy's script and changing the max value (to 255) on the HSTouch slider in the project file I am able to use the sliders in HS Touch on the WFTT07 to control my C-bus dimming lights. Yay!
                iCore5 Win 10 Pro x64 SSD

                HS3 Pro Edition 3.0.0.435 Windows

                BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                Comment


                  #9
                  Well I am glad you are up and running and thanks for the feedback, it would be nice if I was inventing something groundbreaking rather than just providing stuff to get around what may have been solved with slightly better documentation though!

                  I am a bit mindful of HSTouch as I wonder whether or not it would be possible to assign two _Dim VSPairs to a device (nothing to say you can't) and then what HSTouch would do with them is anyone's guess. That also and the fact the slider seems to default to 100/0 rather than perhaps querying the _Dim VSPair to find out the RangeEnd/RangeStart and then setting the slider to those settings. There are a couple of things like this that appear as easy ways to get things working but I am not convinced they have been thought through that much to be honest.

                  Comment


                    #10
                    Marty, I've followed a similar approach but have noticed the following:

                    1. The devices that mcsXap created had max/min values of -2147483647/2147483647 so I had to change those to 0/255 and then edit the range to 1-254
                    2. The slider works, but I can't get it to go to 255, only to 254
                    3. If I adjust the value on the HS3 web page, the slider does not reflect those changes
                    4. I can't get a button to set "Off" or "On" status (so a button instead of a slider for relays)
                    Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                    Comment


                      #11
                      I think unfortunately there is not much published about HSTouch is using these fields to actually understand what is going on. With very little information I am not sure you would get to the bottom of what is happening, I don't know if the On/Off buttons in HSTouch are using CAPI to look for a "On" or "Off" label or rather it is going through the VSPairs looking for a _On or _Off VSPair and then using this to control the device. You could always try a help desk ticket to ask what is HSTouch using to then alter the pairs accordingly.

                      Comment


                        #12
                        the On/Off buttons in HSTouch are using CAPI to look for a "On" or "Off" label or rather it is going through the VSPairs looking for a _On or _Off VSPair and then using this to control the device
                        Interesting. I think mrhappy might be right. My On/Off buttons work (with the default project) if the 0="Off" and 255="On" in the device/status pair settings. But my blinds are set to 0="Down" and 255="Up" and the buttons in the default project don't work (as HSTouch uses the default dimming page with "Off" and "On" buttons). I will have to experiment with the project file and try and create a different page for the blinds using Up/Down as button labels.

                        And I hadn't noticed as I am still experimenting but you are right. I can't get the slider to accept the end of the range as a value (0 or 255). Everything in between causes a change but not either end.

                        My sliders do respond to changes set elsewhere though (web page or actual C-Bus switch).

                        One other thing. If either the "Is Dimmable" on the device configuration tab (set via dv.Can_Dim(hs) = True), or the "Control Use: _Dim" is set then the HSTouch default project uses the Dimmer page. If neither is set then HSTouch defaults to the list of selectable values.

                        I hope this makes sense.

                        Marty
                        iCore5 Win 10 Pro x64 SSD

                        HS3 Pro Edition 3.0.0.435 Windows

                        BLOccupied:,Device History:,Yamaha:,UltraMon3:,mcsXap:,Restart:,UltraNetatmo3:, UltraM1G3:,Ultra1Wire3:,BLBackup:,Harmony Hub:,DoorBird:,UltraECM3:,Nanoleaf 3P:,UltraRachio3:,Z-Wave:,SDJ-Health:,BLGarbage:,Blue-Iris:,Chromecast:,Pushover 3P:,EasyTrigger:

                        Comment


                          #13
                          I also have an issue dimming z-wave devices using sliders in hstouch. But, there is no "Controluse" field that I can update with the script above.


                          I don't get why HomeSeer devs just fixes the issue! It has clearly been around for some time. I am getting sick of deployments where the end users have to find workarounds for bugs that should have been fixed months ago.

                          In general I find the HS3 rather buggy, and in my opinion it is far from ready for launch. If I had known this prior to the HS3 upgrade where I had to rebuild the entire HA environment, I would probably have gone in a different direction.

                          Comment

                          Working...
                          X