No announcement yet.

mcsMQTT plugin and non plugin devices

  • Filter
  • Time
  • Show
Clear All
new posts

    mcsMQTT plugin and non plugin devices

    When you associate an incoming topic by ticking the a check box you get a device like this: And of course everything works fine.

    however when you input the device number of an existing device in the ref test box, you get:
    Click image for larger version

Name:	m2.png
Views:	59
Size:	53.2 KB
ID:	1396184
    The value of this device (1498) does notget updated with the subscribed topic. In the expression field I have tried putting $$VALUE: but this also does not update the device.
    For completenes, the status graphics tab for device 1498 depicts:

    Click image for larger version

Name:	m4.png
Views:	36
Size:	43.6 KB
ID:	1396185

    If you do it as described in section 4.41 of the documentation the same blue page pops up in which you fill the subscribed topic and the publish (status) topic. So what is the MQTT publish broker? and there is no option to store the payload in "HS device value".
    So what does one have to do to get the payload of a subscribed topic into an existing device?

    Non-plugin devices that has subscription topics will show with a purple background as your screenshot shows. To control HS devices the CAPI object is used. The author of the non-plugin device determines which Value-Status pairs are used to control the device. These can be viewed in HS Device Management. To control this device via MQTT the payload needs to match the Status. I may have provisions in the plugin to also search for the Value. The provisions exists in the Edit tab for expressions and regular expressions to be used on the incoming payload before it is delivered to the HS device. Usually one publishes the payload that the HS device was setup to expect so transformations are not needed.


      "To control this device via MQTT the payload needs to match the Status." Yes this works, I created a device which can have one of two states and if the payload matches one of the two states the value of the device is updated with the payload of the topic subscribed to.

      But now I have a status only HS device which can accept a range of values (-2147483648 to 2147483647 as shown in post #1). How does one update the device value in HS with the payload of the subscribed topic? That is the one which is not happening. If you look in the statistics tab the topic is received with the correct payload but the HS device does not get updated with the payload of this topic. In the associations tab you can see the payload changing together with the time stamp in real time- but the HS device value does not get updated.

      Currently, I do it through a URL like this: - and the device value gets updated to 123.45 - what is the mcsMQTT equivalent?


        I wish I could post a video - as the value of the payload changes in the associations tab. The time of the HS device gets updated but the value of the HS device toggles to one of two values "0" and "-2147483648" only. The correct payload is not depicted.


          A non-plugin device is not owned by mcsMQTT. All mcsMQTT can do is request to owner of the device to control it based upon the CAPI protocol. It really does not make sense for mcsMQTT to update a status-only device.

          If you want the status to be reflected based upon a MQTT payload then it should be a mcsMQTT plug-in device.

          What you are doing with JSON is overwriting the ownership of the device and forcing DeviceValue to be set. You have lost the integrity of the device as the device owner is not updating it, but being overwritten by something external. While mcsMQTT could do the same thing, it is not consistent with a good practice. You should look at you system design and determine who own the truth for this piece of data.


            "If you want the status to be reflected based upon a MQTT payload then it should be a mcsMQTT plug-in device."
            Got it, finally.
            Thank you for clearing up my understanding.