Announcement

Collapse
No announcement yet.

Trigger for status with additional display data

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

    Trigger for status with additional display data

    I have a status with some additional display data so the user can see what is wrong with the configuration of the plug-in, without having to check the logs before going to the configuration page. For example (bold text is the additional display data): Configuration Error: Password is invalid. When I set a trigger for this status, the event does not run when the device changes to this status.

    This is how the event is configured:
    Click image for larger version

Name:	Status with additional display data as trigger.png
Views:	156
Size:	68.3 KB
ID:	1311236
    Is there something I must do to make statuses with additional display data work as triggers, or can't they be made to work?

    #2
    When you set the state, do you pass true on the run events option?

    Comment


      #3
      Yes, I do.

      Events do get triggered for status values without additional display data.

      It's easy to move the additional display data to the log, but I thought I'd save the user an extra step by showing the problem(s) in the device list.

      Comment


        #4
        Originally posted by jstuyts View Post
        Yes, I do.

        Events do get triggered for status values without additional display data.

        It's easy to move the additional display data to the log, but I thought I'd save the user an extra step by showing the problem(s) in the device list.
        Oh I missed something in your original post, so you want to trigger on 'just' the extra data. I don't think you can do that, you (I believe) would need to create a new 'invalid' state, and then first set your device to that dummy state and then set it back to the error state with the updated string. Only the value change itself triggers the updates, not the string alone changing, so if you mix a value change into what your are doing, you should get the behavior you want.

        Comment


          #5
          Originally posted by bsobel View Post
          Oh I missed something in your original post, so you want to trigger on 'just' the extra data.
          No, your first interpretation was correct. I don't care what the actual additional display data is, I just want the event to be triggered when the value changes to configuration error.

          I will look closer at how I define the configuration error value. Maybe there is something that needs to changed.

          Comment


            #6
            Note that it is a (single-valued) range type because otherwise the additional display data is not shown: https://forums.homeseer.com/forum/ho...74#post1290974

            Here is the creation code:
            Code:
            string status = $"Configuration Error: {VSVGPairs.VSPair.AddDataReplace(0)}";
            var valueStatePair = new VSVGPairs.VSPair(ePairStatusControl.Status)
            {
                PairType = VSVGPairs.VSVGPairType.Range,
                RangeStart = (int) RobotElectronicsEth008RelayBoardValue.CONFIGURATION_ERROR,
                RangeEnd = (int) RobotElectronicsEth008RelayBoardValue.CONFIGURATION_ERROR,
                RangeStatusPrefix = status,
                IncludeValues = false,
                HasAdditionalData = true
            };
            homeseer.DeviceVSP_AddPair(deviceRef, valueStatePair);
            
            var valueGraphicsPair = new VSVGPairs.VGPair()
            {
                PairType = VSVGPairs.VSVGPairType.SingleValue,
                Set_Value = (int) RobotElectronicsEth008RelayBoardValue.CONFIGURATION_ERROR,
                Graphic = "images/JohanStuytsNetworkRelay/configuration-error.png"
            };
            homeseer.DeviceVGP_AddPair(deviceRef, valueGraphicsPair);

            Comment


              #7
              I did another test where I checked choose a specific value in this range, and then the event does get triggered. It does not matter what the actual additional display data is, i.e. configuring the event for data X also makes it trigger for data Y.

              So it seems that you cannot trigger events on ranges, even though the UI makes it seem that this should work.

              Comment

              Working...
              X