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

PV charging for dummies #181

Open
ministryofsillywalks opened this issue Apr 16, 2022 · 11 comments
Open

PV charging for dummies #181

ministryofsillywalks opened this issue Apr 16, 2022 · 11 comments
Labels
support Support and questions

Comments

@ministryofsillywalks
Copy link

Question

First of all thanks a ton for this intergration!
I'm trying to setup my easee wallbox to charge from excess PV from my solaredge system.
I have read issue #120 but I fear I'm just a tad to stupid when it comes to electricity.
My solaredge reports how much kw are being produced and I can see how much the house is using.
Say I'm producing 7kw and the house is using 0.5kw then I would like to limit charging from the easee to say 6kw (to keep a small overhead in case the house needs more)
Now the only thing I see in the integration is the option to change the A via "set_charger_circuit_dynamic_limit".
I can see the A produced from my solaredge as well but how do I calculate how much A I should set for the easee charger? How much A do I have to deduct for the 1kw buffer for the house?
Also do I just have to limit the A on one phase or on all three phases via set_charger_circuit_dynamic_limit? Or is the dynamic_limit the cumulation of whats available for all three phases?
I'm just pretty confused and hope someone already has something similar neatly set up and would be willing to share his setup. Maybe even make a small wiki entry for other dummies like me ;)
Thanks a ton!

What version of the integration are you using?

easee-0.9.42

Anything in the logs that might be useful for us?

No response

Additional information

No response

@ministryofsillywalks ministryofsillywalks added the support Support and questions label Apr 16, 2022
@olalid
Copy link
Collaborator

olalid commented Apr 17, 2022

The relation between power (W) and current (A) is power = voltage * current (P = U * I).
If I make the assumption that you are on an electrical grid where phase to neutral voltage is 230V (and hence phase to phase voltage is 400V), that means if you increase the current limit 1A, you allow 230W more per phase.
If you are charging with 3 phases, that means 3 times that, i.e. 690W.

The lowest possible setting where the charging actually starts is 6A, so that means 62303 = 4140W with 3-phase charging.
So for solar charging, it might be useful to use 1-phase charging to get more fine-graded control, but what makes sense for you all depends on the size of your solar array and how much you are normally exporting.
You can force 1-phase charging by setting 2 of your phase limits to 0 and the third to whatever you want to allow. The easee wallbox will switch over to that phase automatically.

With that approach, you could typically calculate the new limit something like this:
(new dynamic circuit limit) = (present dynamic circuit limit) - ((import_export_power)/230)
With 3-phase you just replace that 230 with 690.
The output of that calculation should be limited to values between 0 and whatever your circuit fuse value is.
Import_export_power means a power meter that shows a positive value when you are importing power and a negative value when you are exporting power to the grid. If you do not already have such a value you can calculate it with production_power - house_power.

Typically I would say, update your dynamic circuit limit every 20 or 30 seconds. Depends a bit on how often you get new values from your electrical meters though. If you only get new values once a minute, it makes no sense to update more often that that.

@ministryofsillywalks
Copy link
Author

ministryofsillywalks commented Apr 17, 2022

First of all thanks a lot for taking the time for such an in depth answer.
A few follow up questions:
1.
In the app I can chose between Automatic, One Phase and Three Phase mode.
How does this impact "set_charger_circuit_dynamic_limit" is this always a global limit across all three phases or does it always expect an input for all three phases and I always have to include currentP1, currentP2 and currentP3 in the call service?
So say I have 3000W overproduction. Then I would limit that to one phase with 13A (set P1=13A and set P2 & P3 to 0)? Or would setting the "set_charger_circuit_dynamic_limit" to 13A leave the balancing logic to easee which would in turn split the 13A across the three phases?
2.
Building on that, at what point do you use more than one phase? Do I max out P1 (20A for me) before moving to P2? For example if I have 7000W overhead then I would set P1 to 20A and P2 to 10A (and P3 to 0A) thus having 30A = 20A * 230V + 10A * 230V = 6900W?

@olalid
Copy link
Collaborator

olalid commented Apr 17, 2022

  1. To be able to switch between 1 and 3-phase you need to have it set to automatic mode. The other modes forces 1 or 3-phase, which is not really what you want.
    The Easee API expects you to set all three phase limits, however the HA integration assumes you want to set all three to the same value if you provide only the P1 value.
    Yes, 13A on a single phase would mean that you get 2990W theoretical maximum, and setting the two other phases to 0 means that it will switch to single phase charging. You can select which phase it will use by setting the values accordingly, i.e. it you set phase 1 and 3 to 0, it will use phase 2 etc.

  2. You can only choose between 1 and 3 phase, there is no such thing as a 2 phase mode. If you set at least one phase to 0, you will get 1-phase charging, using the phase that has the most current available when charging starts.
    The point where it is worth-while to switch from 1-phase mode to 3-phase mode would be going from 1-phase 18A * 230 = 4140W to 3-phase 6A * 230 * 3 = 4140W. Personally I do not bother with this, I always use single-phase when charging from solar.

@ministryofsillywalks
Copy link
Author

