iobroker-community-adapters / ioBroker.statistics

Statistics adapter for ioBroker (Avg, Sum, Min, Max, ...)
Other
15 stars 9 forks source link

some thoughts about (missing/wrong) UNITS #213

Open harvey637 opened 10 months ago

harvey637 commented 10 months ago

Hi, Example to describe my request: I activate a statistics datapoint to a datasource with the unit "kWh". In the statistics dialog there is no "feature" to manually add units nor is the unit taken from the origination datasource. So I have all the new data in the saved/temp tree with numbers, but no units.

New Feature (kind of important, because units are used eg. in echarts): Take the unit from the originating datasource, so activating statistics for eg. "Compressor Energy Consumption" with unit "kWh" actually knows about the units for the received numbers. grafik

Second part of the request: the defaults definintion for groups units of "e/kWh" or "€/m³" are shown for he costs, which is correct here.

But in the statistics datapoints for data in this group this unit is simply repeated. But the calculated value is not the unit of the definition but the costs. Example: "Energy Costs" are "0.42" "€/kWh" Than a member of the group with a consmption of eg. 2 kW will have costs of "0.84" "€" in the hourly calculation, and not "0.84 €/kWh" grafik

New feature: check weather the "consumtion part" of the costs are equal to the units of the datasource, if not You need to convert. eg. units are in "Wh", costs in "€/kWh" -> value(Wh) 1000 costs_unit(€/kWh) = costs(€)

If units are equal only the units in the group timeslots needs to be corrected ("€/kWh" -> "€")

Now You simply assume, that the numbers (which by now have no unit) are exactly the units of the costs_per_unit.

If anything is unclear please simply ask for clarification - Thank You!

cu Harvey

github-actions[bot] commented 10 months ago

Thanks for reporting a new issue @harvey637!

  1. Please make sure your topic is not covered in the documentation
  2. Ensure that you use the latest beta version (not the current stable version): 2.4.0
  3. Please attach all necessary log files (in debug mode!), screenshots and other information to reproduce this issue
  4. Search for the issue topic in other/closed issues to avoid duplicates!

    Otherwise this issue will be closed.

harvey637 commented 10 months ago

Hi Mr. Bot, you are very active! This also is a feature request, I did not find anything around this topic yet. And yes, IF You start covering this in a beta version I am glad to install and help you. cu Harvey PS: I think, a human being is also reading this :-)

harvey637 commented 10 months ago

Some additional info: You already used the type (boolean/number) to present different options for statistics. If it is a number WITH units copy the units into a field, otherwise use an empty field for entering a unit, or leave this field blank for no unit. (Do all number s have units? I guess yes, may be some are minutes or counts or percent ...)

Make the "costs/unit" mandatory to conform with calculated units to save the hassle from converting. But this might end up in trouble if different magnitudes of datapoints are put into one group, eg. consumption which is nativly in "Wh" togather with data which is nativly in "kWh". No too easy :-)

just thinking ...