Announcement

Collapse
No announcement yet.

Version 3.2.x.x

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

    The following is a typical debug flow. The printer message was Accepted for Device 2372 with new text of "Opening serial port"
    HSEvent of type VALUE_CHANGE was given. This shows that HS Device was updated.
    The third line shows that message received at the time it was being evaluated as an event trigger.

    Code:
    4/11/2018 6:19:11 AM	41828959	| Update Accepted 2372 to Opening serial port  
    4/11/2018 6:19:11 AM	41828967	| HSEvent Do= False VALUE_CHANGE for Device 2372  
    4/11/2018 6:19:12 AM	41829373	| ActoOnMessageFor Trigger Topic mpsmoctoprint/event/PrinterStateChanged,Payload={"_timestamp": 1523441951, "state_string": "Opening serial port", "_event": "PrinterStateChanged", "state_id": "OPEN_SERIAL"}
    When I look into mcsMQTT.db for Device 2372 I find the StatusType = 4 which means that mcsMQTT thinks this is a List type. What you should see in VSP tab of the HS Device Management page is the mapping of the eight states to the Values 0 through 7. Please confirm.

    What this means is that when the above message was received with text of "Opening serial port", mcsMQTT will store a Value of 0 in Device 2372. When HS displays the status of this device on the Device Management page and elsewhere it will do the lookup of the VSP to find a Value of 0 means it should display "Opening serial port". mcsMQTT does not find graphics for these states, but if you do have graphics for them then they can be added to the VGP definitions that are just below the VSP definitions.

    You can further look at the Advanced tab of the Device Management page for this device. It will show the actual Device Value and Device String that are stored in the Device. These should be what mcsMQTT stores.

    I recognize that your printer state may not be in the "Opening" state now, but whatever state it is in should follow the description above. What do you actually see in Device Management for Device 2372?


    When I look at the "filename" I see that it is mapped to Device 2382 and is of status type Text from mcsMQTT.db. This is consistent with your screen shot. From the debug I find the message with text "Knob_PLA.gcode" to have been recognized. What I do not see is the HSEvent callback.

    Code:
    4/11/2018 6:19:22 AM	41840086	| Update Accepted 2382 to Knob_PLA.gcode  
    4/11/2018 6:19:23 AM	41840292	| ActoOnMessageFor Trigger Topic mpsmoctoprint/event/PrintStarted,Payload={"origin": "local", "_timestamp": 1523441960, "_event": "PrintStarted", "name": "Knob_PLA.gcode", "file": "/home/pi/.octoprint/uploads/Knob_PLA.gcode", "path": "Knob_PLA.gcode", "filename": "Knob_PLA.gcode", "size": 9063176}
    The code segment that follows the "Update Accepted" message in the debug is below. Previously it had determined that 2382 is a mcsMQTT device and obtained nHSValue as the current DeviceValue for this device. It will always set DeviceValue, but perhaps the callback does not occur when the DeviceValue does not occur such is the case here. The DeviceString is only updated if it changes.
    Code:
                            ElseIf iVGP = StatusTypes.Text Then
                                Dim sString As String = hs.DeviceString(iRef)
                                bValueChange = sString <> sValueIn
                                If bValueChange Then
                                    hs.SetDeviceString(iRef, sValueIn, False)
                                End If
                                hs.SetDeviceValueByRef(iRef, nHSValue, True) 'so devicevalue trigger can be used
    Where are you looking when you expect to see "Knob_PLA.gcode" and "Opening serial port"?
    Attached Files

    Comment


      Hello Michael,


      Thanks for this fantastic plugin.
      I have installed version 3.0.9.0
      Now i want to upgrade the latest version.
      But when I do that. All my devices are gone. Within this plugin
      Is there a way to use my devices with version 3.2.?.?

      Thanks in advanced
      Ed

      Comment


        Shouldn't the payload (string/value) still show somewhere in the HS device? I seeing the payload in the PI setup, but not in the HS device.

        .
        Attached Files
        RJ_Make On YouTube

        Comment


          It should be in the Status column on the page you are showing. Look at the Advanced tab for this device to see what is actually stored in Value and String.

          I also noticed in your debug an error that I think I fixed in 3.2.14.3 so would be good to update and post your debug file again so I can confirm it is corrected. I do not think it is related to showing text in Status column.

          Comment


            Just to be clear, the event is firing using "just had its value set or changed" so we are good to go there. I just need to figure out why the string is not displaying anywhere in the HS device.

            Logs attached.
            .
            Attached Files
            RJ_Make On YouTube

            Comment


              Look at the VSP tab on Device Management. It looks to me as if this is operating like a list rather than as text. There should be no VSP definitions for text. If you have them then remove them. Let me know so I can fix the software if this is happening.

              You debug also looks clean. No errors with collections being modified.

              Comment


                Originally posted by Michael McSharry View Post
                Look at the VSP tab on Device Management. It looks to me as if this is operating like a list rather than as text. There should be no VSP definitions for text. If you have them then remove them. Let me know so I can fix the software if this is happening.

                You debug also looks clean. No errors with collections being modified.
                You nailed that one on the head. There were several 'files' when I selected the "List" option. I deleted them and tried again, but unfortunately the HS device is still not displaying the text.

                .
                Attached Files
                RJ_Make On YouTube

                Comment


                  I noticed a bug with HS in that it remembers the initial device properties for VSP even after the user edits them. I will update the plugin to fix the initial creation. You will then just need to remove the check on the Accept and then check it again. It will be a new Ref number, but everything else will be the same.

                  This may also mean the a different approach needs to be used when the user changes the mcsMQTT Control/Status type as I may need to delete and recreate a new device.

                  It is in updater at 3.2.15.1

                  Comment


                    So I unticked and then reticked "A" for those 2 devices. Moved to the Manual tab, noticed it defaulted to "list". I changed them to "text".

                    Now the devices update the text properly, but I'm back to where I started not firing events..


                    Never mind, I think I found my mistake. I think all is good now..
                    Last edited by ServiceXp; April 12, 2018, 06:05 PM.
                    RJ_Make On YouTube

                    Comment


                      updated to latest version. tried clearing accept and checking again but device string no longer updates.
                      Attached Files
                      https://forums.homeseer.com/forum/de...plifier-plugin

                      Comment


                        o I unticked and then reticked "A" for those 2 devices. Moved to the Manual tab, noticed it defaulted to "list". I changed them to "text".

                        Now the devices update the text properly, but I'm back to where I started not firing events..
                        I previously posted an analysis of your mcsMQTT_Debug.txt file where it shows Value Change events producing a callback. The callback did not occur unless the Device Value changed. I can go back to incrementing the Device Valaue when the Device String is stored, but it seems to me you were also having trouble then.

                        updated to latest version. tried clearing accept and checking again but device string no longer updates.
                        Take a look at the Manual tab for a Device of interest. Do you have the Text or is the List selected for Status/Control UI? If you change it to Text and toggle Accept it should give you what you want.

                        What I have observed is that HS3 remembers VSPs even when they are deleted from Device Management VSP tab. This causes the Status to be displayed based upon the old VSP definitions rather than the String.

                        For example, I have a Device that has On & Off buttons and these were setup with VSP and VGP. I then delete the VSP and VGP definitions using Device Management and change it from Button to Text in mcsMQTT. If I send payload "On" or "Off" it gets stored in the DeviceString. I can see from Advanced tab that the String does have "On" or "Off", but HS still uses the graphic from the deleted VGP to produce status. If I write a new text value (.e.g. "Other") in the string that was not previously defined with VSP then it will show the String and no graphic.

                        Because of this HS behavior I may need to not define VSP for text values unless the user explicitly asks for them. Play around with what you have and give me your recommendations.

                        Comment


                          Michael,
                          I think I'm good, I found a mistake I made and it seems to be working as expected.

                          Thanks!
                          RJ_Make On YouTube

                          Comment


                            Originally posted by Michael McSharry View Post
                            I previously posted an analysis of your mcsMQTT_Debug.txt file where it shows Value Change events producing a callback. The callback did not occur unless the Device Value changed. I can go back to incrementing the Device Valaue when the Device String is stored, but it seems to me you were also having trouble then.



                            Take a look at the Manual tab for a Device of interest. Do you have the Text or is the List selected for Status/Control UI? If you change it to Text and toggle Accept it should give you what you want.

                            What I have observed is that HS3 remembers VSPs even when they are deleted from Device Management VSP tab. This causes the Status to be displayed based upon the old VSP definitions rather than the String.

                            For example, I have a Device that has On & Off buttons and these were setup with VSP and VGP. I then delete the VSP and VGP definitions using Device Management and change it from Button to Text in mcsMQTT. If I send payload "On" or "Off" it gets stored in the DeviceString. I can see from Advanced tab that the String does have "On" or "Off", but HS still uses the graphic from the deleted VGP to produce status. If I write a new text value (.e.g. "Other") in the string that was not previously defined with VSP then it will show the String and no graphic.

                            Because of this HS behavior I may need to not define VSP for text values unless the user explicitly asks for them. Play around with what you have and give me your recommendations.
                            I enter the device number at the top of the manual tab and tick the text tab but the setting doesn't stick. I cant get my device to display the string value anymore. I'm not sure what I'm doing wrong.
                            https://forums.homeseer.com/forum/de...plifier-plugin

                            Comment


                              The device number is used for non-plugin devices. These are the pink rows. For plugin devices, which are the green rows, the subscription topic is where you start. Once the topic is entered the remainder of the the table is filled out.

                              I need to put a feedback when plugin device references are attempted to be used for non-plugin devices.

                              Comment


                                I added provision to use the Ref to specify any Device. If it is a plugin device then the lower table will be populated. If a nonplugin device then it will be the top table. It is 3.2.16.2.

                                Comment

                                Working...
                                X