Announcement

Collapse
No announcement yet.

Elevating a topic does not seem to work for me

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

    Elevating a topic does not seem to work for me

    You kindly upgraded mcqMQTT back in January to improve the elevating of topics for wildcard support of multiple DS18b20 thermometer sensors and I was running the hotfix version you generated for several months:
    PR808 1/28/2022 5.23.1.4 Added option to elevate wildcarded keys for device uniqueness

    However, I recently used the HS3 plug-in updater to obtain the latest mcsMQTT and things went downhill after that and have not been the same since.

    I tried completely removing the mcsMQTT.db and mcsMQTT.ini to start afresh and I now receive "Cannot elevate JSON key 1 because if does not exist in Topic sonoff-5967/SENSOR/DS18B20-1:Id" or "Cannot elevate JSON key 2 because if does not exist in Topic sonoff-5967/SENSOR/DS18B20-1:Id" as per the screenshot if I try to elevate a topic.

    Is there a clean way of starting from fresh or something else I should try?

    Last edited by bartonj; November 5, 2022, 02:18 PM. Reason: Edited the emoji character that was being interpreted from the "slash capital D" character string in the payload

    #2
    With version 5.26.x.x there was much done on managing elevated topics. Looking at mcsMQTT.pdf I see I did not adequately update it to reflect the updated design.

    Now the JSON key that is being elevated is entered into the parent topic's MQTT Subscribe Topic textbox on the Edit Tab. This is most easily accessed by clicking on the Seq number (first column) hyperlink. In you case for a simple elevate operation you will enter Id in the textbox. After doing this and the Association table is refreshed there will be rows with Topics including Id-xxxxxxx:Temperature, as an example, You will "a"ssociate this to create the HS Device Feature that contains the temperature value of the sensor xxxxxxx.

    Your screenshot of the payload shows that multiple temperature sensors exist. You really do not care the order of the sensors. You only care about the serial number reflected by the Id key. In this case you want to use wildcard nomenclaure so rather than using Id on the Edit tab, you will use *:Id.

    What I updated in mcsMQTT.pdf is ...

    In summary, when a Payload with a set of JSON keys exists and one of the JSON keys in the JSON group should be used as part of unique identification then use the Edit Tab with the parent Topic to enter the JSON key that will be elevated. This is done at the top in the MQTT Subscribe Topic textbox. If the JSON key is part of a JSON array where the array position has no significance then prefix the JSON key with “*:” in the MQTT Subscribe Topic textbox. In both cases, from the Association Tabs, “a”ssociate the items to be mapped into HS. Do not associate the row that has the JSON key that was elevated as that would be redundant.

    Comment


      #3
      Sorry Michael but I am still struggling with making this work so I must be misunderstanding something.

      I deleted the mcsMQTT.db and mcsMQTT.ini files to start with a clean database and went through a number of options to try and implement the wildcard elevation but I have not yet seen any expanded rows of Topics in the Association table.

      I attach the zipped debug log file and the screenshot in the hope that helps identify what I am doing wrong.

      Attached Files

      Comment


        #4
        I did not originally pick up that you are using the HS3 as this is a HS4 forum thread. It turns out the HS3 plugin still has the radio rather than the text box. I made the update in 6.0.0.3 https://forums.homeseer.com/forum/hs...ge-log-hs4-hs3
        I am having problems with GoDaddy site to upload the updater override package. Attached are the files that were updated that go into \bin\mcsMQTT folder.

        The sequence of steps is shown below.
        1. MQTT message has been received and visible on the Association table

        Click image for larger version

Name:	Capture1.jpg
Views:	85
Size:	133.8 KB
ID:	1574415
        2. The column 1 "0" hyperlink is clicked to bring up Edit popup for main Topic. *:Id is entered into the textbox at the top
        Click image for larger version

Name:	Capture2.jpg
Views:	55
Size:	25.6 KB
ID:	1574416
        3. MQTT Message received and viewed in Association table. Row entries now show wildcard syntax
        Click image for larger version

Name:	Capture3.jpg
Views:	54
Size:	168.7 KB
ID:	1574417
        4. Associations made on all Temperature keys to create HS Devices
        Click image for larger version

Name:	Capture4.jpg
Views:	54
Size:	182.3 KB
ID:	1574418

        Comment


          #5
          Sorry for putting this into the wrong forum - it is indeed HS3.

          I stopped HS3 completely and installed the four files into the \bin\mcsMQTT folder after deleting the mcsMQTT.db file and with debug enabled. I rebooted.

          I get to your step 2 but I am afraid I still see radio buttons and no place to enter the *:Id wildcard.

          Is there another file I am missing?
          Click image for larger version

Name:	2022-11-06 16_18_55-192.168.7.244_90_MQTT.png
Views:	58
Size:	215.1 KB
ID:	1574437

          Comment


            #6
            look at the dates on the files you installed at \bin\mcsMQTT. They should be Nov 6, 2022 at 11:58

            Comment


              #7
              All four files seem to be correct as per attached properties

              Comment


                #8
                Look at General Tab, first header to see what file version HS is actually using

                Click image for larger version

Name:	Capture.jpg
Views:	45
Size:	32.9 KB
ID:	1574472

                Comment


                  #9
                  Good catch!

                  I had the General tab showing 5.26.6.8 so I looked around and found I had somehow managed to put a version of MCS_MQTT_2020.dll and the MCS_MQTT_2020.pdb files into the Program Files (x86)\HomeSeer HS3 folder which must somehow take priority/override the ones in /bin/mcsMQTT:

                  Click image for larger version

Name:	2022-11-06 19_46_01-192.168.7.244_90_MQTT.png
Views:	88
Size:	92.5 KB
ID:	1574482

                  So I deleted these two files from the HS3 folder and rebooted and the correct version then appeared in the General tab and I had the correct text box appearing on the Edit tab which in turn displayed the wildcard temperature settings!
                  Click image for larger version

Name:	2022-11-06 19_59_59-192.168.7.244_90_MQTT_Edit=sonoff-5899_SENSOR&INHIBIT=1.png
Views:	48
Size:	271.3 KB
ID:	1574483

                  So all is good for the temperature settings - thank you for your patience and guidance!

                  I have also used the same technique for another ESP8266 running tasmota that has a pair of BME280 sensors reporting temperature/humidity/pressure along with 5 other DS18B20 temperature sensors and that seems to be working well too - so thank you!

                  As always - it is primarily operator error so thanks for your guidance on getting this setup properly.

                  I have always said there is a fine line between something being "complicated" and something being "sophisticated" and that is down to each person's level of understanding on the topic. You have confirmed, again, for me that your work is genuinely a "sophisticated" plug-in because I now have a better understanding of how to configure it properly - thank you!
                  Click image for larger version

Name:	2022-11-06 20_31_58-Inbox - jeffb@vadis.net - Outlook.png
Views:	45
Size:	305.0 KB
ID:	1574484

                  Comment

                  Working...
                  X