waltervl wrote: Tuesday 03 February 2026 13:48
Please define offpeak hours.
Is that the hours with lowest energy tariffs?
For my usage, yes.
I'm working on a plugin to smart charge my EV car.
In France, most of users are with the national company, EDF.
Within this company, you can choose different contracts, for different power, single or tri phase, and you can select if you want some hours with lower cost (at night, in majority) = dual tariff.
"if you want" means you can select a "normal" contract, without any offpeak hours (single tariff).
I have a domestic battery which is charging during offpeak hours (23:30 - 7:30 for me)
the battery is set to always keep at least 50%
From 7:30, the battery is discharging until it reaches 50% (without solar, it happens around 13:30)
If solar production is good, the battery is able to charge and powering the home. Then the 50% is reached at 17:30, during this winter.
If and when I will have too much power, I will adapt the script.
My smart charge logic is:
when the car starts charging, check if we are in offpeak hours (wall charger is hard-coded to deliver energy only between 2330-0730).
if we are, calculate how much kWh is needed to reach the charge limit (read from the car), then reduce car charging power (amperage) so that charge ends at or before 7:30 (knowing min and max amps, and car battery capacity)
if we are not, check if car is lower than 25%
if yes, charge at max amps until 25%, then stop charge and wait for offpeak hours
if not, stop the charge
The goal is to use the lowest charge speed possible to reach the target, without using max power.
At the moment, I'm using a USB TIC device, which creates an alert sensor for offpeak hours (alert 1) or normal hours (alert 2).
But I wanted my plugin to be usable by everybody
As a replacement, I'm using User Variables.
As we are able to set
Cost T1 and
Cost T2 (in Settings, Meters/Counters), and those settings are readable from
Code: Select all
json.htm?type=command¶m=getsettings
I was expecting the same feature for hours for T1 and T2
The advantage of this webpage (json.htm) is that it can be read without password if exception is set for 127.0.0.1
I also would like to see the current domoticz HTTP/HTTPS running port in this webpage, should I create a new subject?
I would use it to create a room plan at first plugin start to assign all new devices to a specific plan.
Here:
OpenDTU Plugin I assume the port is 80
Thanks