-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[aWATTar] Bestprice items are set to UNDEF at 0 a.m. #17316
Comments
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/awattar-binding-beta-and-discussion/110497/111 |
I can confirm this, would really appreciate the desired behavior described in OP |
@J-N-K could you please assign the bug to the maintainer of this add-on? |
Last changes were done by @tl-photography, as far as I am aware of. |
Hi, the refresh handling of 4.2.1 is still the "old" way: https://github.com/openhab/openhab-addons/blob/4.2.1/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java#L182 My fix with more refreshes during the day will be probably included in the next release: https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.binding.awattar/src/main/java/org/openhab/binding/awattar/internal/handler/AwattarBridgeHandler.java#L186 The current handling should be once the bridge signals a refresh recalculate. But only at 1500 or when the bridge is reloaded. |
@aMU5Ed can you share your bridge config? |
@tl-photography: I've the same problem, values get deleted at 0 a.m.
|
@cybermcm thanks this looks fine. Doe you have also the thing config handy? |
@Herschdorfer: Do you mean the best price thing?
|
I have a suspicion, can you change the duration to 23 instead of 24? |
I think the change is available in 4.3.0 milestone 1 check release notes here: |
@tl-photography: I'll change the value and report back |
@tl-photography: changing the duration to 23 hours solved the problem, values are still there today. A useful workaround! Thank you. |
I guess the calculations fail because it tries to retrieve from 0:00 to 0:00 the next day, but 0:00 the next day is not yet available. @J-N-K I would suspect the changes you made with the time series... |
For my understanding, the issue is fixed in 4.3.0M1 and there is a workaround for 4.2.1 with a 'minor' issue left of 00:00 not being available. If this is true, i suggest to close this issue or to continue wrokaroudn discussion in the community forums as there is nothing left to fix? Does this make sense? |
@lsiepel: The workaround is OK for now, but I'm not really sure if the underlying problem is really fixed in 4.3.0M1? |
I'm also not sure if the issue is fixed. I believe the issue is still present in 4.3.0M1. |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/awattar-binding-beta-and-discussion/110497/114 |
Sorry for the delay. The flood catastrophe here in austria kept me busy during the last 2 weeks. Here is my bridge config: and here the thing config:
|
It's the same thing as for @cybermcm. I bet if you change the rangeDuration to 23, all will be good. |
@tl-photography Seems to work(around) :-) |
I was thinking if this is really a bug or kind of "correct". If a time range of 24 is given from a time of 0:00, then the rang would be always until 0:00 the next day. But these values are not yet defined. Therefore this is kind of "correct" that the channel goes into "undef". Maybe this should be better documented, but the calculation would be always incorrect when using more than 23 hours, as long as the forecast is 24 hours in the future. |
In my opinion 24h should work at least for certain definitions. E.g. the range given in your example means the timespan of 00:00 to 23:59:59.999, which is known as soon as the prices for a day are fetched (except for the daylight savings time switch in spring, where the day only has 23 hours, so there will be one day every year where this definition will cause problems :-) ). It will not work well with starting times between 01:00 and 14:00, because there the timespan crosses midnight of the following day and the prices are not available in time. So at times when the binding is able to compute the cheapest hours, it could be that they are already in the past. |
Alright, that's true there are some cases where it should work. I agree! But wouldn't then also the recalculation trigger need to be changed? The timespan crossing 0:00 would not be calculated correctly before the next update around 14:00 from the API. |
Any timespan can only be calculated under the following two conditions:
I can't remember exactly how I implemented the recalculation originally, but it probably worked this way:
So overall the calculation originally was done on demand when channels of the things were requested, not when the prices were fetched. I did not check how the code does it now, so I can't tell exactly what (if anything) would need to be changed. So my recalculation "trigger" finally was the request of data from any of the channels. |
Hi, I wanted to calculate e.g. the 10 cheapest hours of a day for the heat pump and used the configuration example from the documentation which defines the timespan from 0 to 24. This has caused the mentioned problem that from midnight to 2 pm the result was undef. Unfortunately, the hotfix with using 23 as duration is also not fully correct, as it won't select the last hour of a day (23:00 - 00:00) anymore. As an example from today's price level: If I select the 10 cheapest hours, I would expect 0,1,2,3,4,5,11,12,13,23 but the result from the binding is 0,1,2,3,4,5,11,12,13,22. As mentioned above, the end time checked by given duration should always be XX:59:59... and not the next full hour. This should also include/fix start=1+ duration=23; start=2+duration=22 and so on. |
After a quick look into the code, I might see a change to fix it here, but I didn't find the time to try it out, yet: Line 142 in d18df74
I think it should work if the second clause in the if is changed and the timerange.end() is reduced e.g. by one second to move into the previous hour. |
This comment was marked as outdated.
This comment was marked as outdated.
@aMU5Ed, @cybermcm, @asprom - can you try this? org.openhab.binding.awattar-4.3.0-SNAPSHOT.jar |
Resolves openhab#17316 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Resolves openhab#17316 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
@jlaur I'm on 4.2.2, is it safe/OK to use a 4.3.0 jar file? |
Let's play it safe, here's a backported version: org.openhab.binding.awattar-4.2.3-SNAPSHOT.jar |
@jlaur thank you, I'll install it and keep you posted |
@jlaur: Set "Range duration" back to 24h, tested it from yesterday to today, values are still there! Thank you |
Resolves openhab#17316 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Thomas Leber <thomas@tl-photography.at>
I am using openhab 4.2.2 with aWATTar Binding 4.2.2. |
No. For now, you can use the version posted here: #17316 (comment)
The fix will be included in the next 4.2 patch release, but the release date is not yet settled. |
Resolves openhab#17316 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
Resolves openhab#17316 Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
Expected Behavior
Best Price items should be recalculated when the new prices are fetched from the aWATTar API
Current Behavior
With the upgrade from 4.2.0 to 4.2.1 the addon fetches the prices and delivers the value to the configured items for the best-price calculation.
This works from 2 p.m. until 0 a.m. With 0 a.m. the timeslots and the switches are set to UNDEF and therefore do not work until 2 p.m.
Possible Solution
Best Price items should be recalculated when the new prices are fetched from the aWATTar API
Steps to Reproduce (for Bugs)
Context
Bestprice calculation
Your Environment
Raspberry Pi 4 8GB
Ubuntu 24.04 LTS
zulu Java 17.46.19 aarch64
OpenHab 4.2.1 Release build
The text was updated successfully, but these errors were encountered: