ioBroker / ioBroker.echarts

Show all history data in one GUI
Apache License 2.0
20 stars 4 forks source link

TRUE (on the y ticks 1,2,3,4 ....) are displayed #257

Closed GermanBluefox closed 1 year ago

GermanBluefox commented 1 year ago

when showing the units (y axe position=left) the words FALSE (on the 0 position) and TRUE (on the y ticks 1,2,3,4 ....) are displayed.

Only FALSE and TRUE once should be shown.

harvey637 commented 1 year ago

Hi @ Bluefox yeeees, but :-)

I have some booleans that are displayed with small hight, like to show the state of a window, where my main interest is in temperatures and so on. So I scale the boolean from e.g. 0 to 20 so the line (or area with filled color and line_size=0) only covers a smal part of the chart.

Then it might be an demanding task where to display only ONE y-axis-tick with the work "true". For me this is not so important as booleans as I use them are never with units on the y-axis.

But displaying only one "true" on the hight of the "scaled to max" y-tick is perfect.

Thank You! cu Harvey

harvey637 commented 1 year ago

Still remember my question/enhancment #90 to "rename" booleans to something better fitting, like "true/false" -> "open/closed" or "true/false" -> "running/stopped"

just if you are on that corner .... Thank You cu Harvey

GermanBluefox commented 1 year ago

Still remember my question/enhancment #90 to "rename" booleans to something better fitting, like "true/false" -> "open/closed" or "true/false" -> "running/stopped"

just if you are on that corner .... Thank You cu Harvey

Like this? image

harvey637 commented 1 year ago

Perfect, will Check Out with real Chart later with npm Download 1.4.6 .... thank you !!! cu Harvey

16.02.2023 18:51:59 Bluefox @.***>:

Still remember my question/enhancment #90[https://github.com/ioBroker/ioBroker.echarts/issues/90] to "rename" booleans to something better fitting, like "true/false" -> "open/closed" or "true/false" -> "running/stopped"

just if you are on that corner .... Thank You cu Harvey

