OpenDTU icon indicating copy to clipboard operation
OpenDTU copied to clipboard

Dynamic Limit API

Open unaiur opened this issue 1 year ago • 10 comments

Is your feature request related to a problem? Please describe.

I want to implement dynamic power limits using Web API of OpenDTU to ensure we do not dump more than 600w to the network as required in most countries in EU.

The problem is that, if the WIFI or the controller dies, the limit may be left unmanaged at a value that is too high.

Describe the solution you'd like

The easiest solution I can envision is a new dynamic limit WebAPI that receives a temporal limit in Watts and a timeout in seconds. This API will cancel any previous scheduled reset that may be pending, apply the new temporal limit as non-persistant and schedule a limit reset in the given amount of seconds.

This way, if no new limit is received in X seconds, we revert to the persistent limit. This will reduce the chances of uncompliant energy dumps greatly.

Describe alternatives you've considered

No response

Additional context

No response

unaiur avatar Sep 11 '23 12:09 unaiur

If there is no easy way to retrieve the persistent limit, I would add an extra parameter to the new API with the fallback limit to apply when the timer expires.

unaiur avatar Sep 11 '23 12:09 unaiur

I want to implement dynamic power limits using Web API of OpenDTU to ensure we do not dump more than 600w to the network as required in most countries in EU.

I think you don't understand the intention to the (8/6)00W limit.

Why not set the persistent limit to 600W and change only non persistent afterwards?

Heiko-L avatar Sep 12 '23 09:09 Heiko-L

Of course, the persistent limit is set at 600W. I fully agree on that and now I have permanently set at this limit.

But, when my home consumption is above 600W and no power is dumped on the grid, I would like to raise the limit to my current consumption.

For example, if I turn on the oven (which consumes ~2000W), I would like to temporarily raise the limit to 1200 (maximum for my panels). If I turn on the microwave (~900W), I would like to raise the limit to 900W.

No problem here. I have an energy meter that can provide measures multiple times per second and can raise the temporal limit when possible.

The problem is reducing the limit when the oven or microwave finishes.

If everything goes well, the limit will be readjusted in milliseconds and there is no problem at all.

But imagine something happens to my wifi and the command to reduce the limit never reach OpenDTU.

That is the problem I would like to avoid having OpenDTU rolling back to the permanent limit if the temporal limit is not updated in last X seconds.

Of course, it will be even better to have this logic in the inverter, but its firmware is not open source.

unaiur avatar Sep 16 '23 20:09 unaiur

Ok, but the easy way is, read the actual limit regulary and if it's not as expected set the limit again. So you can cover small wifi outaged and it's best practice as well. Never trust an fire&forget. If your wifi outage is longer you have to fix your wifi.

jonnycastaway avatar Oct 05 '23 13:10 jonnycastaway

But imagine something happens to my wifi and the command to reduce the limit never reach OpenDTU.

how do you deal with problems on your openDTU itself?

You can always have problems somewhere. If it’s not WiFi, it’s the power brick of your DTU or the DTU itself. If you need a real and permanent solution, you need some other hardware.

In my case my server and wifi is way more reliable than my openDTU or the NRF-connection.

spcqike avatar Feb 06 '24 20:02 spcqike

@unaiur please double check the Dynamic Power Limiter (DPL) function in the daughter project OpenDTU-OnBattery.

I have described a possible PM+DPL setup with a Shelly Pro3EM as Power Meter (PM) here in issue #272.

stefan123t avatar Aug 06 '24 07:08 stefan123t

@unaiur please double check the Dynamic Power Limiter (DPL) function in the daughter project OpenDTU-OnBattery.

I have described a possible PM+DPL setup with a Shelly Pro3EM as Power Meter (PM) here in issue #272.

But OpenDTU-OnBattery can only use 1 Inverter for this function. With an extra System you can regulate as many as you want(4 in my case).

jonnycastaway avatar Aug 06 '24 21:08 jonnycastaway

@jonnycastaway i am not sure whether OpenDTU-OnBattery only limits a single inverter. I thought DPL would limit all inverters, but then I have only one and cannot test / verify that.

Some made a suggestion to group inverters into PV pools, eg per phase A/B/C or per battery. That way you could specify a per pool limit or set the limits based on a schedule (before/after sunset).

See feature request #1865 and discussions #1608 and #1095.

stefan123t avatar Aug 06 '24 22:08 stefan123t

@stefan123t At the moment you can read multiple Inverters but for limitation you can only use one. Yes there are ideas with groups but as i can see nothing is implemented. Setting the limit of a group is not an option for me because is have 4 systems an they look at different directions. So why limit a system that generates only little power. My logic is doing this every 10 seconds: Read the generated power (W), select the system that generates the most power, decrease this system. For increasing it selects the system with the lowest limit.

But'll have an eye on -OnBattery because it would very cool to have this function on the DTU. In the meantime i'm working on to migrate my logic from javascript/blockly to an extra ESP32 with display and to visualize the systems.

image

jonnycastaway avatar Aug 07 '24 06:08 jonnycastaway

@jonnycastaway I understood from @schlimmchen that he is working on an improved DPL feature in OpenDTU-OnBattery with the purpose of managing / controlling more than one inverter.

stefan123t avatar Aug 15 '24 08:08 stefan123t