Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in battery #23

Closed
danjenkins opened this issue Jun 27, 2019 · 50 comments
Closed

Add in battery #23

danjenkins opened this issue Jun 27, 2019 · 50 comments

Comments

@danjenkins
Copy link

If we have battery in/out figures could this component be updated to include battery too?

Like the tesla one

Screen Shot 2019-06-27 at 17 29 06

@gurbyz
Copy link
Owner

gurbyz commented Jun 28, 2019

Thank you for this feature request. It has been asked before also. Not that I will process this immediately, but if you can share (Q1) an example of the extra sensor data (e.g. is it 1 or 2 sensors c.q. what does a positive value mean) that would be helpful for implementing (some time in feature, maybe, no promises ;-) ).

And I don't own a battery myself, so it would be interesting to know (Q2) if people could have 'other lines in the diagram' as well. I'd rather hope not (because I like the simplicity of your diagram) but I can image people saying 'my setup requires a line drawn from solar to battery directly'.

What if the battery doesn't have power anymore to support the house? (Q3) Will there be a line between grid and house directly? Or could it be that for some setups there will be a line between grid and battery?

Questions, questions, maybe I should get a battery first. Haha. :-D

@danjenkins
Copy link
Author

Good questions! Let me have a think but more than happy to send you data etc :) I'll have a think about the other questions!

@schwarzenbergf
Copy link

Good job, Gerben! I like your way to keep it simple.
Anyhow, a battery is really required in this scenario (and will be more and more in the future).
Because in future the main goal (in my opinion) will be optimizing of self-consumption (and not 'feed-in'). Increasing self-consumption works only with batteries.
So, in my setup (with 28 kWh batteries) I'm stand-alone (no grid consumption) for 9 month a year (in Germany).
And I would be glad if I could use your great card.
So, in addition to the existing flows I would see the following with a battery included (Q2):

  • PV --> Battery
  • Battery --> House
    In very rare cases this one is at least possible (but not relevant):
  • Grid --> Battery (charging the battery from grid, battery maintenance f.i.)
    That's all (I guess).
    Q1: there is one additional sensor (battery power: + means to battery (charging), - means from battery (discharging)
    Q2: see above
    Q3: not enough bat power: flow can be from grid , PV and/or bat to house.

Let me know if I can be of help.

@gurbyz
Copy link
Owner

gurbyz commented Sep 18, 2019

Thanks for your thoughts and answers about adding a battery to the card.

I'm not sure if just one extra battery sensor will give enough information to display all 3 extra lines. If I would make an early version of the card that supports a battery I would start with only House --> Battery and Battery --> House. That suits the most to the physical sensor setup. A then use that as a starting point to improve it further.

Q4: Do you also have a sensor (apart from the one in kW) that measures energy (in kWh) for charging/discharging the battery? Because those kind of sensor(s) would be needed for the 'energy view' of the card.

@danjenkins
Copy link
Author

Sorry for not getting back to you on the above a while back!

on Q4 - Yes and no - the tesla local api gives you a % full. However if you know that each powerwall is 13.5kwh of storage you could work it out and put that into another templated sensor.

@schwarzenbergf
Copy link

House --> Battery and Battery --> House would be completely OK.
I think for this card we don't need more.
Q4: At the moment there is no such sensor for the battery (kWh). Could be done in Home Assistant (Template Sensor) or, as @danjenkins proposed, using the SoC (State of Charge), which is available.
Just show the battery power and the SoC with the bat icon. At the energy view showing SoC instead of kWh would be OK for me.
Thank you!

@gurbyz
Copy link
Owner

gurbyz commented Sep 18, 2019

On the dev branch is version 0.0.16-dev which has some very basic support for a battery now. You have to install it manually from GitHub. Please, switch on the debug: true parameter of the card to be able to check if you installed the dev version correctly and that you are not fooled by a cached version in your browser.

See here for troubleshooting: https://github.com/gurbyz/power-wheel-card/wiki

0.0.16-dev

New features

  • BETA. Basic support for a battery in the power view.
    • New card parameter battery_power_entity.
    • New card parameter battery_icon.

As said, it's very basic and it only has an extra line between Home and Battery. The nett value of the Battery is added to the Home value. So if you are discharging the battery with 50W, your Home will get 50W added to its value. And vice versa.

I hope you get it running and can give some feedback. What will help is to have two power-wheel-cards setup, one with and one without the battery sensor added to its setup. Then you are able to see the differences in values.

@gurbyz
Copy link
Owner

gurbyz commented Sep 18, 2019

494d74c

@danjenkins
Copy link
Author

Thats some quick work! Thanks @gurbyz ! I'll try and get this setup sometime this week - my Home Assistant Lovelace interface needs some serious love!

@schwarzenbergf
Copy link

That's great, thanks! I'll report to you soon.

@schwarzenbergf
Copy link

Hi Gerben,
I started with the test. Looks already good. Here is what I see when the House is driven by PV AND Battery:
image

When PV drives House AND charges the Battery it looks like this (charging through the House):
image

May be in my case (with battery and NO feed-in to the grid) it would be better to change the places of Grid and Battery (maybe with an option 'feed-in = false').
I will still have to think about this.

Some calculated values at the arrows are missing.
And finally it would be great to have the SoC value of the battery shown at the battery icon, because this is in this scenario always an important information.

Again, thank you very much for your efforts. I'm not in a hurry with this, so please do not feel pushed by me.

My setup is as follows:

          - type: custom:power-wheel-card
            solar_power_entity: sensor.pv
            grid_power_entity: sensor.grid
            battery_power_entity: sensor.bat
            production_is_positive: false
            title: Solar Wheel
            title_power: Power Flow
            debug: true

@gurbyz
Copy link
Owner

gurbyz commented Sep 19, 2019

Thx for your answer. Especially for the no-hurry part. Time is always a problem here. ;-)

Maybe place the Battery in the top-right corner? Then I can get rid of the 'charging through the house' situation. Like this:

House is driven by PV AND Battery
House is driven by PV AND Battery

PV drives House AND charges the Battery
PV drives House AND charges the Battery

(Extra advantage: the card size stays the same for battery users and non battery users. And for battery users that also use the energy view and/or money view, there is also no switching of card sizes and thus no rearranging of all the other cards when switching views.)

I'm not owning a battery, so here's Question5:
Q5: Can I do the assumption that (for your setup) the battery is never being charged when there is no sun? So the grid never charges the battery? And (difficult to answer) will that be the case for everyone with a battery at house?

By the way, arrow values are hidden when they are equal to one of the surrounding icon values. Otherwise you would see a lot of identical (and redundant) values in the card.

@danjenkins
Copy link
Author

danjenkins commented Sep 19, 2019 via email

@gurbyz
Copy link
Owner

gurbyz commented Sep 19, 2019

Oow. That's a pity (for me and my proposal). Or is that an exceptional or rare situation? Do you find your setup in this situation often? (I can imagine that it's better to charge your battery with solar power than with grid power, because when the battery is full the unused solar power will flow back to the grid (often against a lower tariff)).

Can you share a picture like the one in your starting post of this charging-from-the-grid situation? And maybe also one where you battery is charging-from-the-sun?

@danjenkins
Copy link
Author

danjenkins commented Sep 19, 2019 via email

@schwarzenbergf
Copy link

schwarzenbergf commented Sep 20, 2019

I agree with Dan, although this is a rare case (in the meanwhile) in Germany. But in many other countries it makes sense to charge the battery from grid.
So, to be 'future-proof', what do you think about this:

power-wheel_bat

The card size could stay the same(?), and any case which I can think off should be possible:

  • PV --> House
  • PV --> Grid
  • PV --> Battery
  • Grid --> House
  • Grid --> Battery
  • Battery --> House
  • Battery --> Grid

@danjenkins
Copy link
Author

danjenkins commented Sep 20, 2019

I think that would work, and would even work if you didnt have any solar and just had a battery.

Will try and a screenshot of it charging from the grid but a) it doesnt happen too frequently right now due to having enough solar and b) it only happens between 00.30 and 04.30 as thats when my off peak electric is :D

But in essence it just draws a line between the grid and the battery

@gurbyz
Copy link
Owner

gurbyz commented Sep 20, 2019

But in essence it just draws a line between the grid and the battery

Ok. That's all I wanted to know.

Thx for all thinking, tips and suggestions.

I pushed a new version to the dev branch.

  • I split the arrow between Home <--> Battery, into two separate arrows Battery --> Home and Solar --> Battery. In that way the 'through the house' situation is gone.
  • I took care of 'charging by the grid' by an extra arrow Grid <--> Battery. I think even discharging to the grid might be possible now, but didn't test that yet.
  • I really like the layout suggestion of Frank but wasn't able to do that without making breaking changes and/or switching to a new layout/grid system. And I only can handle 0/45/90 degree arrows in the current way. But I found a nice solution for now to serve the charging from the grid and also serve the charging from the solar panels as well. You'll see it in the card when it happens. ;-)

It's possible that there are edge cases in where the values are not correct. That's maybe because I used a couple of assumptions in this early version:

  • Battery is never charged by the grid when there is sun.
  • Battery is charged by the sun or charged by the grid, but never by both.

@schwarzenbergf
Copy link

schwarzenbergf commented Sep 21, 2019

OK, this is no problem for me (also it's not so nice ;-) ).
Here is what I see now when plenty of PV energy is charging the battery and driving the house:

image

The value shown at the House seems to be not correct. This consumes only about 192W, for technical reasons a small part from the PV goes to the grid (this is no feed-in), about 110W, and the rest of the PV goes to the battery (4526W). In my current view it looks like this (Load = House):

image

Could you check this?

With respect to the SoC, it is really important to show the SoC of the battery in such a 'summary view'. Without that it would not make much sense for me. What about showing the charging power (4526W) at the arrow and the SoC instead of the charging power at the battery?
I will check in the evening when there is no PV and the house runs from the battery and report to you.

@gurbyz
Copy link
Owner

gurbyz commented Sep 21, 2019

I'm thinking about replacing the layout (much) later. The result will be something like your suggestion, but then with Home in the center instead of Battery. And curvy arrows for the outer circle. That will be a visual change, also for non-battery users, because from then on the battery will always be visible (although greyed for non-battery users) and the card really shows a 'wheel', hence power-wheel-card. :-)

About the SoC: I understand it is very valuable to see it and that's why I implemented it. But I'm not happy with current solution, because all the values in the power view should have the same unit: e.g. Watt. And SoC is in %. Probably other users will start asking for PV-temperature and other non power stuff. ;-)

There is a new version on the dev branch.

  • Fixed the Home value for situations that Solar Panels are charging the Battery.
  • Added an extra input parameter battery_soc_entity to display the state of charge in power view.

Thank you for testing and seeing forward to the moment you will see switch the battery to the left of the card this evening.

@schwarzenbergf
Copy link

OK, this looks good now:

image

Is it possible, to put the SoC inside of the battery icon? I have no idea, but this way it would not 'disturb' the power view (it just belongs to the battery, always and in every view).

And a minor issue yet: I noticed that the arrow from PV to House sometimes (very shortly) changed the direction (from House to PV). Your calculation is certainly correct, technically this comes from my setup. But in fact a flow from House to PV is not possible, thus you could simply block this.

I'm glad to hear that you are thinking about a new layout. I'm of course available for testing.

@schwarzenbergf
Copy link

As promised, here is the picture which shows 'House driven by Battery':

image

Notice the arrow from House to PV (makes no sense, just block this direction).
And that one from PV to Grid is also a bit strange, actually it goes from Battery to grid.

@gurbyz
Copy link
Owner

gurbyz commented Sep 22, 2019

I have to look into that. Probably there is an assumption in my code that every production-to-the-grid has to come from PV. And since the Battery is introduced, that's not valid anymore.

Simply blocking an arrow is not a solution, because all the calculations are interacting with each other. And there are some people that want to see their PV inventer consumption at night, so a negative value for Sun. If there is a current of 171 W somewhere, it has to be displayed somewhere.

@gurbyz
Copy link
Owner

gurbyz commented Oct 6, 2019

0.1.0-dev

The fix is there, but I took some time. Here's what I did:

  1. Added automated regression tests for the current battery scenario's.
  2. Refactored all calculations in the card, because adding a battery gives new meaning to most current arrows. E.g. suddenly the arrow solar2grid can't be just set equal to the input parameter for producing to the grid, because also the battery can produce to the grid sometimes. I got into circular calculations and corrections and had to overcome that by splitting the calculations in two levels. After that I was able to:
  3. Fix the scenario DischargingBatteryWhileProducingToGrid that was mentioned by @schwarzenbergf The battery will be displayed twice to be able to place the applicable arrows. That looks a bit weird for now, but will be fixed when I do the big layout change (later this year).

The card is capable now for these battery scenario's:

  • when consuming from solar, the grid and the battery
  • when producing to the grid while consuming from the battery
  • when all sensor values are zero
  • when charging the battery by the sun while consuming from the grid
  • when charging the battery by the grid
  • when discharging the battery while producing to the grid

Could you download the latest version 0.1.0-dev on dev branch again and do some testing? Maybe there are other edge scenario's that still need some coding. A screenshot of a defect is much appreciated.

@schwarzenbergf
Copy link

Ok, thanks for your efforts. Unfortunately I have to report that this does not work for me as expected.
The normal case 'PV to Bat and House' behaves 'normal':
pv2bat house
Then I started to charge the battery from grid. The battery is charged from the grid with about 12.9kW. For some reason the battery does not move to the left side. And again the arrow from House to PV is completely wrong.
grid2bat

In the evening (no PV anymore but still battery capacity, so Bat drives House) it looks like this:
bat2house
And what really goes on you can see here:
bat2house_glance

Grid to House and PV to Bat (this is what I have now in the morning) it looks good:
grid2house pv2bat

So, OK, it's your baby but allow me some general remarks.
Try to keep it simple. Genius is simple. If it becomes too complicated it's worth to think about the concept.
In my opinion the main rules which should the starting point for any computation are:

  • There are sources (power generators) and sinks (power consumers).
  • PV is ONLY a source, which also means that there cannot be an arrow with direction to PV.
  • House is ONLY a sink, no arrow with direction from House because it does not generate power.
  • Grid and Bat can be both source and sink.

Even if there is a power loss in the PV Inverter it does not justify an arrow from House to PV, simply because there is NO power flow from House to anywhere. Same is true for PV (no power flow to PV).
Trying to show power losses in such a simplified picture ends up in making this complicated.

With respect to your major layout change, please rethink your concept with the House in the center.
Again, try to keep it simple.
Having the House in the center means you will have to move the House from the center to the edge when there is no battery.
Having the battery in the center means with no battery there is no change (just do not display the battery). And for a battery owner (a real house battery) the battery should be in the center.

This is just my opinion. I hope this helps a bit. Thanks again for your big efforts.

@gurbyz
Copy link
Owner

gurbyz commented Oct 9, 2019

About the scenario

"In the evening (no PV anymore but still battery capacity, so Bat drives House)"

This is your third screenshot (with the NaNs on it). There was an error in a piece of code that was not tested. I added testcases for this situation ("using one grid sensor and not two") and fixed it. Could you test this scenario again with the new version?

About the scenarios

Then I started to charge the battery from grid.

and

Grid to House and PV to Bat (this is what I have now in the morning)

Your second and fourth screenshot of the card have captured a scenario that the card is not yet able to handle. (NB. Mind the erroneous arrow in the fourth screenshot.) There are some assumptions in the design that are not met in your scenario:

  • Battery is charged by the sun or by the grid, but never by both.
  • Battery is never charged by the grid when there is sun.

In your case you are charging the battery when there is sun and you are charging from both the grid and the sun at the same time. I think I can partly detect this scenario, because your screenshots show the battery is charging with a greater value than the sun is producing. I'll have to dive into that later.

Can you test another scenario? Charge the battery from the grid when there is no sun? Or is that something that would never happen?

About

Having the House in the center means you will have to move the House from the center to the edge when there is no battery.

For the new layout I was not planning to do that. Battery will always be visible. I like the house in the center more, because that's the one that can consume only and you will be able to see who is powering it (grid, solar or battery) in a centered way.

Thx again for testing and providing the screenshots!

0.1.0a-dev

  • Fixes for using one grid sensor and having a battery.

@schwarzenbergf
Copy link

"In the evening (no PV anymore but still battery capacity, so Bat drives House)"

