lvogt / ioBroker.wireless-mbus

ioBroker wireless M-Bus adapter
GNU General Public License v2.0
6 stars 4 forks source link

objects written as "mixed" instead of "number" #123

Open kubax opened 1 year ago

kubax commented 1 year ago

The objects are written as "mixed" instead of "number" preventing (e.g.) sourceanalytix to calculate with the data.

Would you mind switching to numbers with units, instead of writing the unit to the object itself?

lvogt commented 1 year ago

The adapter uses numbers + units. However due how old the actual telegram parser code is, it generates in many cases "strings" because it truncates numbers to the amount of decimal places you would expect. Additionally there are quite a few combinations where you need to keep track of data type while parsing the raw data but this is just not implemented in the current parser code.

I am working for quite some time and from time to time ;) on a complete rewrite for the telegram parser, but I have trouble finding a approach which I am satisfied with. Whenever this will be finished the state type will probably be correct.

A possible workaround is using the alias adapter. However, I feel like this is actually an issue of sourceanalytix. The state is "mixed" - not string! As far as I remember from reading about this, when I was "forced" to set the state type, mixed means it can be either number, string, ... - So sourceanalytix should make an effort and try to parse the state into a number!

kubax commented 1 year ago

Thanks for the hint with the alias plugin, i got it working with that.

sadly it doesn't seem like sourceanalytix is willing to put an effort into parsing the mixed values. i just opened a ticket here, because i found a similar ticket from another guy on their repo, and they refused and refered to the plugin developer of the other plugin.

nevertheless i can totaly live with the alias plugin, and also i learned something new :)

i will not close this, because it is technically not closed, and i don't know if you want to keep track of it. But if you want to close it because you are aware of it and try to fix is sometime, i'll be perfectly fine with that.

Thanks again for you efforts!

lvogt commented 1 year ago

Glad to hear the workaround actually works ;)

We can leave this open as a reminder and "documentation" for anyone else with the same problem.