Closed sti0 closed 7 months ago
@michaelpiron do you have any ideas on this?
@sti0 for each of the iterations, could you tell what was the status of the optimization? Was it “optimal” in each iteration? can you share the log (DEBUG level) of a bad iteration?
When did you run each iteration? Did you run it at exact at the start of a new half hour? (Xh00 and Xh30)
Last info I’d need: which load cost profile did you feed to the optimizer? Flat tariff?
thx
My first suspicion would be that in some iterations, the available timewindow was too short to meet the number of specified running hours. That could happen for example if the optimization was run just after an halfhour, and timestamp rounding is set to “last”. With the answers to my questions above, I want to test this suspicion.
@michaelpiron will try to reproduce it with the needed information tonight
In fact, the start and end timestep feature was not built to accomodate your use case. Your case would need a logic that tells emhass that the deferrable load has started its program, and hence the remaining hours need to be planned at the beginningof the optimization window (without having to specify the end timestep).
Let’s for now try to debug further and see how you can use start-end timesteps to accomodate your use case as good as possible. In the longer run however, we’ll need a new feature.
But in fact the time endstep should not produce wrong results because only because it's forced to produce in a given timeframe. It should produce the same result if the endtimestep is 6 or 12 as long as the time condition was met.
But I agree a feature to tell EMHASS that the load is running and can't be stopped during the run would be a better solution.
@michaelpiron please find the wanted information next:
which load cost profile did you feed to the optimizer? Flat tariff?
I'm using self-consumption
. With dynamic tariff from Tibber feed into when calling MPC.
method_ts_round
is set to last
.
MPC Call @ 22:39 with def_total_hours
= 3 and def_end_timestep
= 6:
Debug log:
2024-02-15 22:39:05,195 - web_server - INFO - Setting up needed data
2024-02-15 22:39:05,242 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:39:07,078 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:39:07,080 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:39:07,080 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:39:09,444 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:39:09,444 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:39:09,449 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:39:09,458 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:39:09,458 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:39:09,461 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 6
2024-02-15 22:39:09,461 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 6
2024-02-15 22:39:09,465 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:39:09,465 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:39:09,532 - web_server - INFO - Status: Optimal
2024-02-15 22:39:09,532 - web_server - INFO - Total value of the Cost function = -2165.71
MPC Call @ 22:45 with def_total_hours
= 2.5 and def_end_timestep
= 5:
2024-02-15 22:45:14,503 - web_server - INFO - Setting up needed data
2024-02-15 22:45:14,511 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:45:16,249 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:45:16,250 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:45:16,251 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:45:18,440 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:45:18,440 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:45:18,446 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:45:18,453 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:45:18,453 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:45:18,456 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 5
2024-02-15 22:45:18,456 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 5
2024-02-15 22:45:18,461 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:45:18,461 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:45:18,534 - web_server - INFO - Status: Optimal
2024-02-15 22:45:18,534 - web_server - INFO - Total value of the Cost function = -1917.27
2024-02-15 22:45:27,078 - web_server - INFO - EMHASS server online, serving index.html...
MPC Call @ 22:47 with def_total_hours
= 2 and def_end_timestep
= 4:
2024-02-15 22:47:07,647 - web_server - INFO - Setting up needed data
2024-02-15 22:47:07,654 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:47:08,765 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:47:08,766 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:47:08,767 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:47:11,600 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:47:11,600 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:47:11,606 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:47:11,615 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:47:11,615 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:47:11,618 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 4
2024-02-15 22:47:11,618 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 4
2024-02-15 22:47:11,621 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:47:11,621 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:47:11,676 - web_server - INFO - Status: Optimal
2024-02-15 22:47:11,677 - web_server - INFO - Total value of the Cost function = -1674.04
MPC Call @ 22:50 with def_total_hours
= 1.5 and def_end_timestep
= 3:
2024-02-15 22:50:23,523 - web_server - INFO - Setting up needed data
2024-02-15 22:50:23,533 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:50:24,563 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:50:24,564 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:50:24,565 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:50:27,221 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:50:27,221 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:50:27,230 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:50:27,236 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:50:27,236 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:50:27,239 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 3
2024-02-15 22:50:27,239 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 3
2024-02-15 22:50:27,241 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:50:27,241 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:50:27,277 - web_server - INFO - Status: Optimal
2024-02-15 22:50:27,277 - web_server - INFO - Total value of the Cost function = -1425.58
2024-02-15 22:50:29,383 - web_server - INFO - EMHASS server online, serving index.html...
MPC Call @ 22:51 with def_total_hours
= 1 and def_end_timestep
= 2:
=> Scheduled all loads into the first timestep!!
2024-02-15 22:51:48,198 - web_server - INFO - Setting up needed data
2024-02-15 22:51:48,202 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:51:49,433 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:51:49,435 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:51:49,435 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:51:51,598 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:51:51,598 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:51:51,604 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:51:51,610 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:51:51,610 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:51:51,613 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 2
2024-02-15 22:51:51,613 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 2
2024-02-15 22:51:51,615 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:51:51,615 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:51:51,678 - web_server - INFO - Status: Optimal
2024-02-15 22:51:51,679 - web_server - INFO - Total value of the Cost function = -1173.76
MPC Call @ 22:54 with def_total_hours
= 0.5 and def_end_timestep
= 1:
2024-02-15 22:54:03,792 - web_server - INFO - Setting up needed data
2024-02-15 22:54:03,800 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:54:05,526 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 22:54:05,527 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 22:54:05,528 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 22:54:07,614 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 22:54:07,614 - web_server - INFO - Performing naive MPC optimization
2024-02-15 22:54:07,619 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 22:54:07,625 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 22:54:07,625 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 22:54:07,627 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 1
2024-02-15 22:54:07,627 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 1
2024-02-15 22:54:07,630 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 22:54:07,630 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 22:54:07,667 - web_server - INFO - Status: Optimal
2024-02-15 22:54:07,667 - web_server - INFO - Total value of the Cost function = -918.33
Doing the same again after full clock brings the right result in most of the iterations. But still produces the wrong result when running with 1h.
MPC Call @ 23:01 with def_total_hours
= 3 and def_end_timestep
= 6:
MPC Call @ 23:02 with def_total_hours
= 2.5 and def_end_timestep
= 5:
MPC Call @ 23:03 with def_total_hours
= 2 and def_end_timestep
= 4:
MPC Call @ 23:04 with def_total_hours
= 1.5 and def_end_timestep
= 3:
MPC Call @ 23:05 with def_total_hours
= 1 and def_end_timestep
= 2:
=> WRONG RESULT
2024-02-15 23:05:13,647 - web_server - INFO - Setting up needed data
2024-02-15 23:05:13,654 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:05:14,832 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 23:05:14,834 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 23:05:14,834 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:05:17,173 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 23:05:17,173 - web_server - INFO - Performing naive MPC optimization
2024-02-15 23:05:17,178 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 23:05:17,183 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 23:05:17,183 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 23:05:17,185 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 2
2024-02-15 23:05:17,186 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 2
2024-02-15 23:05:17,188 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 23:05:17,188 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 23:05:17,241 - web_server - INFO - Status: Optimal
2024-02-15 23:05:17,241 - web_server - INFO - Total value of the Cost function = -1192.86
2024-02-15 23:05:21,132 - web_server - INFO - EMHASS server online, serving index.html...
MPC Call @ 23:06 with def_total_hours
= 0.5 and def_end_timestep
= 1:
The 1h call produces the wrong results when using first
as timestamp rounding as well:
2024-02-15 23:09:32,925 - web_server - INFO - Setting up needed data
2024-02-15 23:09:32,931 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:09:34,187 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 23:09:34,189 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 23:09:34,189 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:09:36,874 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 23:09:36,874 - web_server - INFO - Performing naive MPC optimization
2024-02-15 23:09:36,883 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 23:09:36,895 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 23:09:36,896 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 23:09:36,901 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 2
2024-02-15 23:09:36,901 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 2
2024-02-15 23:09:36,905 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 23:09:36,905 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 23:09:36,976 - web_server - INFO - Status: Optimal
2024-02-15 23:09:36,976 - web_server - INFO - Total value of the Cost function = -1192.72
2024-02-15 23:09:38,796 - web_server - INFO - EMHASS server online, serving index.html...
And same when using nearest
instead:
2024-02-15 23:11:26,206 - web_server - INFO - Setting up needed data
2024-02-15 23:11:26,247 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:11:27,220 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-15 23:11:27,221 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-15 23:11:27,222 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-15 23:11:29,323 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-15 23:11:29,323 - web_server - INFO - Performing naive MPC optimization
2024-02-15 23:11:29,329 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-15 23:11:29,337 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-15 23:11:29,337 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-15 23:11:29,339 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 2
2024-02-15 23:11:29,339 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 2
2024-02-15 23:11:29,342 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 0
2024-02-15 23:11:29,342 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 0
2024-02-15 23:11:29,401 - web_server - INFO - Status: Optimal
2024-02-15 23:11:29,401 - web_server - INFO - Total value of the Cost function = -1192.53
2024-02-15 23:11:37,021 - web_server - INFO - EMHASS server online, serving index.html...
And of course no change if I use cost
or profit
as cost function instead.
Another strange behavior which I noticed right now. While my deferrable load 2 (washing maschine) is running, deferrable load 0 got scheduled but its "deactivated" (running hours are always 0). And the load seems to be a very small value (not typical usage).
In the following screenshot p_deferrable load 2 is supposed to run for 1.5h with end timestep set to 3 (2200W each timestep).
After running it again a few minutes later it comes to deferrable load 1 (which is also defined with def_total_hours = 0 atm).
2024-02-16 12:24:48,198 - web_server - INFO - Setting up needed data
2024-02-16 12:24:48,232 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-16 12:24:49,729 - web_server - INFO - Retrieving weather forecast data using method = list
2024-02-16 12:24:49,731 - web_server - INFO - Retrieving data from hass for load forecast using method = naive
2024-02-16 12:24:49,731 - web_server - INFO - Retrieve hass get data method initiated...
2024-02-16 12:24:52,597 - web_server - INFO - >> Performing naive MPC optimization...
2024-02-16 12:24:52,597 - web_server - INFO - Performing naive MPC optimization
2024-02-16 12:24:52,601 - web_server - INFO - Perform an iteration of a naive MPC controller
2024-02-16 12:24:52,607 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> 0
2024-02-16 12:24:52,607 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> 0
2024-02-16 12:24:52,608 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> 0
2024-02-16 12:24:52,609 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> 0
2024-02-16 12:24:52,610 - web_server - DEBUG - Deferrable load 2: Proposed optimization window: 0 --> 3
2024-02-16 12:24:52,610 - web_server - DEBUG - Deferrable load 2: Validated optimization window: 0 --> 3
2024-02-16 12:24:52,649 - web_server - INFO - Status: Optimal
2024-02-16 12:24:52,649 - web_server - INFO - Total value of the Cost function = -1200.78
2024-02-16 12:24:57,922 - web_server - INFO - EMHASS server online, serving index.html...
Very strange... When enforcing an end timestep, the only constraint that is added, is the following:
In your case, this means: Deferrable load 2 needs to operate before timestep 3, so its consumed energy between step 3 & end of prediction horizon needs to equal zero.
I don't immediately grasp how this would affect the operating scheme of deferrable load 0. I find it also strange that the optimizer delivers a so-called 'optimal' result, whereas not all constraints were respected (in this case: load 0 was not allowed to run, but it got scheduled anyway.)
I'm not sure if the issues you encounter are specifically related to the start_end timestep feature. Will need to dive deeper. I'll do it as soon as I can. @davidusb-geek would you have any idea?
No idea. This will need testing to debug under these same conditions. I haven't found the time to look at this.
I have the same problem. I do schedule my heatpump to run x hours with a 12 hour interval. I have a 30m timestep. For each timestep I reduce the def_end_timestep and reduce x with the remaining hours to run.
My theory is that it has something to do with the nominal power and when in the window the optimisation runs. When the problem occurs it distributes the total power in fewer timesteps. It seem to sum up to the total.
The problem seem to be intermittent. Someone with script skillz may be able to reproduce this.
Let Deferrable load = x and def_end_timestep = y
If y = 2x I get in trouble. But not always. Deferrable load 0 = 2000 w Deferrable load 1 = 1200 w
The log say Optimal in all cases 2024-02-25 10:29:15,384 - web_server - INFO - >> Performing naive MPC optimization... 2024-02-25 10:29:15,385 - web_server - INFO - Performing naive MPC optimization 2024-02-25 10:29:15,390 - web_server - INFO - Perform an iteration of a naive MPC controller 2024-02-25 10:29:15,393 - web_server - DEBUG - Deferrable load 0: Proposed optimization window: 0 --> y 2024-02-25 10:29:15,393 - web_server - DEBUG - Deferrable load 0: Validated optimization window: 0 --> y 2024-02-25 10:42:01,485 - web_server - DEBUG - Deferrable load 1: Proposed optimization window: 0 --> y 2024-02-25 10:42:01,485 - web_server - DEBUG - Deferrable load 1: Validated optimization window: 0 --> y 2024-02-25 10:29:15,452 - web_server - INFO - Status: Optimal
Example: x = 8 and y = 16
So if y = 2x + 1, the optimization runs fine? I’m trying to reconstruct the issue
So if y = 2x + 1, the optimization runs fine? I’m trying to reconstruct the issue
Yes I think so. I notised this problem this morning so I'm not really sure. But that is my workaround for now.
Any progress on this?
I don't if @michaelpiron was able to reproduce this?
Is there anything I can do to provide help?
I think on to something. The problem seems to be related to set_deferrable_load_single_constant: true
I did a quick test now. Will test more tonight.
When I set it to false it behaves as it should it seems.
set_deferrable_load_single_constant: true ---> problem set_deferrable_load_single_constant: false ---> no problem
To my understanding the villain is set_deferrable_load_single_constant.
@michaelpiron this maybe can be useful if you want to reproduce the issue?
I don't fully understand the functionality of the list_set_deferrable_load_single_constant ('Set each deferrable load as a constant fixed value variable with just one startup for each optimization task (ex. each 24h)'). I've always worked with "false" as I don't need that functionality for my use cases.
So I might not be the best person to deal with this issue.
As written by @davidusb-geek in the HA forum, this is not really a bug, but just the way this type of optimization works. (https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant/338126/2098) Should the optimization code be changed? perhaps, but at this point I'm not able to say how it should change.
Maybe a solution could be to provide a helper to the optimization to indicate that a deferrable load is currently in operation. But this means that the user has to provide this information. Need to figure out the simplest way to achieve this.
Is there any new feature in an upcoming release which fixes this issue?
Describe the bug When scheduling my dishwasher I reduce the
def_total_hours
by runtime. I reduce it every 0.5 hours (-1 timestep). I setdef_end_timestep
=def_total_hours * 2
. I expect that the result schedules the deferrable load one by one for 6 timesteps (3h to run). Each 30m the hours will be reduced by 0.5 and the timesteps will be reduced by 1. Nevertheless there are gaps in some of the calculations. The gaps do not happen whendef_end_timestep
is not set OR when its set to a higher value e.g. 12.Long story short: I like to make EMHASS know that the dishwasher is running and that the energy is needed, therefore I need to use
def_end_timestep
to force it to this given timeframe otherwise it will schedule the "hours to run" somewhen later which makes no sense in this case.To Reproduce
now reduce the
def_total_hours
anddef_end_timestep
each 30 minutes:Expected behavior In each iteration the loads should be scheduled without any gap!
Screenshots
1. iteration (
def_total_hours
=3,def_end_timestep
=6)=> Not ok, gap between timestep 1 and 3, last timestep is doubled up (4000 W instead of 2000 W)
2. iteration (
def_total_hours
=2.5,def_end_timestep
=5)=> Not ok, gap and double watts
3. iteration (
def_total_hours
=2,def_end_timestep
=4)=> Ok
4. iteration (
def_total_hours
=1.5,def_end_timestep
=3)=> Ok
5. iteration (
def_total_hours
=1,def_end_timestep
=2)=> Not ok, second timestep is scheduled to the very last element (+18h)
5. iteration (
def_total_hours
=0.5,def_end_timestep
=1)=> Ok
Home Assistant installation type
Your hardware
EMHASS installation type
Additional context
When not using
def_end_timestep
the calculation is done like expected in "one go": 3 hours: 2.5 hours: 1 hour:When using a greater
def_end_timestep
it works like expected, too: 2.5 hours, def_end_timestep = 12:1 hour, def_end_timestep = 12: