No announcement yet.

Device Button that just sends request to plugin - not update status

  • Filter
  • Time
  • Show
Clear All
new posts

  • Device Button that just sends request to plugin - not update status

    Solved: I forgot to comment out a bit of code in the sample plguin that sets the value. DOH!

                'But here, we just update the value for the device
                hs.SetDeviceValueByRef(CC.Ref, CC.ControlValue, False)
    Nothing to see here

    Hi Guys,
    I have written my first plugin leveraging the ones on here. All works well so far.

    I want to have it create buttons on the device that will call the SetIOMulti where I can say send a command to a serial device.

    Unfortunately I can not work out how to put a button on there that is just for control and NOT status.

    I tried using VSPairs and it updates the status icon even when set to "Control" (does not update the device value...but does set the status icon).
    'Status pair
    SVpair = New HomeSeerAPI.VSPair(HomeSeerAPI.ePairStatusControl.Control)
    SVpair.PairType = HomeSeerAPI.VSVGPairType.SingleValue
    SVpair.Value = 9
    SVpair.Status = "R1 " ' & SVpair.Value
    'SVpair.ControlUse = ePairControlUse._On 'For IFTTT/HStouch support
    SVpair.Render = Enums.CAPIControlType.Button
    SVpair.IncludeValues = True
    hs.DeviceVSP_AddPair(dv.Ref(hs), SVpair)

    I want something like the below image which was created with _AddButton...but this has to call a separate script...not SetIOMulti in my plugin like CAPI buttons do.

    Help would be much appreciated
    Attached Files
    Last edited by davros; January 27th, 2017, 05:37 PM.