Announcement

Collapse
No announcement yet.

Set ValuePairs from plugin

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

  • Set ValuePairs from plugin

    Hi,

    I'm trying to set the Status Value Pairs from my plugin.

    The code:
    Code:
    HomeSeerAPI.VSVGPairs.VSPair disconnectedVSP = new HomeSeerAPI.VSVGPairs.VSPair(HomeSeerAPI.ePairStatusControl.Status);
                    disconnectedVSP.Value = 0;
                    disconnectedVSP.Status = "Disconnected";
                    hs.DeviceVSP_AddPair(devRef, disconnectedVSP);
    
                    HomeSeerAPI.VSVGPairs.VSPair connectedVSP = new HomeSeerAPI.VSVGPairs.VSPair(HomeSeerAPI.ePairStatusControl.Status);
                    connectedVSP.Value = 100;
                    connectedVSP.Status = "Connected";
                    hs.DeviceVSP_AddPair(devRef, connectedVSP);
    
                    ((Scheduler.Classes.DeviceClass)hs.GetDeviceByRef(devRef)).MISC_Set(hs, Enums.dvMISC.SHOW_VALUES);
    
                    hs.SaveEventsDevices();
    However, the device shows as state "off", and the status value pairs appear to be empty.

    What am I doing wrong here ?

  • #2
    Are you sure devRef is getting the correct reference and are you taking ownership of the device by setting the .interface property?
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Yes, the device reference is correct. and I filled the Interface property with the name of my plugin.

      Any more thoughts ?

      Comment


      • #4
        Seems like adding
        PairType = VSVGPairs.VSVGPairType.SingleValue;
        fixed it !

        Comment

        Working...
        X