serkri / SmartEVSE-3

Smart Electric Vehicle Charging Station (EVSE)
MIT License
68 stars 28 forks source link

Delayed charging for solar mode #147

Closed hmmbob closed 1 year ago

hmmbob commented 1 year ago

The docs read the following:

the SmartEVSE will stay on indefinitely. Delayed Charging in Solar mode is not supported, since in Solar mode the sun will decide when charging starts...

I would still like to use delayed start for solar mode šŸ˜„ The reason is financial: I have plenty of PV panels and am on a dynamic contract (hourly prices). Because of the dynamic prices, it is sometimes more favorable for me to wait to use my own energy until the prices are extremely low, because then returning to grid is completely not interesting. Like yesterday, "use yourself" is very interesting from 12h on, whilst returning to grid was more beneficial in the hours before that, so I would have loved to delay solar charging until after 12:00:

image

Another use case is that one might want to wait until solar production is higher, because charging with a higher rate leads to less losses in the systems (it is more efficient to charge with 11kW instead of 3.2kW).

Is there a possibility to also add "delayed start" in solar mode?

dingo35 commented 1 year ago

Have some patience my friend!

mr-leo commented 1 year ago

When you have a dynamic contract and the price is low, it makes more sense to charge as fast as you can (normal/smart mode) instead of solar mode and also take energy from the grid, doesn't it? So that you can make more use of the low prices.

hmmbob commented 1 year ago

"Low price" vs "paying nothing at all because I am using my own solar production": option 2 is better šŸ˜‰

And, historically seen (over the last few months) the lowest prices are mostly during midday - mostly due to and exactly because of high solar production countrywide. Especially in the weekends.

In solar mode, you aren't consuming power from the grid (netto). In my case, I deliver back on 2 phases and consume the same amount on phase 1, as my car only charges on 1 fase. Works quite nicely!

mr-leo commented 1 year ago

No because you get the exact same amount as you pay with dynamic prices. So you pay 6ct of get 6ct..

hmmbob commented 1 year ago

I know how dynamic pricing works (and in this case it isn't even about "getting or paying the same amount", as your electricity meter already nets consumption and production out) - I don't see why this discussion is relevant for the request?

dingo35 commented 1 year ago

IMHO any discussion on the use case is relevant, to prevent function creep.....

EDIT: So if your use nets out financially, but you need a software modification, and mrleo's remark nets out financially too, but he doesn't need a software modification: seems relevant ?!?

EDIT2: I'm not really into dynamic pricing, but mrleo's point seems very valid: you would want to charge full blast on the lowest price point, because a) it is cheapest then and b) faster charging means less losses. And it also means you are lowering your solar surplus on the lowest price points, which also seems a smart thing to do. I would say you would want this charging strategy always, independent of whether the sun shines..... Or, to say it in other terms: your solar energy is not free, since it has a market value that depends on the time you deliver it back....

Not trying to be right, just wanting to learn from you all, because a lot of people will have these kind of questions when "saldering" is over!!

hmmbob commented 1 year ago

But the thing is that mr-Leo's remark is not the same as the use case.

Or, to say it in other terms: your solar energy is not free, since it has a market value that depends on the time you deliver it back....

THIS! This is it.

you would want to charge full blast on the lowest price point, because a) it is cheapest then and b) faster charging means less losses. And it also means you are lowering your solar surplus on the lowest price points, which also seems a smart thing to do. I would say you would want this charging strategy always, independent of whether the sun shines.....

The thing is: you don't want to "buy" energy at all, if you produce more energy than you consume (which is the case for my setup). The most ideal setup is to consume most of your production yourself, especially when salderen is over.

I'll write down an example, based on my actual 12kWh EV-charge and actual production of my system yesterday according to Home Assistant, and actual hourly prices of yesterday.

Solar without delay Time Production kWh Price Cost Remarks
09:00-10:00 2,5 kWh ā‚¬ 0,16 ā‚¬ 0,00 All PV production used for charging
10:00-11:00 3,6 kWh ā‚¬ 0,16 ā‚¬ 0,00 All PV production used for charging
11:00-12:00 4,2 kWh ā‚¬ 0,15 ā‚¬ 0,00 All PV production used for charging
12:00-13:00 4,6 kWh ā‚¬ 0,06 - ā‚¬ 0,17 1,7 kWh production used, remainder delivered back
13:00-14:00 5,1 kWh ā‚¬ 0,09 - ā‚¬ 0,46 All delivered back
14:00-15:00 4,9 kWh ā‚¬ 0,08 - ā‚¬ 0,39 All delivered back
Total - ā‚¬ 1,02
Solar with delay until 12:00 Time Production kWh Price Cost Remarks
09:00-10:00 2,5 kWh ā‚¬ 0,16 - ā‚¬ 0,40 All delivered back
10:00-11:00 3,6 kWh ā‚¬ 0,16 - ā‚¬ 0,50 All delivered back
11:00-12:00 4,2 kWh ā‚¬ 0,15 - ā‚¬ 0,63 All delivered back
12:00-13:00 4,6 kWh ā‚¬ 0,06 ā‚¬ 0,00 All PV production used for charging
13:00-14:00 5,1 kWh ā‚¬ 0,09 ā‚¬ 0,00 All PV production used for charging
14:00-15:00 4,9 kWh ā‚¬ 0,08 - ā‚¬ 0,21 2,3 kWh production used, remainder delivered back
Total - ā‚¬ 1,74
dingo35 commented 1 year ago

But how does it look if you do Smart charging with delay until 12:00 ?

hmmbob commented 1 year ago

But how does it look if you do Smart charging with delay until 12:00 ?

Gimme a sec.

edit:

Same starting points as above (car charges with 7,2 kWh max)

Smart charging with delay until 12:00 Time Production kWh Consumption kWh Price Cost Remarks
09:00-10:00 2,5 kWh 0 ā‚¬ 0,16 - ā‚¬ 0,40 All delivered back
10:00-11:00 3,6 kWh 0 ā‚¬ 0,16 - ā‚¬ 0,50 All delivered back
11:00-12:00 4,2 kWh 0 ā‚¬ 0,15 - ā‚¬ 0,63 All delivered back
12:00-13:00 4,6 kWh 2,6 kWh ā‚¬ 0,06 ā‚¬ 0,16 All PV production + 2,6 net used for charging (for a total of 7,2 kWh)
13:00-14:00 5,1 kWh 0 ā‚¬ 0,09 - ā‚¬ 0,03 4,8 kWh production used (12 - 7,2 = 4,8), remainder delivered back
14:00-15:00 4,9 kWh 0 ā‚¬ 0,08 - ā‚¬ 0,39 All delivered back
Total - ā‚¬ 1,79

That is.... interesting! But this will only remain interesting when "salderen" remains to exist. If not, then "consume what you produce" is more interesting as you will pay taxes over all consumed energy from the net, but don't get them "gesaldeerd" when you deliver back.

But2: And this very much depending on the actual pricing. If the 0,06 would have been 0,09 as well (like 1 hr later), the total would have been -1,72.... Pricing strategy is a nice algorithm šŸ˜‰

dingo35 commented 1 year ago

And so we all learn a bit; thanks for your work! I still have enabling delayed solar charging on my list, because I believe in maximum user freedom as long as it doesn't ask for to much code. In fact it might even reduce some code :-) . But I always like to understand my users cases..... and you are right, if dynamic pricing stops paying the same amount as charging, it will be a different ball game.

mr-leo commented 1 year ago

If you already use HA, you can set the mode from OFF to SOLAR at the desired time, and don't need the timer on the SmartEVSE at all. You can even automate it at the cheapest moment.

deqw commented 1 year ago

If you already use HA, you can set the mode from OFF to SOLAR at the desired time, and don't need the timer on the SmartEVSE at all. You can even automate it at the cheapest moment.

I did so and used Node Red to make some charge policies. Iā€™m not sure but when I use Solar mode it looks to me that the SmartEVSE tries to prevent using power from the net, to a certain level. IMG_7023

hmmbob commented 1 year ago

If you already use HA, you can set the mode from OFF to SOLAR at the desired time, and don't need the timer on the SmartEVSE at all. You can even automate it at the cheapest moment.

I did so and used Node Red to make some charge policies. Iā€™m not sure but when I use Solar mode it looks to me that the SmartEVSE tries to prevent using power from the net, to a certain level.

Nice! Got your HA code avail somewhere?

deqw commented 1 year ago

Not right now, but no problem to share. I will document it and share it here if that is possible.

SmartEVSE - Charge Settings - Archive.zip

OK did some grabbing and added a zip file here with the Node Red json to import in a new flow. At the top of the flow are some nodes that poll the SmartEVSE and send an email when something is wrong or OK again, but this has nothing to do with the above screenshot. Change the IP address.

Change the email address (node at the bottom).

Change the number/id of your SmartEVSE (replace the 9999).

You have to create some Helpers in Home Assistant. I made a bunch of screenshots with the settings since these cant be exported. If thay can let me know.

That's it I think. Good luck!

hmmbob commented 1 year ago

@deqw Thanks! This is really, really, REALLy cool.

I'm not a node-red user, and as such it is impossible for me to import the flows.json. Could you maybe take some screenshots in NR as well? Then I probably know enough to rebuild them in HA basic automations.

deqw commented 1 year ago

@hmmbob That involves a lot of screenshots and additional work for you. Just install Node-Red on HA and import the json and you will be on your way in a few minutes.

Let me know what you are going to do?

Anyway, this is the complete flow:

Screenshot 2023-05-25 at 15 59 26

dingo35 commented 1 year ago

Enabled this in commit bdb06e76534