Announcement

Collapse
No announcement yet.

[BUG] Missing updates for identical Device on any Topic

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

    [BUG] Missing updates for identical Device on any Topic

    Found a bug that I can reproduce at will, on multiple mcsMQTT devices... I'm on HS4 (.16) and I think this was happening in HS3 (which I was running a week ago).

    I have 4 topics that come from Tautilli. When sent they show 100% properly in the mcsMQTT Plugin screen (Associations -> Association Table for Auto Association of MQTT Topic and HS Device)... this all data, correctly shows in the table, including the Payload just/last sent.

    They issue shows on a specific auto-created device - the same device on ALL 4 sets. Attached screenshot shows 'Action' is not updated in the Device List, but is in the mcsMQTT Association table. The device does not update, no matter how long you wait.

    I checked all of the payloads, they are all identical... "User":"{user}","MediaType":"{media_type}","Action":"{action }","MediaTitle":"{title}","IPAddress":"{ip_address}

    **note: I'm not associating "User" but I left it in the payload incase I want it later.

    Testing...
    - device updates as expected: stop, resume
    - device value blanks: pause, play

    Click image for larger version

Name:	HS4_mcsMQTT_bug.jpg
Views:	169
Size:	55.6 KB
ID:	1566465

    #2
    Have you setup the VSP in the Edit tab for the Action key? Is the Max set to a small number so that pause and play associations cannot be added? You can also look at the Status/Graphics on the HS Device Feature to see what has been defined.

    The debug file for mcsMQTT will also provide more information for hint on how it is being processed.

    Comment


      #3
      It was working perfectly for over a year with the config you helped me get working. I only use it for Plex/Tautilli. I have made no changes at all other than updating to HS4 and updating mcsMQTT
      I do not know what VSP is. All I found was "Honor setup of device type and use VSP and Color Picker" on the PI's config "General" screen

      We never setup any Status/Graphics as there wasnt a need to. The devices are only used as status, not control -- the PI was simply inserting the payload text into the device and my HS events are watching for those specific words.

      Is mcsMQTT PI supposed to add Status/Graphics values for every "different" play load text?

      current Status/Graphics values...

      Media Room = none
      Living Room = none
      Office = 'resume' (0 | Off) and 'stop' (1 | On)
      Play Room = 'play' (0 | Off) and 'stop' (1 | On)

      There is some sort of bug going on with HS4 and/or mcsMQTT

      2 days of debugs attached
      Attached Files

      Comment


        #4
        The debug shows messages are being received such as below. In the case of Action the device 4913 is being updated to "play". The Status/Control UI for Action is Text so the HS DeviceString of 4913 is being updated.

        There are two things that may be incorrect in the setup. The payload keys are associated with HS Ref's 4904, 4905, 4907 and 4913. No problem with these Ref numbers, but usually when associations are made they are done one after the next so the Ref numbers will be in sequence. The screenshots in post 1 are small and I cannot distinguish Refs.

        The second is that it is likely you want the Actions to be recorded as numbers in HS to support event trigger more easily. Device 4913 is setup to store text rather than a number. To view and change it click on the 4913 button on the MQTT Page Association table. This brings up the Edit popup where the Control/Status UI can be changed from Text to List. This will tell mcsMQTT to create a Value Status Pair (VSP) for each text value observed such as 0=off, 1=stop, etc. You seem to have such a setup for Office and Play Room but not for Media and Living Rooms.

        Code:
        9/17/2022 12:36:54 PM 45376344 | ProcessMessage Plex_LivingRoom
        9/17/2022 12:36:54 PM 45376348 | Update Accepted 4905 to episode StatusType=3 Payload=episode
        9/17/2022 12:36:54 PM 45376350 | Updating Device from 0 PayloadNumeric=False
        9/17/2022 12:36:54 PM 45376352 | Update Accepted 4913 to play StatusType=3 Payload=play
        9/17/2022 12:36:54 PM 45376354 | Updating Device from 0 PayloadNumeric=False
        9/17/2022 12:36:54 PM 45376356 | Update Accepted 4904 to College Football - Connecticut at Michigan StatusType=3 Payload=College Football - Connecticut at Michigan
        9/17/2022 12:36:54 PM 45376358 | Updating Device from 0 PayloadNumeric=False
        9/17/2022 12:36:54 PM 45376367 | Update Accepted 4907 to 192.168.2.53 StatusType=3 Payload=192.168.2.53
        9/17/2022 12:36:54 PM 45376369 | Updating Device from 0 PayloadNumeric=False
        9/17/2022 12:36:54 PM 45376371 | ActOnMessageForTrigger QueueSize=0 ,Topic Plex_LivingRoom,Payload {"User":"LivingRoom","MediaType":"episode","Action":"play"," MediaTitle":"College Football - Connecticut at Michigan","IPAddress":"192.168.2.53"}

        Comment


          #5
          The missing sequence # was an old Association for 'body'... when Tautulli fixed their MQTT JSON, I no longer needed that device so I removed it.

          Just a reminder... I never modified the HS devices or the MQTT associations - ever. They were created in Sept 2020 when you helped me figure out a workaround for working with Tautulli's (then) non-standard MQTT. If there is a difference in the Association Control/Status, then the Plugin did it in Sept 2020 OR when I updated to HS4 / mcsMQTT just a week'ish ago.

          And, it was working just fine with the way it has been - it was inserting the Text into HS3 Devices (I could see it in HS's UI). I've been using it in events for 2 years like that. The only thing that "changed" in my system was moving to HS4 and HS4 Plugins. But now, as explained above, it does not insert text 'pause' or 'play' -- it just blanks the field; while it inserts 'stop' & 'resume' proper, as expected in Media Room (a device with no VSPs)

          I really prefer to use text, not VSPs, since its easy to remember the text for creating Events, and it makes them more human readable. Remembering something like '3 = Pause' (or whatever) is not easy and requires look-up every time I want to create or mod an event.

          As a test I deleted all the entries in HS device Plex_Office:Action
          ... then mcsMQTT populated the Device's status text as... "Dim 1%" "Dim 2%" "Dim 3%"and it is not creating any VSPs.
          ... Remember, the system was a second ago inserting text that matched the Graphics/Status that was in the HS device until I deleted those in the device. Btw, I've never been into the Association pop-up screen, I didn't even realize it was there.

          So I looked at the Association HS Device Control/Status UI, and its set to 'button'!?
          And the Subtype is "Battery"? (this probably doesnt matter but still odd)
          the Association shows this...

          Payload resume=0;resume;resume VSP
          Payload stop=1;stop;stop VSP
          Payload play=2;play;play VSP
          Payload pause=3;pause;pause VSP
          Payload {action}=4;{action};{action} VSP
          Payload {play}=5;{play};{play} VSP
          Payload test=6;test;test VSP

          ... is this supposed to have VSPs, but not be populated into the HS device if Association is set to 'button' -- not value or text?

          SO.... I changed the Association pop-up to 'text' and now all text gets populated properly into the HS device (under 'Status). I deleted all HS Device Control & SG entries... and tested. After receiving some payloads there are no 'Control' entries and only one 'Status/Graphics' entry with: start = -2147483648 ; end = 2147483647

          Comment


            #6
            I really prefer to use text, not VSPs, since its easy to remember the text for creating Events, and it makes them more human readable.
            HS does not natively support text as event conditions, but plugin extensions do provide this capability. If you want text then use the Edit tab to change all the associated plex JSON keys to text as it seems you have done.

            When mcsMQTT assigns Control/Status UI it looks at the payload and makes a best guess judgement as to what most user will want. The user always has the ability to override this guess via the Edit tab.

            Comment


              #7
              Originally posted by Michael McSharry View Post
              When mcsMQTT assigns Control/Status UI it looks at the payload and makes a best guess judgement as to what most user will want. The user always has the ability to override this guess via the Edit tab.
              Ah, interesting. Thx for the quick replies. I do have it working with the edits I made (per above). I thought HS4 broke it since it worked in HS3. Just another 'fun' oddity of HS4.

              Comment


                #8
                In both HS3 and HS4 the most common handling of enumerated states is with VSP. The HS UI presents the text when setting up events so the fact that a specific state is assigned a number is not visible to the user unless the user tries to edit the relationships.

                A simple example is a switch that can be ON or OFF. The label/status ON will be assigned a number e.g. 100 and OFF another such as 0. In an Event the user will be given a choice to action the switch to ON or OFF. Behind the scenes HS will be using DeviceValue of 0 and 100. HS3 & HS4 cannot action a Device or Feature to text ON or OFF. It can only action and trigger on numbers. The VSP is setup so the user sees the text while the event engine sees numbers.

                If one was to look at the Devices or DeviceUtility page they can observe the DeviceValue and they will see that its value will correspond to the selected VSP label/status.

                In the mcsMQTT context, Control/Status UI of Button and List will create VSP for each unique text that is observed for the received data. First is assigned 0, next 1, etc. When the HS Device Feature is associated then whatever text states have been observed will be used to create the HS VSP entries. If additional states are observed later then they do not automatically change the HS VSP. They are only changed when some Edit tab change is made. Those that are of type Button will stop being automatically collected by mcsMQTT when the HS association is made. Those of type List will continue to be collected up to the max VSP count (default 12) has been reached. User can manually use the Edit tab to add or change the VSP.

                Comment


                  #9
                  Much appreciate the help understanding. I have only been using mcsMQTT for Plex/Tautulli but I'm going to start adding Tasmota devices soon.

                  Comment

                  Working...
                  X