MindFreeze / ha-sankey-chart

A Home Assistant lovelace card to display a sankey chart. For example for power consumption
MIT License
348 stars 15 forks source link

"min_state" with prefix #161

Closed iNaiks closed 4 months ago

iNaiks commented 5 months ago

Checklist:

Release with the issue:

Last working release (if known): 1.20.0 Browser and Operating System: Safari - MacOS 13.0.1

Description of problem: Testing to set te "min_state" of the card I see that if I put a number 1 the minimum state is 1000 of the number of the entities. But if I remove the "unit_prefix" the numbers on "min_state" are the same of the numbers of the entities. But in this case the numbers showed in the card are complete (with [unit_prefix: ''] -> 1000W // with [unit_prefix: 'k'] -> 1kW) and I want to keep the numbers with 'k' but control the "min_state" with the number of the entities (not the number with 'k').

Same for set the color of the limit. If I remove the prefix, I can set a number like 550 and when the value of the entity is above or below 500 changes the color. If the prefix is 'k' I can only set a number like 1 for change when the value is above or below 1000 and can't set a number with "," or "." for example to set it to 5.5 (for 550 value of the entity)

Thanks Niks

Javascript errors shown in the web inspector (if applicable):

Additional information:

MindFreeze commented 4 months ago

This is by design. min_state and color_limit should be set based on what you see in the chart. If you see kW, you set kW. Almost no one uses Wh for example and you would need giant numbers if you are dealing with MWh and are forced to set your options in Wh. I just tested it and fractions work fine. Checked the code too. If you want 550 W, thats 0.55 kW

MindFreeze commented 4 months ago

Just saw the UI editor doesn't allow fractions. This will be fixed in the next release