Announcement

Collapse
No announcement yet.

Send Status and not Label

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

    Send Status and not Label

    I have a device set up as shown in the two images below. I want this to be used as a way of sending commands to an OpenMQTTGateway. I have configured the device as shown below as well. I thought setting the publish payload topic to
    {"cmd":"$$STATUS:"}
    would send JSON with the Status set when the button is pressed. In the case of device value 2, I expect to send a payload of
    {"cmd":"status"}
    but instead I am seeing the payload as the Label, or
    {"cmd":"get status"}
    Am I expecting the correct payload and have something odd going on? This is a Virtual Device created using jon00's utility to create virtual devices. It is only intended for use to send commands to the gateway. I would like to have the HomeSeer button labeled with "get status" but the published topic needs to have just "status" in the payload JSON. Since I am hoping for one device to be used to send multiple commands, using something from the device's settings is desired.


    Payload Apparently Sent

    Click image for larger version

Name:	image.png
Views:	83
Size:	33.6 KB
ID:	1597630



    Device Settings

    Click image for larger version

Name:	image.png
Views:	136
Size:	79.1 KB
ID:	1597628

    Click image for larger version

Name:	image.png
Views:	83
Size:	66.2 KB
ID:	1597629​​
    Karl S
    HS4Pro on Windows 10
    1070 Devices
    56 Z-Wave Nodes
    104 Events
    HSTouch Clients: 3 Android, 1 iOS
    Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

    #2
    I believe you can use the replacement variable $$DSR: (refNumber): rather than $$STATUS: Note no space after colon to prevent emoji.

    Another option, then may actually may work better is $$LABEL: It looks like $$LABEL and $$STATUS are reversed in mcsMQTT implementation.

    When a non-plugin device is used to publish MQTT message, the HSEvent callback is used and it provides old-DeviceValue and new-DeviceValue and the RefNumber to mcsMQTT. I am not certain at that point in time if DSR or LABEL will result in old vs. new DeviceValue being used to provide the text.

    For DSR, In HS3 there was a GetStatus() method. In HS4 there is a GetLabelForValue() method that is being used by mcsMQTT. It is not clear if the intended status is being provided of if the control label is being provided. If you do not get what you like then I can investigate.

    Comment


      #3
      Originally posted by Michael McSharry View Post
      Another option, then may actually may work better is $$LABEL: It looks like $$LABEL and $$STATUS are reversed in mcsMQTT implementation.
      This worked. Would you be changing the code to align the items? I understand keeping it so as not to break existing implementations.
      Karl S
      HS4Pro on Windows 10
      1070 Devices
      56 Z-Wave Nodes
      104 Events
      HSTouch Clients: 3 Android, 1 iOS
      Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

      Comment


        #4
        I recall seeing the swap before and did not correct it for the reason you indicated.

        Comment


          #5
          Had a thought: What about a General setting to use the legacy method? Assuming, that is, that the difference between the two is in error.

          Just a thought to possibly avoid future confusion if this is currently opposite of what it should be.
          Karl S
          HS4Pro on Windows 10
          1070 Devices
          56 Z-Wave Nodes
          104 Events
          HSTouch Clients: 3 Android, 1 iOS
          Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

          Comment

          Working...
          X