Announcement

Collapse
No announcement yet.

How to Edit a Device

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

  • How to Edit a Device

    I'm brand new to MQTT and the mcsMQTT plugin. I successfully installed an MQTT broker and the mcsMQTT plugin and have it basically working. However, I've hit a road block that is driving me insane. I feel like a bumbling idiot. I created a device by entering a Topic using the Add/Edit tab. I want to add some Status Graphics to the device, but it says "Device settings prevent editing/adding value/graphics pairs". So I went back to the plugin Add/Edit tab and unchecked NO_GRAPHICS_DISPLAY. But there is no way to save the change. How do you make the change stick?

    I also tried to change the Subscribe Topic. Same issue. However, if I change the Topic in the top field (gray), a new HS Device is created. I then went back to Edit the original device by entering its reference number an I get an error that says it doesn't exist (when it clearly does still exist).

    So what in the world am I missing?

    Any help would be greatly appreciated.

    Mike

  • #2
    There are two typical scenarios one would employ. One is accept an entity into HS that exists outside of HS. The other is to publish an exising HS device as a MQTT topic so external entities can be informed.

    In the first case the external entity will have published a topic that describes a behavior that is of interest in HS. This topic will be visible on the Association tab of mcsMQTT is the include receive devices checkbox at the top of the tab is checked. After the Show Selected Associations button is clicked the HS devices will be shown in rows with a pink color.The checkbox on the Accept column or the desired row is used to create the HS device that will be updated based upon changes in payload of the topic.

    The second case the Association tab will have checkbox at top set to show the non-plugin devices checked. After the Show Selected Associations button is clicked the HS devices will be shown in rows with a purple color. The Accept checkbox on the desired row is used to create a mapping to a topic. The topic is then entered on that row where the text box becomes available.

    If you want to edit other attributes then you will go to the Edit tab. Just click on the Ref button for the row of the device that has an association accepted to bring up the Edit popup for this device.

    It can also be done manually with the Edit tab, but now quite as easy.

    What is important to note is that non-plugin devices have limited editing ability while mcsMQTT devices (created based upon a received topic) have full edit ability. You were on the right track to uncheck the MISC NO_GRAPHICS_DISPLAY checkbox. This will allow you to use HS Device Management to create graphics. For graphics to exist there needs to be a value-status relationship. This is created when the Edit tab Device Control Status/UI radio has Button or List selected. The relationships between a numeric value and the status display is then shown in the VSP row of Edit tab. mcsMQTT will keep track of received payloads and establish relationships or they can be entered manually. Look at the tool tip on the VSP checkbox if you want to do it manually or edit those that exist.

    If you are going to be editing graphic pairs then you will want to do this after everything else has been setup on the Edit tab. Changes in the Edit tab will generally cause all the properties in HS for the device to be reset. I changed this with 3.4.19.0, but did not submit it to the updater yet. It is at http://mcsSprinklers.com/mcsMQTT_3_4_19_0.zip if you cannot wait.

    Comment


    • #3
      Thank you for the quick and detailed response. I understand most of what you have explained and have had some success getting it set up, but with a few frustrations detailed below.

      Originally posted by Michael McSharry View Post
      There are two typical scenarios one would employ. One is accept an entity into HS that exists outside of HS. The other is to publish an exising HS device as a MQTT topic so external entities can be informed.

      In the first case the external entity will have published a topic that describes a behavior that is of interest in HS. This topic will be visible on the Association tab of mcsMQTT is the include receive devices checkbox at the top of the tab is checked. After the Show Selected Associations button is clicked the HS devices will be shown in rows with a pink color.The checkbox on the Accept column or the desired row is used to create the HS device that will be updated based upon changes in payload of the topic.
      What establishes "behavior that is of interest in HS"? Doesn't there have to be a device in the plugin database that is associated with a particular topic? How else might HS have an "interest" in a topic?

      Originally posted by Michael McSharry View Post
      The second case the Association tab will have checkbox at top set to show the non-plugin devices checked. After the Show Selected Associations button is clicked the HS devices will be shown in rows with a purple color. The Accept checkbox on the desired row is used to create a mapping to a topic. The topic is then entered on that row where the text box becomes available.

      If you want to edit other attributes then you will go to the Edit tab. Just click on the Ref button for the row of the device that has an association accepted to bring up the Edit popup for this device.

      It can also be done manually with the Edit tab, but now quite as easy.
      I've had no luck editing anything with the Edit tab (the popup, yes, but not the tab). I can change check boxes, but nothing sticks. And if I change the Subscribe Topic, a new device is created instead of just changing the topic that the existing device is subscribed to.

      Originally posted by Michael McSharry View Post
      What is important to note is that non-plugin devices have limited editing ability while mcsMQTT devices (created based upon a received topic) have full edit ability. You were on the right track to uncheck the MISC NO_GRAPHICS_DISPLAY checkbox. This will allow you to use HS Device Management to create graphics. For graphics to exist there needs to be a value-status relationship. This is created when the Edit tab Device Control Status/UI radio has Button or List selected. The relationships between a numeric value and the status display is then shown in the VSP row of Edit tab. mcsMQTT will keep track of received payloads and establish relationships or they can be entered manually. Look at the tool tip on the VSP checkbox if you want to do it manually or edit those that exist.

      If you are going to be editing graphic pairs then you will want to do this after everything else has been setup on the Edit tab. Changes in the Edit tab will generally cause all the properties in HS for the device to be reset. I changed this with 3.4.19.0, but did not submit it to the updater yet. It is at http://mcsSprinklers.com/mcsMQTT_3_4_19_0.zip if you cannot wait.
      Of course I couldn't wait! For reference, all of issues detailed in this post have occurred using 3.4.19.0.

      Creating a new device based on a Topic has proved very frustrating. I've attempted to create 3 devices by entering 3 different Subscribe topics on the Add/Edit tab. After some failures and just deleting everything and starting over, I was somehow able to create the first device, with a ref number of 323. However, when I created a second device using the Add/Edit tab (324), and then went to the Associations tab and clicked "Show Selected Associations", only the 323 device showed up, not the 324 device. I tried refreshing pages and unchecking/checking "Include Received MQTT Topics" to no avail.

      So, I went back to the Add/Edit tab and clicked "Delete Sub and Ref". This immediately created a new HS device with the next available ref number (325). That seemed to work, but when I created the next device (326), it did not show up on the Associations tab, but the device was created in HS. So I deleted 326 (Add/Edit tab), which unfortunately also deleted HS device 325, while at the same time created 327. Then when I went to the Associations tab again and clicked "'Show Selected Associations", ref 323, 325, and 328 were listed, BUT the HS Device list had devices 323, 327, and 328. When I clicked on the 325 REF button on the Associations tab, an Edit window popped up but had no data. I went back to the Add/Edit tab and entered each ref number - 323 brought up the 323 info, 325 errored with "325 is not a device reference", and 327 changed to 328 as soon as I clicked 'submit'.

      I hope what I've written here is understandable, since what's happening in the plugin is certainly very confusing to me.

      Again, thank you for your help (and the plugin!). It is much appreciated.

      Mike


      Comment


      • #4
        Of interest to HS is anything to which you wish to subscribe. If you have MQTT traffic about the uptime of a entity and you do not care how long a entity has been active then you would not associate this topic to a HS device, but you would if you care about if the entity has applied power to a water pump that you want HS to know the on/off state of the pump.

        I will need to go back to the edit tab operation to assess what you are seeing and what I may need to do to improve/fix it.

        Comment


        • #5
          Originally posted by Michael McSharry View Post
          Of interest to HS is anything to which you wish to subscribe. If you have MQTT traffic about the uptime of a entity and you do not care how long a entity has been active then you would not associate this topic to a HS device, but you would if you care about if the entity has applied power to a water pump that you want HS to know the on/off state of the pump.
          Yes, that makes perfect sense, but earlier you said this:

          Originally posted by Michael McSharry View Post
          In the first case the external entity will have published a topic that describes a behavior that is of interest in HS. This topic will be visible on the Association tab of mcsMQTT is the include receive devices checkbox at the top of the tab is checked. After the Show Selected Associations button is clicked the HS devices will be shown in rows with a pink color.The checkbox on the Accept column or the desired row is used to create the HS device that will be updated based upon changes in payload of the topic.
          What confused me about this is that at the time you made the statement, I was not able to create any devices that were subscribed to any topics. Therefore, I could not understand how the Association tab could list anything, since no devices existed. Indeed, it did not list anything. Now that I have created a couple of devices subscribed to topics, the list is populated (although, seemingly not accurately, based on my above issues).

          Originally posted by Michael McSharry View Post
          I will need to go back to the edit tab operation to assess what you are seeing and what I may need to do to improve/fix it.
          Thank you. I look forward to what you find.

          I tried one more time to create a third device, with slightly different results. I now have HS Device 329, which DOES display data from the humidity sensor after a HS restart, BUT it still does not show up on the Associations tab with the others (323 and 328).

          Mike


          Comment


          • #6
            I was able to get the new device (329) to show up on the Associations tab. I checked "Include Rejected Messages" and 329 showed up when I pressed "Show Selected Associations". When it showed up, I noticed that the "Reject" checkbox was checked for that device. I unchecked it, then unchecked "Include Rejected Messages" and it now seems to be working properly, showing up with the other two devices on the Associations tab.

            So, I was able to get all three of my devices created and working, but I feel there may still be some sort of a bug (or operator error on my part) causing inconsistent results when creating new devices.

            Mike

            Comment


            • #7
              I am glad you have got to a point of less confusion and able to proceed. I did the following to recreate a behavior that I think is similar to what you saw.

              Select Edit tab
              Enter Test/Topic in the Sub text box
              Edit page expands with green (plugin device) options, observe Ref box at the top as HS Device 1125 created
              Selected Button radio because wanted to create VSP/VGP relationships. HS Device VSP list show default of 0 Off and 1 On
              Added a third VSP in the text box "Flash=2"<submit>
              Unchecked the HS Device MISC Properties box NO_GRAPHICS_DISPLAY to allow adding VGP relationships
              Changed URL to HS Device Management from the HS View menu
              Adjusted display filters to include room "Test" so 1125 becomes visible
              Clicked device name "Topic" and then Status Graphics tab. Observe Values 0, 1 and 2. Observe "Device settings prevent editing/adding value/graphic pairs.
              Clicked Advanced tab and observe Misc Settings show No Graphics Display
              Go back to mcsMQTT Edit tab for device 1125. Confirm NO_GRAPHICS_DISPLAY is unchecked.
              Enter Test/Topic2 in Sub text box, page expands. Select Button, uncheck NO_GRAPHICS_DISPLAY. Device Ref is now 1126.
              Go to Device Management and observe that VGP edit is now allowed for 1125, but not for 1126.

              I need to look into why there is a lag in the MISC properties being updated for NO_GRAPHICS_DISPLAY

              Comment


              • #8
                I was able to correct the issue I observed when one starts with the Edit tab. The behavior did not occur when one starts from the Edit popup. If you would like to see if I covered all your difficulties then you can get it at http://mcsSprinklers.com/mcsMQTT_3_4_19_1.zip If you do not find any issues then I will submit to Updater this week.

                Comment


                • #9
                  Great. I will install the new version and run it through the paces. FYI, I was able to finish setting up my three devices with graphics ranges, etc., and get them completely working with my nodemcu board. Works great - very stable. However, I did have some additional challenges while making edits. I will create some new devices and makes some edits and document my steps for you to see if it's me or software issues.

                  Thanks!

                  Mike

                  Comment


                  • #10
                    Originally posted by Michael McSharry View Post
                    I was able to correct the issue I observed when one starts with the Edit tab. The behavior did not occur when one starts from the Edit popup. If you would like to see if I covered all your difficulties then you can get it at http://mcsSprinklers.com/mcsMQTT_3_4_19_1.zip If you do not find any issues then I will submit to Updater this week.
                    Yes, that problem is solved. Thank you!

                    Of the other two issues I had, one appears to be a Homeseer issue, not related to your plugin (and possibly a lack of understanding on my part).

                    The only other issue may or may not be by design. On the Edit/Add tab, my expectation is that the top (gray) section would be used to create a new device by entering a new Subscribe Topic and the bottom (green) fields would be used to edit an existing device. It seems to work that way for the most part, except for the 'MQTT Subscribe Topic' field in the green 'Edit' section. If I edit the Topic, a new device is created instead of editing the existing device and re-associating the existing device with the newly entered topic. This is quite frustrating after having set up all of the VSP and VGP relationships, etc., in the existing device, and having to recreate them in the new device. Since it is the 'Edit' section of the Edit/Add tab, I would expect it to re-associate the revised topic with the existing device.

                    If, for some reason, editing the topic is not possible, I feel that the 'MQTT Subscribe Topic' field should be made read-only to limit confusion.

                    Mike

                    Comment


                    • #11
                      I looked at this for awhile. I can see where somebody who changes the subscribe Topic would expect only the topic and not also the Ref to be updated. I can provide this capability. The implications are that the Association tab row would be updated to remove the Accept checkbox and a new Topic would be included in the Association tab the next time the page is built.

                      A similar situation exists with the Edit tab Ref text box. Does a new Ref entry mean that the user desires to Edit that new Ref or does it mean that he/desires to edit the Ref of the Topic that is currently on the page. The design intent was to use the Ref text box to locate a record and not used to edit Topic/Ref relationships.

                      Since I do not allow editing Subscribed Topic/Ref relationships by changing the Ref, then for consistency I should not allow it to be done by changing the Topic.

                      What this means is that there is no reason to have a text box for subscribe Topic in the green area of the Edit tab. It should only be a displayed value (read only) as you suggest.

                      I made this update in 3.4.19.2. http://mcsSprinklers.com/mcsMQTT_3_4_19_2.zip.

                      Thank you for your help. It is nice to get usability input, especially from those who are new to the plugin.

                      Comment


                      • #12
                        Originally posted by Michael McSharry View Post
                        The design intent was to use the Ref text box to locate a record and not used to edit Topic/Ref relationships.
                        Yes, as a newcomer, that would be my expectation.

                        Originally posted by Michael McSharry View Post

                        Since I do not allow editing Subscribed Topic/Ref relationships by changing the Ref, then for consistency I should not allow it to be done by changing the Topic.

                        What this means is that there is no reason to have a text box for subscribe Topic in the green area of the Edit tab. It should only be a displayed value (read only) as you suggest.

                        I made this update in 3.4.19.2. http://mcsSprinklers.com/mcsMQTT_3_4_19_2.zip.
                        That certainly makes it clear that one cannot expect to edit the relationship between a topic and a device.

                        So, does that mean it cannot be done any other way, either? So, if I enter a new topic, which creates a new HS device, and then I modify that HS device with all of the VSPs and VGPs, and any other customizations that I want, and then later decide that the topic is not what I want it to be, there is no way to change it? I understand that the answer may well be 'No', but I want to be sure I'm not missing something.

                        Originally posted by Michael McSharry View Post
                        Thank you for your help. It is nice to get usability input, especially from those who are new to the plugin.
                        It's my pleasure. I very much appreciate the work you've done to create the plugin and your quick and ongoing support. Anything I can do to help make it better, I'm more than happy to do. I'm enjoying learning what MQTT is all about.

                        Mike


                        Comment


                        • #13
                          you are correct about edit of the relationship. New relationships can be made and existing relationships can be broken. I think, but not positive, that all properties setip for a subscriber topic are retained do if Accepted later the setip will already have the customizations.

                          My design objective was to make the plugin point and click to the greatest degree as I feel this provides the most intuitive interface. That is why auto topic and device discovery is default and one normally starts from the Association tab to establish relationships.

                          Comment


                          • #14
                            Originally posted by Michael McSharry View Post
                            you are correct about edit of the relationship. New relationships can be made and existing relationships can be broken. I think, but not positive, that all properties setip for a subscriber topic are retained do if Accepted later the setip will already have the customizations.
                            Can you expand on "...[s]o if Accepted later..."? Is this something to do with adding a topic to an existing non-plugin device? I messed with that a little, but wasn't able to make it work (not a priority, just trying to understand it).

                            Originally posted by Michael McSharry View Post
                            My design objective was to make the plugin point and click to the greatest degree as I feel this provides the most intuitive interface. That is why auto topic and device discovery is default and one normally starts from the Association tab to establish relationships.
                            Yes, this is great. From the first time I did it, I've appreciated the device and relationship being created automatically.

                            Mike

                            Comment


                            • #15
                              From the Association tab you can toggle the Accept checkbox for a Topic. This will initially establish a Topic/Device relationship and then it will remove it. The next time the checkbox is checked the relationship will be established again, but a new Device Ref will be used. Since HS hands-out Device Ref numbers, mcsMQTT has no way to know that the Ref that was first used is available or if HS has assigned it to something else. It is possible the HS could reassign the same Ref back to mcsMQTT, but mcsMQTT can specify it.

                              When a Ref that is owned by another plugin is used from Association or Edit tabs then one of two things can be done.
                              The first is to make this a one-way publish on HS Device change. mcsMQTT will give a default publish topic that the user will need to edit as desired. The info is color coded in pink for this case.

                              The second is to then define a subscribe (control) topic from Edit tab. This will make a two-way relationship. The info is then color coded in blue. It is possible to edit the subscribe topic in this case to an already existing subscribed topic or to a new one. The Ref cannot be edited because it is assigned to another plugin. When a subscribe association is un-accepted to remove the association the Ref remains intact and continues to be available to the plugin to which it was assigned. This means it can be assigned to another MQTT topic is mcsMQTT the next time it is accepted.

                              Comment

                              Working...
                              X