Like this? [https://user-images.githubusercontent.com/4582016/219447534-d9df7629-c07c-4484-8ddf-e81e2bea6691.png][image][https://user-images.githubusercontent.com/4582016/219447534-d9df7629-c07c-4484-8ddf-e81e2bea6691.png]

— Reply to this email directly, view it on GitHub[https://github.com/ioBroker/ioBroker.echarts/issues/257#issuecomment-1433483089], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ACNPTCXGQKCDFP26JBWBOWLWXZSL5ANCNFSM6AAAAAAU6GCMJ4]. You are receiving this because you commented.[Verfolgungsbild][https://github.com/notifications/beacon/ACNPTCWFQ4CUPCWFFEIACN3WXZSL5A5CNFSM6AAAAAAU6GCMJ6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSVOE3VC.gif]

Bernd9000 commented 1 year ago

Text bei falsch wird in der Legende nicht angezeigt ?

harvey637 commented 1 year ago

seems to me that "true" and its replacement is "stable" displayed, while "false" AND the replacement IS there sometimes, but vanishes after some time by mistery.... cu Harvey

harvey637 commented 1 year ago

Hi, from my idea a boolean is always true or false and not null :-) Inside the influxdb I only have values of true and false .... never anything else.

But I have the idea that you read the states from the device directly??? This came into my mind with the closed problem, when opening of a windows IMMEDEATELY changed the chart to ok. With influxdb the value is written into db only with a short delay. But this was immedeately, not with a delay. I changed too much in the echarts-definition, but I am shure that it was always "from influxdb.0" instance ...

harvey637 commented 1 year ago

I confirm that I have: closing a windows gives "[geschlossen]" immedeately reloading the browser window now shows only empty brakets :-( data comes from "influxdb.0" not "default" datapoint inside the database is "false"

If you give me some direction how to see the value inside the program I can try to test, opening, closing windows, reloading firefox seems easy ...

cu Harvey

harvey637 commented 1 year ago

repeatable!

harvey637 commented 1 year ago

when I click on the 3 1/2 lines button right of the datapoint-ID the value shown is correctly "false"

grafik

but the legend shows only brakets ....

uelpenich commented 1 year ago

seems to me that "true" and its replacement is "stable" displayed, while "false" AND the replacement IS there sometimes, but vanishes after some time by mistery.... cu Harvey

The same for me (I use Mariadb database):

GermanBluefox commented 1 year ago

Fixed in 1.4.7 (wait for it)

uelpenich commented 1 year ago

Bingo. Funktioniert wie vorgesehen. Danke für die Nachtschicht.

harvey637 commented 1 year ago

Hi, working!

small issue: when sizing a boolean, so that the resulting line is relativly small hight the "upper" text is not displayed at the y-axis, although there is plenty of room.

Not really important as y-axis is never used (by me) with booleans, I am happy with the (replacment) text in the hover.

to be closed - Big Thank You to Bluefox

GermanBluefox commented 1 year ago

Hi, working!

small issue: when sizing a boolean, so that the resulting line is relativly small hight the "upper" text is not displayed at the y-axis, although there is plenty of room.

Not really important as y-axis is never used (by me) with booleans, I am happy with the (replacment) text in the hover.

to be closed - Big Thank You to Bluefox

Screenshot?

harvey637 commented 1 year ago

this is with min/max 0-7, text is replaced correct: grafik with min/max 0/1 the text is in the upper left corner

grafik

with min/max 0/7.4 the true-text is displayed (about 8 times textsize above the false-text), with min/max 0/7.5 it is gone.

harvey637 commented 1 year ago

grafik

also with multiple texts, left is ok with max=7.4, right is missing some texts with max=7.5

grafik

by the way, the first letters of "unknown" and "hot water " are missing in the chart, not only in the screenshot :-)

harvey637 commented 1 year ago

after some testing I found that it has to do with the ticks of the y-axis. I manually set the tick to 14 I get all texts correctly. grafik

So it looks like an 7.5 ticks implicitly if no input in this field grafik

So this is not really a BUG, but strange. The y-ticks are from the first datasource line I assume, so edited ticks from later lines are not visible .... only with this strange side effect. grafik

With a different firrst line the background grid of the chart is take from this line (temperature with no extra input on y-axis ticks). with manual large number of ticks for the now second line with the enumerations the text is also displayed.

So it is NO BUG IMHO, but some learning about y-axis ticks that are not displyed, but used for the text on the axis. Text (or numbers also!) are only displayed on ticks, so if automatically more enums as ticks some are hidden, even if the y-axis ticks for this line is untouched.

I learned a lesson, can be closed! Maybe a notice in the documentation ....

harvey637 commented 1 year ago

grafik

My test even work with min/max = 0/60 with y-tixks of 42! text is still ok! WOW, also with 100 and 72!

really my fault/ not understandig, thank you. sorry for eating your time. cu Harvey

uelpenich commented 1 year ago

The width of the y-axis is not dynamic for boolean or enum data sources, but for numeric sources (?). Is a dynamic y-axix width easy to realize with the echart package? It is just a "nice ho have". May I remember my proposal for an enhancement "multiple y-axis issue #42"? It is useful for diagrams with datasources with more than three different units or scales. Thank you.

harvey637 commented 1 year ago

HI @ uelpenich remember there is no "enum" datasource, only boolean and number.

booleans can have units (in the homematic definition), but that makes no sense to me (I did not find any example yet) booleans are false/true, but boolean variables from homematic can have different (status-)text for "true" "false" (eg. "raining", "no rain") booleans look like autoscaling to a scale of 7.5 ticks IF not manually overridden (y-axis ticks)

numbers can have units, some dont (eg. UV-Index) numbers can have status texts, which is declared in the datapoint source. "enum" variables from the homematic are this kind of number, also this implicates integer (the index to the position) and status-texts (eg. "0:off";"1:heating";"3:cooling";"4:defrost") numbers can autoscale (also around ~8 ticks maximum if autoscale) Sometimes "enum"-numbers from commercial HomematicIP devices (Wandthermostat) sadly are numbers only, no status text :-( .SET_POINT_MODE is a number min=0, max=3 without statustext, so hopefully 0 means normal, 1 means holiday? 2??? 3???

so sadly there are no real "enums" in echart datapoints :-(

I often have different y-axis, eg temperature and humidity. Than I manually set the min/max of the first datasource to something so I get defined y-axis ticks eg 6 Ticks with temperature from 10°C- 35°C (right unit) and humidity from 0% - 100% (left unit). Which magically shows units of 0%, 20%, 40%, 60%, 80%, 100% on the left on the y-gridlines for 10°C, 15°C, 20°C, 25°C, 30°C, 35°C with units on the right. I am quite happy with this, altough sometimes it is not so easy to find good min/max and count of ticks. (I switch from 6 y-axis ticks to 11 y-axis ticks then)

Few y-axis and few y-grindlines might look ok with 2~3 but tend to look confusing with more IMHO.

So if this a "nice to have " for you may be that my usage of coincidently resusing the y-gridlines with left/right units might be easy to use and do not need any programming. just my idea :-) cu Harvey

uelpenich commented 1 year ago

HI @ Harvey, thank you for your detailed answer and explanations.

. . . (in the homematic definition) . . .

for me it looks like that iobroker is build around homematic features. While I don't use homematic but knx, OWFS and vcontrol adapters, I have some difficulties to understand this thread.

Since the vcontrol adapter also delivers some enum information (like Betriebsart, . . .) I would be glad to show them in charts. Unfortunetly the vcontrold together with the viessmann adapter convert the enum information to text strings, and text strings can't be displayed in echarts. I can configure vcontrold to deliver the information as number as it is the original information delivered by the Viessmann heater interface, but the number is not accompanied by state information as it seems to be in some homematic devices. (you described the same problem with some HomematicIP devices (Wandthermostat).

so sadly there are no real "enums" in echart datapoints :-(

Do you see any way to add the state definition to the object description of the data point? I would prefer to use the linked devices adapter to keep the additional state info.

. . . I often have different y-axis, . . .

I do it the same way, but this means I have to remember in my mind some scaling info. That means others than me are not able to understand the chart.

. . . altough sometimes it is not so easy to find good min/max and count of ticks. . .

I have a chart of my heater where I cant find suitable scaling factors and therefor my request is more than "nice to have".

Few y-axis and few y-grindlines might look ok with 2~3 but tend to look confusing with more IMHO.

You are right.

Thanks Uelpenich

harvey637 commented 1 year ago

Hi, I guess you are not active in homematic forums, because iobroker issues is not the right place.

Some information on how the information is fetched from homematic objects can be found inside examples and please read the objects from iobroker.echarts.

Minimal entry can be:

Just edit thing, save, check the saved objects. Maybe you can find a lot of information. But remember, this is NOT what echarts was made for, so a lot of things can change without any notice, this is no officail api to do so!!!!!

good luck Harvey

uelpenich commented 1 year ago

Thank you for your hints, I got it working by adding common.states definitions to a data source object.