Announcement

Collapse
No announcement yet.

Status wrong in events

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

    Status wrong in events

    Removed

    #2
    mcsMQTT tries to define the HS UI for a device based upon the payload that has been received at the time Accept is performed. If it has been text in the payload then it will select a mcsMQTT device type of text, button or list. If it has been numeric then it will select the number type.

    You can change this by using the Edit tab (click on the Association tab Ref button for the desired row) and change the device type as desired.

    The manual (mcsMQTT.pdf) has a further discussion on device types and implications of selecting each.

    Comment


      #3
      Let us assume that your bathroom motion sensor will send Topic of smartthings/Bathroom Motion/motion with payload of either "active" or "inactive". What is showing on your screenshot is the "active" case.

      What mcsMQTT will do is put "active" in the Device String of HS Device 271 because "HS Device Control.Status UI" has the "text" radio selected. If a message is received with "inactive" payload then mcsMQTT will put "inactive" in the Device String of Device 271.

      Device String is flexible because it can hold any text, but not very useful to use in standard HS events because HS uses Device Value as the trigger for events.

      What you would like is for the "inactive" and "active" to be mapped into numbers that can be stored in Device Value. This is the Value Status Pair (VSP) feature of HS. mcsMQTT "HS Device Control.Status UI" radio of Button or List support VSP. By default a value of 0 is used for the first text to number map. 1 for the second, etc. mcsMQTT had seen only a payload of "inactive" for this Topic at the time Device 271 was created. You can add the "active" one in the "HS Device VSP List" text box using the syntax "active=1". You also want to change the "HS Device Control.Status UI" radio to "Button".

      If you look at Device 271 in HS Device Management you will see the tab for Value Status Pairs and will see whatever you have setup in the mcsMQTT Edit tab which should be two rows with "inactive" and "active" and values of "0" and "1". When trying to trigger an event you will now have the desired setup so HS can trigger on a Device Value.

      I am guessing that your Kitchen MQTT Topic has a payload of "1" to indicate motion. If this is the case then mcsMQTT will think a HS Device will use the number in Device Value so it will assign "HS Device Control.Status UI" radio of "Number" and will store the payload in Device Value. You can then use the Device Value directly in events. If you want your event triggers to look the same between the Bathroom and Kitchen when VSP is used to show text based upon a numeric mapping then use the HS Device Management Status Graphics to delete the number range and twice use the Add New Single Value button to add the active and inactive mappings to 1 and 0. Do not make any changes on the mcsMQTT Edit tab because mcsMQTT is already expecting to receive a number and will store the number in the Device Value.

      Of course for your Kitchen (or any Topic) that has a numeric payload you can continue to use the default numeric range definition and trigger based upon specific device values. It is only the UI cosmetics that are affected.

      Comment

      Working...
      X