Battery drives House: this is my normal mode at night. I'll test this in the evening.

  1. Battery is charged by the sun or by the grid, but never by both.
  1. Battery is never charged by the grid when there is sun.

--> 1. This is possible and I have another installation where I use this scenario frequently.
Actually the rules are as follows:

  • PV will drive the House, then (if PV excess power is available) charge the battery and if still enough PV feed-in to grid (if feed-in is allowed).
  • I have a Battery Mode 'Keep Batteries charged'. In this case PV will also charge the battery (PV has always priority), if this is not enough Grid will step in and add what is missing (the max. charging power is a setting) until the battery is full. This mode is usually used for battery maintenance.

Can you test another scenario? Charge the battery from the grid when there is no sun? Or is that something that would never happen?

This can happen as I mentioned above. I'll test it in the evening.

@schwarzenbergf
Copy link

Here is what I get for 'Bat drives House, no PV':
image
image

The battery icon on the left side appears/disappears all the time.
There was from time to time still a little bit PV power which is probably the cause.

And here is the 'Grid charges the battery, no PV':
image
image

Cheers.

@gurbyz
Copy link
Owner

gurbyz commented Oct 20, 2019

Thx for testing and supplying screenshots. I added a testcase for the scenario where there is some sun left and the home is consuming from the battery while also producing to the grid. (First two images of Frank's last message).
It's possible now to let the battery charge by the grid even when there is sun.

I was able to get rid of some assumptions and implemented a few new:

  • Battery is charged by the sun or by the grid, but never by both.
  • Battery is never charged by the grid when there is sun.
  • Solar is consumed by home first.
  • What's left of solar (after home did consume) is used for charging the battery.
  • What's left of solar (after home and battery did consume) is produced to the grid.

Happy testing! :-D

Version 0.1.0b-dev

  • Smooth transition when battery (dis)appears.
  • Battery charged by grid while having sun.
  • Simplified and redesigned all calculations again.

@schwarzenbergf
Copy link

Sorry for the late reply.
I'm on the road and will be back in two weeks.

@gurbyz
Copy link
Owner

gurbyz commented Oct 29, 2019

Absolutely no problem!

@schwarzenbergf
Copy link

Ok, I'm back and did the first test with 0.1.0b-dev.
The conditions at the moment are: not enough sun, so the house is driven from the grid and PV goes only to the battery. For explanation, there is a SoC threshold which is at the moment 50%. Below that threshold grid is used to drive the house and PV is used to charge the battery. During the day we will probably see SoC > 50%, then battery and PV is used to drive the house and if possible charge the battery.
power_flow_grid2house
power_flow_table

In the second picture the numbers from left to right:
PV, Battery, SoC, Grid, House and PV Yield today.

So, in my understanding there should be

  • an arrow from Grid to House (not from Grid to Battery) and
  • (only one) arrow from PV to Battery (not to House).

The numbers in the two pictures are not really identical because it takes me always a few seconds to make the snapshots, so they do not happen at the same point in time.

@gurbyz
Copy link
Owner

gurbyz commented Nov 16, 2019

Thx! Aha, so it's not always like this ruleset:

  1. Solar is consumed by home first.
  2. What's left of solar (after home did consume) is used for charging the battery.
  3. What's left of solar (after home and battery did consume) is produced to the grid.

Could you check if my current implementation works for SoC>50%? I'd like to know first if we reached that milestone that the first set of rules is okay before starting to work on the other ruleset and the threshold.

I understand below a certain threshold of SoC the system is behaving differently. We have to find the exact definition of that second ruleset. (And it's nice to know if the PV/Battery setups of other users will behave the same. Do e.g. all users have this possibility to use a SoC threshold and is the second ruleset the same for everyone?)

But let's find out your second ruleset. From your text and image I extracted this concept for a ruleset definition for SoC<50%:

  1. Grid is delivering all Home consumption.
  2. If the Battery is charged more than Solar is producing, then the rest of the Grid consumption is used to charge the Battery.
  3. Solar production is used to charge the Battery. (But what happens if there's a surplus of Solar? Is that consumed by the Home and therefore reducing the Grid consumption?)

@schwarzenbergf
Copy link

OK, there's a little bit more than the first rule set. If you want to dig into more details, see here:
https://www.victronenergy.com/live/ess:design-installation-manual#batterylife
But in short, if you have a house battery you also want to be able to drive the house in case of grid outage (UPS functionality). For this you want to maintain a lower limit for the SoC to have enough battery capacity in case of grid outage. But that's not all. Especially in Winter time you also want to make sure that (at least from time to time) the battery get's fully charged. For this the 'Battery Life' algorithm is used (see URL above). And this algorithm shifts the SoC threshold, so it is dynamic (BL-SoC).
The 50% from my last post are now 55%.
So, in case SoC falls under BL-SoC the system switches to the mode which I described in the last post (Grid --> House, PV --> Bat).

At the moment I have SoC 61%, so I'm above the threshold (normal mode = first rule set):
powerwheel_pv2house bat1
This looks normal for me, but sometimes I see this (a few seconds later):
powerwheel_pv2house bat2
Actually there is no power flow from Battery to Grid (not in both modes).

For the mode SoC < BL-SoC (dynamic threshold):

  1. Grid delivers to House
  2. PV delivers to Battery

This is true as long as SoC < BL-SoC.
If (while charging the Battery) SoC goes above BL-SoC, the first rule set comes into play.

@chheiss
Copy link

chheiss commented Dec 25, 2019

Would it be possible to show the battery at all times? Even if it is not charging or discharging?

Thanks

Chris

@dvbit
Copy link

dvbit commented Feb 10, 2020

Great work. Joining beta soon

@MimbaMonkeyHouse
Copy link

MimbaMonkeyHouse commented Feb 12, 2020

Hi all,
Would love to use the power wheel, but no battery is a no go for me. It's very rare that grid charges my battery, but this can happen and we need to find a way.
I just wanted to chime in and share how SMA solves this issue on their own version of the power wheel.
Capture-SMA2
Capture-SMA
I find the second version to be the most elegant. This fits all cases... Hope this helps!

@MimbaMonkeyHouse
Copy link

Another version from Sunnyplaces. Com
Screenshot_20200213_091839_com android chrome

@gurbyz
Copy link
Owner

gurbyz commented Feb 14, 2020

Would it be possible to show the battery at all times? Even if it is not charging or discharging?
Chris

Not in current implementation, because it has the battery icon in two places. But after the work to get it functionally right is finished, I will start working on UX.

@gurbyz
Copy link
Owner

gurbyz commented Feb 14, 2020

OK, there's a little bit more than the first rule set.
Frank

Still recovering from that comment. :-D :-D I still have to look into it. Got the feeling that I need more input parameters to get it right.

@MimbaMonkeyHouse
Copy link

MimbaMonkeyHouse commented Feb 15, 2020

OK, there's a little bit more than the first rule set. If you want to dig into more details, see here:
https://www.victronenergy.com/live/ess:design-installation-manual#batterylife<

I'm not sure we need to over complicate things with manufacturer specific implementations and algorithm. Generally power flows from PV to Battery, Grid to Battery and Battery to House. It should not flow from Battery to Grid, really.

I've been using the dev branch for a couple of days and it generally works well. Thanks @gurbyz!
One issue I've noticed is battery feeding the grid. It would also be nice to have the battery constantly displayed as suggested by @chheiss to allow for quick checks of current charge even when not in use.
With the current layout, this could be achieved by having a wider Battery icon at the top, where it can easily have arrows from PV, from Grid and to House. Short of doing this, we can just keep the current layout and not have the battery feed the grid, just the house... Hope this makes sense!

@MimbaMonkeyHouse
Copy link

MimbaMonkeyHouse commented Feb 15, 2020

Battery in the middle (like here: #23 (comment)) is probably the best...

Had not noticed it yesterday, but here is the problem when charging the battery:
power-wheel-current-batt-charging
Battery is charged by PV, not grid. Grid is being used by the house to complement PV... Battery on the left should only be displayed when battery is charging and there is no PV production.

@Vatoe
Copy link

Vatoe commented Feb 17, 2020

IMG_3520
IMG_3279
Honestly, I think an implementation similar to Tesla's powerwall app would be the 'cleanest' type of UI, with your arrows being the power flow direction.

@WaaromZoMoeilijk
Copy link

Battery in the middle (like here: #23 (comment)) is probably the best...

Had not noticed it yesterday, but here is the problem when charging the battery:
power-wheel-current-batt-charging
Battery is charged by PV, not grid. Grid is being used by the house to complement PV... Battery on the left should only be displayed when battery is charging and there is no PV production.

Same here, i have the following sensor:
sensor.victron_battery_power | positive number upon charging, negative upon delivering

@Tscherno
Copy link

How do i install the dev Version over the released one? And more important: When will the battery-feature be released? Seems to be a long time for testing...

@gurbyz
Copy link
Owner

gurbyz commented Mar 29, 2020

How do i install the dev Version over the released one?

Please, uninstall your previously installed version. Then use the instructions in the README.md file. Search for the 'instructions' paragraph. The README.md file in the dev branch is more up to date now, because of the recent changes in Home Assistant where you have to put the resources: part in a different file.

When will the battery-feature be released? Seems to be a long time for testing...

I will release the dev branch as soon as I have fixed my testing framework. web-components-tester / Jasmine has died and I'm in the process of converting to Karma / Mocha now. Please note that not issues are solved yet, but there are too many improvement in the code also for the rest of the card that I want to release. Battery support in the card will be in BETA.

What does BETA mean: expect issues! There are known and unknown issues to be solved. The values and arrows don't show correctly all the time. The layout isn't even worked on yet. It's just the same layout as before and the battery icon(s) have been placed (split up) in available space for now.

@gurbyz
Copy link
Owner

gurbyz commented Mar 31, 2020

In preparation of release 0.1.0 where the battery support is released as BETA, I close this issue topic.

I'll transfer all layout suggestions to this new topic for layout suggestions ONLY. You can add new suggestions there.

I'll transfer all unsolved issues to separate new topics in the next coming days. Then I will release the feature in the master branch. It will get available in HACS. You can add new issues after that of course, but please use a new issue topic per new issue. Check if your (exact) issue is mentioned already.

Want to discuss non issue related and non layout suggestion related things? There's a place for that on the HA forum in this discussion topic.


This text will be part of the new README:

Battery support in the power-wheel-card is currently a BETA feature. Many people asked for it and many people helped during development. Thx!

What does BETA for battery support mean: expect issues! There are known and unknown issues to be solved. The values and arrows don't show correctly all the time.
Expect things that work now will break in future changes of this feature.

For now battery support is implemented with a set of rules in mind. The ruleset is very basic and not complete.

  1. Solar power is consumed by home first.
  2. What's left of solar power (after home did consume) is used for charging the battery.
  3. What's left of solar power (after home and battery did consume) is produced to the grid.

I think that the ruleset can be extended but possibly only by supplying an extra input parameter to the card.
This is the point where extra rules have to take in account the behavior of the battery depending on the state of charge. Possibly this behavior is dynamic and not depending on a strict threshold of the SoC.
And possibly the extra rules differ per battery make. Because I don't own a battery myself, further implementation gets a bit more difficult. I will watch recent and future issue reports to make changes.

For now battery support is implemented in the current layout grid. This is why the battery shows up in two different places and is visible only when in use. This however should be temporary.
First priority is to get all the values and arrows right. If it functionally works with a battery, then it's time to change the layout into a better interface. Many suggestions for the final UI have been given.

@gurbyz gurbyz closed this as completed Mar 31, 2020
@danjenkins
Copy link
Author

thanks @gurbyz for all your work on this!

@Flying-Ace
Copy link

posting scenario:
some energy markets do not allow Battery > Grid. Suggest a boolean flag (for flexibility for both sides) with logic for each case. In the picture for those that do not allow Battery to Grid, Battery goes to house ( power sink), while the solar (generator) would put the excess to the grid.

2020-10-31_14-46-53

@mhbolno07
Copy link

Battery in the middle (like here: #23 (comment)) is probably the best...

Had not noticed it yesterday, but here is the problem when charging the battery:
power-wheel-current-batt-charging
Battery is charged by PV, not grid. Grid is being used by the house to complement PV... Battery on the left should only be displayed when battery is charging and there is no PV production.

Same here, i have the following sensor:
sensor.victron_battery_power | positive number upon charging, negative upon delivering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests