No announcement yet.

Bug report and feature request

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    F....... i am so stupid ..... the problem was between the chair and the screen ....

    i forgot to check "Decode JSON into separate HS Devices " in "Express Mode Features"

    i am soooo sorry to have wasted your time on 10# , just tried again , the "bug" didn't exist if i check "Decode JSON into separate HS Devices"

    and honestly now that i have had the opportunity to check how it was working , i would say that i prefer the previous behavior , i am so sorry again

    i like the fact that :
    -the parent is not being deleted when any of the child is selected as a Express Mode
    (obviously to save CPU you seem to have already disabled value and payload update in HS when any child is in Express mode )

    - the ability to NOT select every child as Express mode (can be useful in my use-case where i want to store only Watt-hour in database and display the rest as string)

    BUG #11
    Since the Last update , a new bug is introduced , i am not 100% sure tho
    The RegEx Match/Replace pattern is not working on any device that is in Normal mode , however it is perfectly working in express mode
    exemple Payload {"V1":230.2,"V2":230.2,"Hz1":50.0,"Hz2":50.0} RegEx Match \. RegEx Replace ,

    i tried to send payload with coma instead of dot , but not sur how to format it correctly tho

    this {"V1":230,2,"V2":230,2,"Hz1":50,0,"Hz2":50,0} --> plugin payload column is only showing the integer and discarding the decimal , regardless of "text" or "number"

    this {"V1":"230,2","V2":"230,2","Hz1":"50,0","Hz2":"50,0"} --> plugin is not recognizing topic name anymore , it detect a coma in front of the topic after the first one
    --> Topic V1 ,V2 ,Hz1 ,Hz2 showing only the integer

    Thanks again dude , hope to not bothering you too much


    • #17
      The decision for Express vs. Full is made at the Topic level and not the Payload level. Once any items from the Topic is assigned as Express then all items for that Topic also need to be treated as Express. While it may have appeared differently in this has always been the case.

      I have Obsolete on a item basis implemented. I am also moving toward some form of Parent/Child considerations on the Association tab

      I will look at #11 and address it if I find something wrong.

      I like the feedback. This gives me perspectives/expectations that I would not have otherwise known.


      • #18
        I believe everything in your wishlist has been incorporated in See


        • #19
          nice feedback , i just installed to try it

          preliminary testing show that BUG #11 is still not fixed

          currently reviewing the rest

          EDIT : the parenting behavior is like a dream now , not deleting the parent when Express and all

          EDIT 2 : Clear existing VSP and "O" column is awesome


          • #20
            I have evaluated the regular expression and found no issue. I started with payload "ABC,X". Use regex match of ,X and replace with null. HS device shows ABC. Can you provide your test case that is not working for you?


            • #21
              Fact : payload is JSON , didnt have the time right now to test with a direct payload

              it is the opposite way i try to convert dot to coma , since payload is JSON "float" have to be with a "." else it will not parse correctly
              Then i try

              Payload RegEx Match Pattern \.
              Payload RegEx Replace Pattern ,

              if the device is set to express mode , then the conversion is happening fine (i can even replace the coma with any Character that i want) , BUT if the device is in normal mode the conversion didnt happen

              this is a problem , because if i want the value to be treated as "number" , the device does not update , because HS is expecting a coma in the "float" , and a dot is not OK

              I can modify my Payload to have the Coma directly in the values but i dont know how to format it , can it be done OR it have to be a Dot ?
              testing by simply replacing the Dot with a Coma did not work


              • #22
                since payload is JSON "float" have to be with a "." else it will not parse correctly
                Correcting this JSON parsing was done in so that should no longer be an issue. If it is then give me the exact payload you are using so I can replicate.

                For my test I used JSON payload starting with {"identifiers":"840d8e383244.X", ....

                Device 1330 was created in regular mode and regex setup as screen snipit

                Click image for larger version

Name:	Capture.PNG
Views:	18
Size:	16.2 KB
ID:	1295721

                What shows up in the HS device is below. Note the period was changed to comma

                Click image for larger version

Name:	Capture2.PNG
Views:	17
Size:	12.3 KB
ID:	1295722


                • #23
                  as explained in previous post my payload is pretty simple {"V1":230.2,"V2":230.2,"Hz1":49.9,"Hz2":50.1}

                  my configuration is 100% similar to yours , and i see the same things

                  the only problem is i think related to Express mode - > if express mode in ON , all is OK

                  as soon as i uncheck express mode i get the payload with a DOT and regex are ignored ( we can see the payload directly in the payload column in association tab)


                  • #24
                    I made updates in that allows use of comma in numeric payloads. had fixed the use of comma in text payloads. I tested both JSON and non-JSON payloads with comma and decimal with and without Regex. I also handled white space in If you continue to have problem with non-Express then I can add debug to see why your situation is different than mine.

                    It is at I am also submitting to updater.


                    • #25
                      Comma for float inside payload is now parsed fine , no truncated decimal or anything -> this mean i dont even have to use Regex in the plugin to be able to use it as "number" or as string with a comma

                      (dont know if it is region related or not , but HS3 need a comma to be able to accept the data as a "value")

                      But , Regex is definitely not working in Normal mode : ( it might be a problem for some user)
                      I tried to replace the comma with a letter (X for the exemple) so the payload become {"A":0X149,"W":4X2,"Wh":54X7,"Pf":0X11,"VA":39X0}

                      no matter what is chose to replace from OR replace with , as soon as i activate Normal Mode , the data is not processed in the Regex logic and is displayed as is.
                      if i use Express mode in can replace my "X" with any other character that i want.

                      i hope this help understand the problem better ?


                      • #26
                        What are your settings for JSON decoding (payload only, into individual devices, or both parent and child devices in HS?) Does your express mode allow JSON decoding (on General Tab)?

                        ​​​​​​​The regex is applied to child devices or parent device, but not both. In express mode there are no parent devices that are populated. Not having to deal with HS parent/child relationships is one of the things that reduces express mode times.


                        • #27
                          Json settings is "both" , i just tried with "individual devices" -> same result ( regex is executed only when in express mode)

                          yes i did not make the same mistake again , Json for express is enabled of course and "Process regular and arithmetic expressions " is enabled too
                          if i disable "Process regular and arithmetic expressions " , Regex is not executed (logic here ahah) and i got the same result as in Normal mode

                          result is always the same , regex is not evalutated when Normal mode is enabled

                          to be sure , i just created a Normal topic with just a radom number in it with 2 decimals
                          example 1 : 2154.54 match \. replace Z result : 2154Z54
                          example 2 : 152A25 match A replace , result : 152,25

                          the same bug is happening , the DOT (or any other character -> example 2) , is never changed by the Regex expression , if i enabled express mode the Regex is applied and working perfectly


                          • #28
                            Found the issue and fixed in at Did not see it before because testing in the debugger had actually left me in express mode all the time for the topic I was using for the test. Thanks for persisting.


                            • #29
                              Happily helping to track bug or forgotten piece of code

                              it is working now

                              one last detail , in the association tab , in the payload column , the showed payload is the one before regex is applied while in express mode it show the "converted" payload
                              for consistency can you make it show the payload after regex ?


                              • #30
                                I think I will decline on the payload matching the HS device. I consider it a debugging/understanding aide to show what is actually received in the MQTT payload. The HS device contains how the user wants to apply the MQTT payload. The transformations between MQTT and HS can be text, numbers or a combination of both. If I don't show the raw payload then the user is missing what useful to help understand the flow and assist with development of their text/numeric expressions as well as see what is being published.