dzurikmiroslav / esp32-evse

ESP32 EVSE firmware
GNU General Public License v3.0
56 stars 21 forks source link

Charging scheduler #29

Closed dialmak closed 4 months ago

dialmak commented 7 months ago

Hi Miroslav. Some countries have two-tariff meters. The price of electricity at night is significantly lower than during the day. I really wanted to add a real-time charging scheduler (of course, the time must first be set via the NTP server). You did a wonderful job, thank you.

dialmak commented 7 months ago

For convenience, I added an RTC based on PCF8563 to the circuit.

dzurikmiroslav commented 7 months ago

Hi, I also have two-tariff metering in mi garage :-) My eletromer has HDO output (low tarif contactor) which is wired to digital input of evse, and this script reading it:

import evse
import aux

class hdo_driver
    def every_1s()
        var hdo = aux.read('IN1')
        if (hdo != evse.enabled())
            evse.set_enabled(hdo)
        end
    end
end

evse.add_driver(hdo_driver())

I plan extend scripting to add cron support like Tasmota https://tasmota.github.io/docs/Berry/#timers

Alfred1975 commented 7 months ago

Mybe its better to manage timing for tariff also from web interface + HDO output

dialmak commented 7 months ago

The WEB interface is, in my opinion, nicer and more convenient.

dzurikmiroslav commented 6 months ago

I was thinking about the web UI of scheduler, would setting the hour precision would be enough??? My camera has this setup: https://support.reolink.com/hc/en-us/articles/900000431446-How-to-Set-up-Continuous-Record-Schedule/#h_01GTDPY9FXPFC0PAAFRXW885YQ

Alfred1975 commented 6 months ago

Hi!

I think hour precision is a good start :) because for meters its ok, for home charge its better to use scheduler and Amps reader (balancer) in junction box to give difference in Amps coming and free (for charging).

dzurikmiroslav commented 5 months ago

I am working on scheduler... What should can be controlled by scheduler? Currently can control:

More than one scheduler will be supported, what count of schedulers is useful?

dialmak commented 5 months ago

Hi. In my opinion, there is no need to complicate the scheduler. Something like - turn on the charger at some time, for example at 1 am. Limits current can be set globally in advance. For example, my low nightly electricity tariff is valid from 11 pm to 7 am. So I set my scheduler to start charging at 11 pm. Something like this. It’s more important to figure out how to simply (without entering the UI) enable charging at an unscheduled time if the scheduler is configured. Of course you can control it with a button... but I still don't understand how exactly. Need something simple like press 2 times or something...

dialmak commented 5 months ago

As for the scheduler for days of the week or days of the month, I think there is no need for this. Enough time.

dzurikmiroslav commented 5 months ago

The electricity supplier I was considering, for example, has discounted electricity on weekends or a tariff for heat pumps where even hours is cheaper than odd hours. Limiting charging current during certain hours could be useful in places, where other appliances than charging EV.

Yes, charging outside the scheduler will be possible. The schedule should only enable/disable charging at the falling/rising edge, so if charging is disabled by the scheduler, it can be enabled by a button and will be disabled on falling scheduler hour.

This is a draft version of a web interface: Screenshot from 2024-01-09 21-04-41

dialmak commented 5 months ago

Thanks. It's fine. When can I try it?

dzurikmiroslav commented 5 months ago

I working on it... in one week, maybe two ;-)

dialmak commented 5 months ago

Wonderful. You are the best :⁠-⁠)

dzurikmiroslav commented 5 months ago

Scheduler is in master branch, to create first, click button Add scheduler. I'm waiting for feedback ;-) Also serial AT command mode was removed, check serial settings.