Thanks a ton.
I think I'm getting there and already started building something in node-red (I just prefer it for automations and logic over HA inbuilt automations)
Polling the state once every 30s and then updating the dynamic current is not a problem, but I think you wrote somewhere that using the median of the last 30sec measurements of sensor data would be wise (so as not to have a small cloud passing by at exactly the moment of the singular reading)
How do you accomplish this in HA?

@olalid
Copy link
Collaborator

olalid commented Apr 18, 2022

I do not recall saying that, but it sounds reasonable. :)
Within HA you could use the filter integration low-pass filter:
https://www.home-assistant.io/integrations/filter/#low-pass
Maybe time_constant = 2 would make sense.

@AMajland
Copy link

I'm on a 3 phase grid in Denmark (seens as TN net by Eassee) and does not yes have an interface to neither my main meter or my solar inverter - but i'm exploring the possibilities :-)

But for power calculation the real voltage is important. It does make a difference. In many places you will see the voltage drops significantly when adding 11-22kW for an ev charger. And the neighbours on the same transformator may also draw power unevenly. Right now i can in the Easee app see that i have 229V on L1 while only 220V on L3 - with the house "idling" without major power drawn (only light, pc etc - but no heating or ev charging)

In the ha implementation only the L1 voltage is available. I have not checked whether it is a restriction in the API but when i looked at the 3 voltages they were so different that i'm pretty sure that it is not an average but the L1 voltage

@ministryofsillywalks
Copy link
Author

I have since switched over to evcc.io which takes care of all the calculating of the voltages, amperes, etc.
It works well and can be easily integrated back into HA using mqtt.

@olalid
Copy link
Collaborator

olalid commented May 24, 2022

All the different voltages are available as attributes in the voltage sensor.
inVoltageT2T3 is voltage between terminal 2 and terminal 3. This is L1 voltage in a TN system.
inVoltageT2T4 = L2, inVoltageT2T5 = L3.
inVoltageT2T3 is the main value of the sensor because that value makes sense both in an IT and TN system.

@AMajland
Copy link

All the different voltages are available as attributes in the voltage sensor.

Found it :-) the HA rabbit hole is deep and there is a lot to comprehend. Now i just need to learn how to address it

@olalid
Copy link
Collaborator

olalid commented May 26, 2022

In a template you can access an attribute like this:

{{ state_attr('sensor.j21_voltage', 'state_inVoltageT2T3') }}

@fa11enangel
Copy link

fa11enangel commented Aug 23, 2022

Assumption: I use 90% of solar produced power from my solaredge system to charge the car. The SolarEdge system ist controlled through cloud API and therefore only updated every 15 minutes (see https://www.home-assistant.io/integrations/solaredge), that's why updating the Easee Wallbox every minute is enough.

This is what I did to add the automations (2 separate):

  1. Settings
  2. Automation & Scenes
  3. Automation
  4. Create new Automation
  5. Start with an empty automation
  6. Pres on the 3 vertical dots in the right corner.
  7. Select "edit as yaml"

You need to replace the charger_id with the ID of your Easee Wallbox.

This is as simple YAML setup for charge control. If the current power sensor.solaredge_current_power is above 5 KW (5000 Watt) use this setup (condition based). Use the current power, calculate Ampere ( Watt / (230 Volt * 3 Lines)) and multiply by 0.9 to have 10 percent for for other stuff.

alias: Solar Charge Control
description: Calculate Solar Charging
mode: single
trigger:
  - platform: time_pattern
    minutes: "/1"
 condition:
  - condition: numeric_state
    entity_id: sensor.solaredge_current_power
    above: "5000"
action:
  - service: easee.set_charger_circuit_dynamic_limit
    data:
      charger_id: 123456
      currentP1: >-
        {{ ((states('sensor.solaredge_current_power') | float) /(230*3) * 0.9) }}
      currentP2: >-
        {{ ((states('sensor.solaredge_current_power') | float) /(230*3) * 0.9) }}
      currentP3: >-
        {{ ((states('sensor.solaredge_current_power') | float) /(230*3) * 0.9) }}

If I don't have enough power to load the car, just set all 3 lines to zero. Therefore I've created a second Automation, which I can disable separately. If the production in watt goes below 4999 Watt (follow the steps above and insert this YAML code):

alias: Solar Charge Disable
description: Disable Charging on Low Solar Power
mode: single
trigger:
  - platform: time_pattern
    minutes: "/1"
condition:
  - condition: numeric_state
    entity_id: sensor.solaredge_current_power
    below: "4999"
action:
  - service: easee.set_charger_circuit_dynamic_limit
    data:
      charger_id: 123456
      currentP1: 0
      currentP2: 0
      currentP3: 0

We don't have any other long running consumers yet. This is enough for my setup.

I've written a more detailed block post in German on my site: https://konstantin.filtschew.de/blog/2022/08/24/ladeleistung-ueber-die-easee-wallbox-in-verbindung-mit-solaredge-wechselrichter-ueber-home-assistant-steuern/

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

No branches or pull requests

4 participants