Announcement

Collapse
No announcement yet.

How to elevate sensor topic

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

    How to elevate sensor topic

    Hi Michael, ref below;

    how can I elevate "sensor" so that it becomes parent ?

    otherwise I end up with multiple HS devices sharing the same Location1/Location2/name combo for all devices ( same problem for InfluxdB reporting )

    Screenshots below should speak for themselves:

    Thank you

    Click image for larger version  Name:	Capture d’écran 2022-02-25 153955.jpg Views:	0 Size:	67.4 KB ID:	1529271

    Click image for larger version  Name:	Capture d’écran 2022-02-25 153355.jpg Views:	0 Size:	49.0 KB ID:	1529272



    #2
    The purpose of Elevate is to add information to the topic that is contained in the payload so that the JSON key's value is treated as part of the topic identification. Since your payload is not JSON there are no keys to elevate. Sensor is already part of a unique topic.

    I am not totally clear on the issue you are trying to overcome. If you want a single common parent with multiple children then this is a Grouping action on the Edit tab.

    While mcsMQTT provides ability to set default Location and Location2 properties when a Topic is associated, the final Location and Location2 property is the user's edit on either the Edit tab or the HS Devices page to form the desired naming conventions for Devices created by mcsMQTT. mcsMQTT does not use Location, Location2 or Name for anything internal to the plugin so anything the user desires to put in these HS Device properties will not break anything in Topic to Device relationships.



    Comment


      #3
      If you look at the second screenshot, the issue is that all devices created end up with the same name :
      !HOME ENERGY SENSORS hydroqc-maison state

      Essentially, what should be the device name ends up as the parent name and all devices (child) ends up being called "state".

      I know I can manually change the device name and reassign all under the same parent but there are about 45 of them (below) and was looking for a simpler way to accomplish this...

      Thought it was possible to "emulate" the JSON elevate concept at the topic level.


      Click image for larger version

Name:	Capture d’écran 2022-02-25 163411.jpg
Views:	84
Size:	117.0 KB
ID:	1529282

      .....
      .....
      ....
      ...
      .

      Comment


        #4
        To handle the uniqueness at the Topic level of a child device in this kind of situation there is a setting on General tab to use the full topic for the Name property. The default is to use just the last segment of the Topic when the HS Name is assigned. It only applies to newly created associations.

        Click image for larger version

Name:	Capture.JPG
Views:	74
Size:	16.7 KB
ID:	1529288

        The other option is with scripting to rename the devices. If you need access to mcsMQTT properties such as Topic information then it is supported with the scripting interface provided by mcsMQTT.

        Comment


          #5
          "full topic for the Name property"
          had overlooked this option;
          works perfectly.

          Enjoy the weekend!

          Comment

          Working...
          X