Announcement

Collapse
No announcement yet.

DeviceButtonsAdd

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

  • rmasonjr
    replied
    So is the code in posts 12 and 15 correct?

    Leave a comment:


  • Rick Tinker
    replied
    Guys - if you have a single control option, then it is not "status only". There is no issue with having a control option on a device that is used MOSTLY as a status device.

    Define your control option - button, drop-list, whatever - as a CONTROL pair, and then add your status options (individual VSPairs, range VSPair) as STATUS pairs.

    When the control option is pressed/selected, it calls SetIOMulti in your plug-in, and it is your decision whether or not to change the value of the device which would update the status.

    The status only MISC bit prevents the control options from displaying even if they are set on a device, so it is a way to turn control on/off without having to remove and re-add individual VSPairs.

    Leave a comment:


  • jon00
    replied
    Add me to the list. I normally use status only for buttons as it gives the control area a clean sheet.

    Leave a comment:


  • wetlip
    replied
    another reason to use status only device is to get rid of the radiobuttonlike status graphic, because that doesnt appear in status only devices.

    Leave a comment:


  • rmasonjr
    replied
    Rick - I am doing the same thing as Mark. Status only devices with a "Reset" button so the user can clear the value as needed.

    Is there a better way to do this?

    Leave a comment:


  • mnsandler
    replied
    Yes I did Rick. I'm not really trying to control the physical device, just the hs device status/value in the scenario I mentioned in post #14

    this is possible in HS2 and I don't want to give up/loss this capability in hs3

    Leave a comment:


  • dcorsus
    replied
    Originally posted by mnsandler View Post
    Thanks Dirk,
    can you post a small screen shot of how this device renders?
    See http://board.homeseer.com/showthread...41#post1058141

    Leave a comment:


  • Rick Tinker
    replied
    Originally posted by mnsandler View Post
    so then how do i create a status only device with control buttons?
    Did you really just ask how to create a STATUS ONLY device with CONTROL buttons?

    Leave a comment:


  • mnsandler
    replied
    Thanks Dirk,
    can you post a small screen shot of how this device renders?

    Leave a comment:


  • dcorsus
    replied
    Originally posted by mnsandler View Post
    I had to add the following to the device definition to get the buttons to show
    dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)
    Oops, I knew it was the misc settings, thought it was the Status_only that had to be cleared but you are right, it is the show_values that must be set or no buttons show.

    Never seen any default buttons show up here. Here is a snippet of what I do.

    dv.Location(hs) = "Sonos" 'IFACE_NAME
    dv.Location2(hs) = ZoneName 'IFACE_NAME & InstanceFriendlyName.ToString
    dv.Device_Type_String(hs) = SonosHSDevices.Player.ToString
    dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)
    dv.Can_Dim(hs) = False
    dv.Image(hs) = ""
    dv.Buttons(hs) = ""
    dv.OLD_Values(hs) = ""
    Dim DT As New DeviceTypeInfo
    DT.Device_API = DeviceTypeInfo.eDeviceAPI.Media
    DT.Device_Type = DeviceTypeInfo.eDeviceType_Media.Root
    DT.Device_SubType_Description = "Sonos Player Master Control"
    dv.DeviceType_Set(hs) = DT
    dv.Status_Support(hs) = True
    hs.SetDeviceString(HSRef, "", False)
    hs.DeviceVSP_ClearAll(HSRef, True)

    Dim Pair As VSPair
    Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Control)
    Pair.PairType = VSVGPairType.SingleValue
    'Pair.ProtectionSet = ePairProtection.Do_Not_Delete
    Pair.Value = 1
    Pair.Status = "Play"
    Pair.Render = VSVGPairRender.Button
    Pair.ButtonRender_Row = 0
    Pair.ButtonRender_Column = 0
    hs.DeviceVSP_AddPair(HSRef, Pair)


    Dirk

    Leave a comment:


  • mnsandler
    replied
    Ok, i got this to work but what a PITA to figure out...

    I had to add the following to the device definition to get the buttons to show
    dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)

    so then how do i create a status only device with control buttons?


    here is the scenario...

    I have a status device that tracks a Low Battery warning.

    The status device value will go On when the battery is low.

    i want to be able to add a "Reset" btn to this status device. So the user can
    click the Reset btn to turn the status value Off once the battery is replaced.

    I don't want an On or Off btn on this status device only Reset.

    do i need to remove these default btns and then add my Reset back in?

    I am trying to keep the UI/functionality in my hs2 & hs3 plugins the same.

    Leave a comment:


  • dcorsus
    replied
    Originally posted by mnsandler View Post
    so how do i add a control button to a PI device? the sample plugin code doesn't seem to help me
    Seem to remember when you set the misc flags to dv.MISC_Set(hs, Enums.dvMISC.STATUS_ONLY), the buttons wouldn't show so misc_status_only needs to be cleared.

    Dirk

    Leave a comment:


  • rmasonjr
    replied
    Originally posted by mnsandler View Post
    so how do i add a control button to a PI device? the sample plugin code doesn't seem to help me
    This adds a reset control button on a PI's device:

    PHP Code:
    Dim Pair As VSPair
    Pair 
    = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
    Pair.PairType VSVGPairType.SingleValue
    Pair
    .Value 100
    Pair
    .Status "Reset"
    Pair.Render VSVGPairRender.Button
    hs
    .DeviceVSP_AddPair(refPair

    Leave a comment:


  • mnsandler
    replied
    so how do i add a control button to a PI device? the sample plugin code doesn't seem to help me

    Leave a comment:


  • reidfo
    replied
    I think that's a great solution to the problem, Rick. It gets rid of the old confusing string concatenation stuff and still allows users to create buttons. Perfect.

    Leave a comment:

Working...
X