springfall2008 / batpred

Home battery prediction and charging automation for Home Assistant, supporting many inverter types
https://springfall2008.github.io/batpred/
107 stars 37 forks source link

Make the Predbat plan more configurable #782

Closed gcoan closed 1 day ago

gcoan commented 5 months ago

Is your feature request related to a problem? Please describe. Suggestion from the GivEnergy community forum that the predbat plan be user configurable as to the order of columns. Would like the order to specify the column sequence according to user preference.

Describe the solution you'd like New apps.yaml config item to define the column sequence for the predbat plan. Default to the existing, but user can set to their preferred sequence if they wish.

For example, the apps.yaml config could look like this: plan_display:

where:

Describe alternatives you've considered User can restyle the plan using CSS but this doesn't easily give the ability to change the sequence of columns

Maybe ability for users to have their own 'state' text/icons in place of the standard

Currency displayed in the total should be retrieved from the HA default, not hard coded to £

Additional context Alternative styled plan example: image

gcoan commented 5 months ago

Further idea for a config option:

only_show_effective_rates: false

Option to only show the effective rates (ie: including losses) not the actual rates if plan_debug is set to true.

pacemaker82 commented 5 months ago

Just to add - I created the alternative view of the table mentioned above as a custom card.

Screenshot 2024-02-25 at 16 00 53

I am taking the entity HTML predbat.plan_html and using javascript to iterate through the table HTML to change it to my liking, adding CSS, SVG and MDI icons. I am working on a second version which is pulling all the data out of the table into JS objects so that I can just have a table of the columns I want (in the order I want). Potentially this could be a solution where the columns and order I want are part of the card YAML. Will share if useful

pacemaker82 commented 5 months ago

I have this up and running now which allows me to set which columns I want and in which order. The formatting/CSS isnt done but gives a good sense of the kind of flexibility a card could have built in:

Screenshot 2024-02-25 at 18 03 53
pacemaker82 commented 5 months ago

I got this up and running now more fully

https://github.com/pacemaker82/PredBat-Table-Card

gcoan commented 1 day ago

Achieved now via the Predbat table card