nordicopen / pyeasee

Easee EV charger API python library
MIT License
39 stars 11 forks source link

1-Phase Charching #35

Closed jscmidt closed 3 years ago

jscmidt commented 3 years ago

Hi, Thanks für this code! How exactly does changing from 3-Phase charging to 1-Phase Charging and the other way work? Is it like this:? 1.: Car is Charging with three phases 2.: You have to stop the charging over the API 3.: You switch to Singlephase-Charging with the API 4.: You start charging again over the API 5.: The car now is charging with only one Phase.

Or is stopping and starting the charge unnecessary because the Easee Wallbox does it itself if the number of phases is changed?

Or do I even have to replug the charging cable into my car after changing the number of phases?

Maybe an example Script for this procedure would be very helpful.

Thanks in advance!

Hellowlol commented 3 years ago

There is a way to limit to single phase charging. But the best option would set it to auto and let the chargebot figure it out.

Why limit the charger to single phase as long as it supports 3 phase (and the car supports it too) I dont see the usecase. Its good to spread the load. What are you trying to do and what is your goal? Maybe its better way to do it.

jscmidt commented 3 years ago

Hi, 1-Phase Charging is important for charging only my PV-Excess. With 3 Phases the minimum Power to charge is 230Vx6Ax3=4.1kW. But if I instead charge with only 1 Phase I can start charging at 1.4kW. My PV isn't that big that I often have a excess of 4.1kW, that's the reason why starting charging with 1 Phase and 1.4kW would be really important for me. Off course I also could us a 1-Phase Typ-2 cable, but then I wouldn not longer be able to charge fast with 11kW.

Hellowlol commented 3 years ago

I’m not sure what you mean by pv-excess but I assume you have solar and you produce more energy that use use so you have a excess energy that you use to charge up your car instead of sending it back to the grid.

I think you can just change the phases on the fly with out doing anything (I havnt tested this)

Your can use: Charger.limitToSinglePhaseCharging(True) Charger.limitToSinglePhaseCharging(False)

to turn on and off.

jscmidt commented 3 years ago

I’m not sure what you mean by pv-excess but I assume you have solar and you produce more energy that use use so you have a excess energy that you use to charge up your car instead of sending it back to the grid.

Yes that's what I meant, Thanks for the answer and sorry for my bad English! I also think it should work this way, but I'm not 100% sure, and this isn't safe enough for me to buy a 600€ Wallbox... Because if you have to replug the car charging cable, which was the answer of the Easee support, it wouldn't be very useful for me.

olalid commented 3 years ago

It is hard to answer this question since we are not the ones developing the charger and the could API. This library is a wrapper for the could API, the logic of what happens when you call the API is in the cloud and/or the charger, so the only way to know how it behaves is usually to test. Unless it is documented in detail and it usually is not. But have a look at http://api.easee.cloud and check if that helps.

jscmidt commented 3 years ago

I have already looked there, and as you said, it isn't documented that well that you exactly know what the charger does. If I had to stop and start the charge with the API before and after editing the "limitToSinglePhaseCharging" value that wouldn't be a big deal, but If I had to replug the charging cable it wouldn't be really practicable. Since this is a big reason for me wether to buy an Easee-Wallbox or not, I hoped that someone here maybe already tried it - which it doesn't look like. But thanks for all your answers!

olalid commented 3 years ago

Well, perhaps I can test with my car and charger sometime later this week. But there is no guarantee that it behaves the same way with all combinations of car and charger. It is an interesting question to me also as I too have solar panels on my house and it could be interesting to know if this is a way to limit power to less than 62303 W.

jscmidt commented 3 years ago

Yes, for this purpose 1-Phase Charging is really useful. I don't know how you got to 62303 W, but I think it depends from country to country. In Germany for example we have 230V, and most cars can charge from 6A to 16A. That means, with three Phases you can charge from 6Ax230Vx3=4140W to 16Ax230Vx3=11040W, and with only one phase you can charge from 6Ax230Vx1=1380W to 16Ax230Vx1=3680W. Here in Germany there is also a in the meantime quite big Open-Source Projekt called "openWB" for Solar-Plant Charging. They have own closed-source hardware with the ability to change the number of phases, but they are really expensive (but also good!). The Software is Open-Source, working with almost all inverters and evu-meters, and some third party charges like the Go-e are also implemented yet, but not the Easee-Wallbox.

olalid commented 3 years ago

My text was supposed to say 6 x 230 x 3 W, the formatting was screwed up so that it became 62303 :) I did right now test with the easee app, and my car switches from 3-phase to 1-phase charging when I switch the setting there from 3 to 1-phase. But I can not be sure exactly what APIs the easee app calls to accomplish that. So to test it fully I need to write a small program to call specifically that API.

olalid commented 3 years ago

Ok, so the answer to the question if Charger.limitToSinglePhaseCharging(True) will make the charger reconfigure itself to 1-phase mode when charging is already taking place is no. However, I tried changing the phaseMode setting (as I did in the easee app) and if I change that to forced 1-phase mode, the charger will on the fly force the car to switch to 1-phase charging mode, and the other way around, if I switch it back to auto or 3-phase mode it will switch back to 3-phase. We do not currently have support for changing that setting in the lib so we need to create a new version for this. Note that changing settings like this is potentially going to write to flash memory in the charger and there is a limit of how many times that can be done before it is worn out. So doing it every day back and forth is maybe not a god idea either...

There may be a different and perhaps better way by using the set_dynamic_charger_circuit_current function. If you set 2 of the phase currents to 0, the charger should limit itself to 1-phase charging, on that phase. But I am not sure if it works. My car has finished charging for today so I can not test more today. To be continued...

olalid commented 3 years ago

I have now tested and it looks like it works just fine ot change the circuit dynamic current to control if the charger uses 1 or 3 phases. So if you call the circuit.set_dynamic_current(p1, p2, p3) with for instance (20, 0, 0) the charger will switch to using 1 phase charging with phase 1. If you call it with (0, 20, 0) it will switch to 1 phase charging on phase 2 etc. If you set it to (20, 20, 20) it will use all 3 phases. 20 is just an example of course, and the other limits (max circuit current, dynamic charger current, max charger current) will take precedence if they are lower. It is probably a requirement that the charger is set to auto phase mode for this to work.

I will probably add the possibility to change the phase mode to the lib as well, but it is not recommended to use that for this functionality (even though it works as described above) since it will probably write to flash and risk wearing it out if called often.

jscmidt commented 3 years ago

Wow, Thanks for your work, looks like it's working pretty well! From which source do you have the information, that changing the phase mode isn't recommended for this functionality, and that there's a risk of wearing it out? Has someone from Easee confirmed you that you shouldn't use it like this? Because technically, phase changing don't have to include the risk of wearing it out - Take a look at for example OpenWB or the SMA-Chargers, that both have this as a feature.

jscmidt commented 3 years ago

I just have found this Website: https://www.ev-autocharge.com

They already use the Easee Wallbox and its Phase-Changing feature. I would be surprised when they would advertise this feature without talking with Easee about it.

olalid commented 3 years ago

We are in contact with the easee engineers, so they have explained a few things to us that are not obvious. Among these are the fact that settings are generally stored in flash in the charger and we should not change these to often because it can wear out (which is kind of normal for a flash anyway, but). For instance a setting like the max charger current will write to flash, while the dynamic charger current and circuit dynamic currents are safe to update as often as you like since they are not stored in flash. I can ask to confirm if this is true for phaseMode, it is just a suspicion.

But nevertheless, I think using the dynamic circuit current is what easee recommends for user/integrator control and then let the charger do its decisions based on that. So it is likely that the company you linked to above uses the same approach.

olalid commented 3 years ago

Anyway, using dynamic circuit current also allows you to control which phase to use, not only to switch between 3 and 1 phase.

jscmidt commented 3 years ago

Sorry, since my English isn't the best and I'm not familiar with the Easee API names I misunderstood you. I didn't realize that there are two options to charge with only one phase: First option: Chance phase mode, but risk of wear the flash out. Second option: Use circuit.set_dynamic_current(p1,p2,p3)

Have I got this right now? Are there any reasons for using the option 1 instead of option 2?

olalid commented 3 years ago

Option 2 is definitely better.

I got confirmation now from Easee that changing phaseMode will write to flash. So not recommended.

olalid commented 3 years ago

Can we close this issue @JSAnyone ?

jscmidt commented 3 years ago

Yes, thanks for your help!