Announcement

Collapse
No announcement yet.

Bug report and feature request

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

  • tfoutfou
    started a topic Bug report and feature request

    Bug report and feature request

    Hi mister , after a few days playing with the plugin and going deep in the rabbit hole , i found different issue and problems
    Here is what i found that might be interesting to look at

    (i am french so i would do my best to explain as best as i can , dont hesitate to ask back if something is not clear)


    FACT : my Mqtt payload are always number with a "." in them , i.e. (float) , never more than 3 digit after the point , and i see them perfectly in the Associations tab
    FACT : later on i switched to JSON payload to save bandwidth and CPU , payload always look like this {"V":230.2,"Hz"50.0,"A":0.056,"W":6.8,"Wh":507,"Pf":0.52}
    FACT : Express mode is never enabled because i have been having some problem with it
    FACT : all is running on local machine on windows 7 64


    first let talk about my use case , updating a bunch of HS devices with value from power meters that are connected to an arduino then processed as Mqtt payload
    for Voltage , Current , Power Factor and frequency , i only want to show them on individual Devices then no processing
    for Watt and Watt Hour , i would like to be able to use the numbers in event or something like that (not sure yet)
    So , "DeviceString" update is OK for the first part and then "DeviceValue" update for the rest to be able to use Events.
    i plan to use it more in the future , but this kind of thing take time



    BUG 1 : Whatever the setting for Express Mode is in the General tab.
    When you clic on the "Ref' button that is automatically created in the Association tab , the Express Mode is automatically switched to whatever the mode is selected
    in the General Tab
    the "e" column change , but the device seem to behave like it is still in the previous Express Mode , a refresh of the Association Tab dont bring back the mark in the "e" box
    the same behavior is observed if you access the device config via the Edit/Add tab

    BUG 2 : if you delete a Device/Topic , the topic is not rediscovered (forget this one , i have to investigate , it didn't do it anymore)
    BUG 3 : removing topic dont work on my system randomly , i may have to restart to plugin for it to work (and yes the broker is offline so the topic are not appearing by them self)
    ( i am aware of the command to remove full branch of JSON topic "topic#")
    BUG 4 : removed

    BUG 5 : if "Create both Parent full payload and Child JSON keys" is selected , the payload never update on the Association tab for the "parent" device
    while it is updating on the HS device list ( refer to BUG 7)

    BUG 6 : if "Decode Payload JSON into individual HS Devices" is selected then i understand the HS Parent device will not be created Nor updated
    but the Topic in association Tab must still be updated for controlling if the payload is indeed delivered to the plugin
    (except if express mode is selected for the unused parent then the lastdate and payload must not be updated , right ?)

    BUG 7 : the "parent" homeseer device automatically created by JSON option is not the one that we can see in the association page
    the "true parent" dont become a HS device and is always staying in the Association tab
    the "false parent" (the one created by the plugin) is not listed in the plugin anywhere , but it can still be updated by the plugin because
    we can see the JSON payload in HS Device list
    since it is a plugin device and for consistency the "true" and "false" parent should be a unique device dont you think ?

    Additionally the configuration for the "false" parent is not possible because it is not listed in the plugin tabs , so what is happening in the background ?

    Looking at the Advanced Tab in HS device page , i can see a MAJOR issue there , because the "Value" is growing by 1 every time a payload is received
    is it creating and storing VSP in the database every time ?? or is it just setting the value to +1 every time ?

    BUG 8 : linked to bug 7
    if Auto parent is created when adding a JSON device , and there is only one device associated with it , when you remove the device , the parent is still in the
    HS device list but what surprise me is that the parent is not updated anymore !! why ?
    what kind of link you have between devices ? you should really join the "false" and "true" parent on the same device for readability and simplicity

    BUG 9 : This one i pretty strange , and it took quite a while to reproduce it ( NOT REALLY A BUG SINCE A FIND A WORKAROUND)
    ONLY If in Express mode for a device ( a normal device with a normal topic , i didnt test this with JSON device)
    AND IF "Number" is selected in the Control/Status UI , THEN if the Number contain a float
    IT goes in the String of the device , while it is supposed to go in the device Value
    ( my float contain a point "." , the bug dont appear if i replace it with a "," BUT if not in Express mode the data is parsed as a Value if "." or "," , Why ?)


    FEATURE Request : a better way to remove obsolete topic , with a Button on the Association tab with a button for each maybe ?

    FEATURE Request : JSON decoding must be a choice per Topic (maybe not that important , because if you receive JSON you have to parse it somewhere anyway)

    FEATURE Request : show statistic in HS device , can you add a checkbox , to populate or not the corresponding devices in Homeseer , and a checkbox to create or delete the devices , this is because it delete the devices every time and it may be nice to dont do that

    FEATURE Request : a button in the device edit tab to remove all the VSP at once for a particular device

    FEATURE Req / QUESTION : a button in the device edit tab to NOT create the VSP automatically
    My problem is that i have a payload that can fluctuate quite a lot , and i get an infinity of VSP that i will never need
    if i check "Unspecified" it switch back on its own to "Text"
    Is the "Text" button doing just that ? i dont know because i still see random VSP popping in the list under


    QUESTION:
    i have a hard time finding detailed information about the other button in the manual as weel ?
    can you tell more about colorpicker and colorXY , if activated i dont see color control popping in HS for the selected device
    i also have a hard time understanding the button behavior , "number" is clear , but the other one seem confusing too
    can you help me please ?


    Thank you very much for reading my long post

    Hope you will understand everything and be able to help

    Bye


  • Michael McSharry
    replied
    Taken care of in 3.6.1.5 http://mcsSprinklers.com/3_6_1_5.zip

    Leave a comment:


  • Michael McSharry
    replied
    That is a good observation. I will need to fix Express mode operation in this area.

    Leave a comment:


  • tfoutfou
    replied
    i can agree on your vision , it is just that for express mode the payload is showed after the Regular expression has been applied

    Thanks

    Leave a comment:


  • Michael McSharry
    replied
    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.

    Leave a comment:


  • tfoutfou
    replied
    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 ?

    Leave a comment:


  • Michael McSharry
    replied
    Found the issue and fixed in 3.6.1.4 at http://mcsSprinklers.com/mcsMQTT_3_6_1_4.zip. 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.

    Leave a comment:


  • tfoutfou
    replied
    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

    Leave a comment:


  • Michael McSharry
    replied
    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.

    Leave a comment:


  • tfoutfou
    replied
    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 ?

    Leave a comment:


  • Michael McSharry
    replied
    I made updates in 3.6.1.3 that allows use of comma in numeric payloads. 3.6.1.2 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 3.6.1.3. 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 http://mcsSprinklers.com/mcsMQTT_3_6_1_3. I am also submitting to updater.

    Leave a comment:


  • tfoutfou
    replied
    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)

    Leave a comment:


  • Michael McSharry
    replied
    since payload is JSON "float" have to be with a "." else it will not parse correctly
    Correcting this JSON parsing was done in 3.6.1.2 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:	0
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:	0
Size:	12.3 KB
ID:	1295722



    Leave a comment:


  • tfoutfou
    replied
    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

    Leave a comment:


  • Michael McSharry
    replied
    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?

    Leave a comment:

Working...
X