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

Missing FLows - Battery 2 Grid and Grid 2 battery ? #29

Closed
AviadorLP opened this issue May 10, 2022 · 5 comments · Fixed by #53
Closed

Missing FLows - Battery 2 Grid and Grid 2 battery ? #29

AviadorLP opened this issue May 10, 2022 · 5 comments · Fixed by #53
Labels
enhancement New feature or request released

Comments

@AviadorLP
Copy link

AviadorLP commented May 10, 2022

Don't know if your chart should show this flows or not but i got this today.

image

Missing 4W from Battery to Grid...

The flows in the other chart are completely calculated in a yaml script of my own making.
Also that -55W that's an estimated inverter consumption power that is being consumed at the time that i also calculated.
If you need help, ill do what i can !

@ulic75
Copy link
Owner

ulic75 commented May 10, 2022

Your battery sends power to the grid? That seems strange to me, but okay. Does your battery also charge from the grid?

@AviadorLP
Copy link
Author

AviadorLP commented May 10, 2022

Well all batteries can charge from the grid, very useful when there is an overcast forecast for next day with minimum or no sun. i charge the battery with cheap electricity and let it go to the house during the day when the electricity become more expensive (i have cheaper electricity from 2200 till 0800 am)
Also very useful in areas with frequent blackouts and the battery will always keep a percentage of battery as backup, for a blackout and recharge it to that level from grid right after the grid power is restored if no sun available....
Another normal example. Batteries prefer not to discharge too much, its not healthy, mine stops at 10% but as batteries get old during the night even not being used that percentage might keep slowly dropping mine usually drops to 9% sometimes 8%. But as soon as the sun wakes-up the inverter, it will check the battery and if below that level (like i said mine is 10%) it will charge it carefully (with low power) using extra from grid since the sun is still too weak, till it gets again to that safe level.
Does this not happen to you ????

@AviadorLP
Copy link
Author

AviadorLP commented May 10, 2022

i don't send electricity to the grid myself. But there are those that do, i believe It involves a contract selling electricity and they receive higher prices at specific hours so they send the battery power at those hours.
But in some cases you need to force a battery discharge and there in no other way then send to grid....

Now at the example shown above, since inverters are not that fast to react and we take instant sensor readings the inverter at that time did not have time yet to adjust power transfers (i think it takes a few tens of seconds like 0.1s or 0,3s not sure about this and there are inverter faster than others). So at that time the battery is sending more energy than the house is demanding the rest is going to the grid for the moment till the inverter corrects this moments later demanding a slightly smaller power from the battery.

@ulic75 ulic75 added the enhancement New feature or request label May 10, 2022
@AviadorLP
Copy link
Author

AviadorLP commented May 11, 2022

if it helps here is the formula i use to calculate the flows from grid2batt and batt2grid in yaml
If you want to implement this....

  - name: APF Grid2Batt
    device_class: power
    state_class: measurement
    unit_of_measurement: W
    state: >
      {% if states('sensor.apf_grid_import')|int(default=0) > states('sensor.apf_real_house_load')|int(default=0) %}
        {{ states('sensor.apf_grid_import')|int(default=0) - states('sensor.apf_real_house_load')|int(default=0) }}
      {% else %}
        0
      {% endif %}

  - name: APF Batt2Grid
    device_class: power
    state_class: measurement
    unit_of_measurement: W
    state: >
      {% if states('sensor.apf_battery_entity')|int(default=0) < 0 %}
        {% if states('sensor.apf_battery_entity')|int(default=0)|abs > states('sensor.apf_real_house_load')|int(default=0) %}
          {{ states('sensor.apf_battery_entity')|int(default=0)|abs - states('sensor.apf_real_house_load')|int(default=0) }}
        {% else %}
          0
        {% endif %}
      {% else %}
        0
      {% endif %}

Hope it makes sense to you...

the sensor.apf_real_house_load is your calculated house load
the sensor.apf_grid_import is just what is being imported from the grid (0 or positive only)

and i believe my grid and battery entities are the reverse of yours, mine are positive when yours are negative and negative when yours are positive, so you got to adjust for that.
But if you want i can adjust the formula for your use.
Just trying to help out.

@ulic75
Copy link
Owner

ulic75 commented May 18, 2022

🎉 This issue has been resolved in version 2.4.0 🎉

The release is available on GitHub release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants