hombach / ioBroker.tibberlink

links tibber API data to be used in ioBroker
https://github.com/hombach/ioBroker.tibberlink
GNU General Public License v3.0
23 stars 5 forks source link

Feature Request: Limit calculations to a time slot #153

Closed volkerrichert closed 11 months ago

volkerrichert commented 1 year ago

i'd like to have the best price calculations to be limited to a timespan.

e.g. i'l like my e.g. dish washer / car / battery pack to be finished / charged at 8am. But when i schedule a "best block", it may get triggered noon.

Volker

hombach commented 1 year ago

same feature requested in #169 by @wunderlag

hombach commented 1 year ago

my current idea of implementation would be:

Are there better ideas? Doing it this way would be quite good to implement and will work with all 3 existing channel types.

This is not the same than "run each day from 12:00 to 19:00" .... !!!

Wunderlag commented 1 year ago

First of all, the adapter „tibber“ already does this, maybe you can find inspiration there. (Sadly it’s a little buggy, you can’t get it to run from 23:00-01:00 for example)

Thoughts on your implementation:

  1. just „EndHour“ could mean 16:00 today or 16:00 tomorrow. (As I understand it, the prices overlap a couple of hours?)
  2. Full hours are sufficient
  3. Having separate „EndHour“ and „active“ gives possibilities for checking the state and deactivating more clearly
  4. I’m not that fond of your current implementation with the settings inside the instance. It would be nice to set all available parameters with a script

I’m on mobile now, if needed I can elaborate further when I’m home

thanks for that awesome adapter btw ;)

Edit:

Of course, your current implementation would be very easy to set up for the user, but it's not very flexible. Maybe you can just add an "advanced" mode that can be controlled by script, that would involve the following:

and that would be all I think?

hombach commented 1 year ago

@Wunderlag

Maybe i want to control a second parameter dependent on the actual price (i.e. start charging and change SOC limit of a battery, but dependent on the actual price for that timeslot, ...).

You could have some simple Blockly scripting or just use two channels in TibberLink with the same config - one writes true for charging the other has a SoC Value as output.

Wunderlag commented 1 year ago

I see your point, but my usecase would be

The next day it could be 5kWh PV Output, so SoC should be at 83%

maybe I’m overthinking this stuff?

volkerrichert commented 1 year ago

@Wunderlag I have the same use case. But how do you estimate PV output? All services provides wrong values (+50% - -50%)

Wunderlag commented 1 year ago

@volkerrichert i checked for a couple of weeks and came to the conclusion that mix of 2 sevices (forecast.solar + solcast / 2) comes pretty close, only problem now would be snow covered panels, but that's not really soveable I think :)

volkerrichert commented 1 year ago

@Wunderlag i have 3 different parts 2x south (32 & 12 Grad) and 1x north. That's not easy, sure. How do you do it? Just use the average?

Wunderlag commented 1 year ago

@volkerrichert oh yeah that might have a big impact. i only have one array facing directly south with 40° angle, this way there are almost no errors that can cause bigger ripples.

If you can, maybe save every single arrays daily output for a couple of weeks (with iobroker history or sql) and also map the forecasts from at least 2 sources (maybe even each with 3 settings for your 3 arrays). then use the data and try to match it. Maybe it's as easy as taking like (forecast x 0,6) for your estimates if its aligning better?

volkerrichert commented 1 year ago

@Wunderlag yes, maybe something like that.

hombach commented 12 months ago

@volkerrichert I would also try to get a better estiamtion by tracking first as @Wunderlag explained.

@Wunderlag : got your point.... for me this sounds like an extra feature request: e.g. "Have a JSON input interface for calculator settings" -> JSON Input-Object to be read and deleted afterwards by adapter - there could be all data included that should be changed in the "internal" config (and perhaps also in the state objects)

Wunderlag commented 12 months ago

@hombach That would work too, my explanation stems from the way I have implemented it from the other adapter and of course that would be easier to change if you did it my way ;) but I guess with some work on my scripts I'll be able to adapt to a JSON style option

shelly20222 commented 12 months ago

@hombach thank you for your work. It is really great to have this adapter. and thank @volkerrichert @Wunderlag to your suggetions. I really have the same thoughts, so I am looking forward to a new version with the mentioned features :-)

hombach commented 11 months ago

"Have a JSON input interface for calculator settings" -> JSON Input-Object to be read and deleted afterwards by adapter - there could be all data included that should be changed in the "internal" config (and perhaps also in the state objects)

@Wunderlag I filed a new feature request to cover this needs: #194

hombach commented 11 months ago

To cover the base idea of this request "Feature Request: Limit calculations to a time slot" I want to implement:

hombach commented 11 months ago

in implementation, version 1.6.0

hombach commented 11 months ago

HINT: The calculation is performed for "multiday" data. As we only have information for "today" and "tomorrow" (available after approximately 13:00), the time scope is effectively limited to a maximum of 35 hours. However, it's crucial to be mindful of this behavior because the calculated result may/will change around 13:00 when new data for tomorrow's prices becomes available.

To observe this dynamic change in the time scope for a standard channel, you may opt for a Long-Term Forecast (LTF) spanning several years. This is particularly useful for the "Best Single Hours LTF" scenario.

hombach commented 11 months ago

1.6.0 released to "latest" repository

shelly20222 commented 11 months ago

I have tried the new feature over night. But somehow it didn't work.

These are my settings: image

image

Tibberprices were best at around 3 a.m. Is there something wrong in my settings?

StartTime: 2023-11-28T19:00:00.000+01:00 StopTime: 2023-11-29T05:00:00.000+01:00

Or ist there something wrong with "beste Einzelstunden LTF" / "beste Stundenblock LTF" ? What is the difference exactly?

hombach commented 11 months ago

did you set active to true? Einzelstunden (best single hours) are the amounthours number of absolute best hours. Doesn't matter when. Best hours block is seaching for the best block of amounthours number of hours with the lowest total cost.... so for a washing mashine you should use best hours block

shelly20222 commented 11 months ago

The active was Not Set to true. I have Tested IT and now it works fine. Thank you very much

hombach commented 11 months ago

OK - so I'll close this issue