Skip to content
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] Add inverted best price #16877

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

tl-photography
Copy link
Contributor

The goal is to add an inverted best price to the aWattar add-on.

If you set the ìnverted` flag via configuration it will return the inverted result of a best price.
So if you set for example 4h and inverted, the four hours with the highest price will be selected.

Does currently not work with the consectuive flag.

@AndyNeubacher
Copy link

As i understand this is what i've intended with the #16813, but in my situation i'm using both ... the "BestPrice" AND the "WorstPrice".
Means i've to decide inverted OR not-inverted - so IMHO for me that doesn't really help!?

Or can i add two BestPrice-Things at the same time?

@J-N-K
Copy link
Member

J-N-K commented Jun 16, 2024

Yes, you can add as many as you want.

@Herschdorfer
Copy link

As i understand this is what i've intended with the #16813, but in my situation i'm using both ... the "BestPrice" AND the "WorstPrice". Means i've to decide inverted OR not-inverted - so IMHO for me that doesn't really help!?

Or can i add two BestPrice-Things at the same time?

You could now add two things, one inverted and one normal. That should solve your problem.

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Jun 16, 2024
@lsiepel lsiepel changed the title [aWattar] added inverted best price [aWattar] Add inverted best price Jun 16, 2024
@lsiepel lsiepel requested a review from jlaur June 16, 2024 18:07
@Wolfgang1966
Copy link

There is maybe one scenario that the "inverted best price" logic could not cover: If for any reason you want to have a consecutive worst price range, this would not work, as the inverted consecutive best price range could give two ranges, one from midnight to the start of the bestprice range, the other one from the end of the bestprice range to midnight.

Also an inverted WorstPrice Thing would then give two timeranges excluding the worst prices of one day.

If there is really a usecase for that, then the WorstPrice thing would be needed.

Is this the use case you are thinking of?

@tl-photography
Copy link
Contributor Author

tl-photography commented Jun 20, 2024

Thanks for the review!

The combination of inverted price range and the 'consecutive' flag is not implemented. Please have a look at my added docs here https://github.com/openhab/openhab-addons/pull/16877/files#diff-a36be23b36348afb82551140aebb05c720bd773cf7755c6a3a6e0cfa55da8890R48.

I also added the inverted price range only to the non-consecutive code path.

It's basically just a quality of life change, where I can specifically tell to, for example, not switch on the water boiler on the 10h with the highest price.

It is also a request in this issue: #16813

Copy link

@Wolfgang1966 Wolfgang1966 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you very much

@lsiepel
Copy link
Contributor

lsiepel commented Jun 23, 2024

Can you fix the conflicts?

@tl-photography
Copy link
Contributor Author

Sure, but it might take me unfortunately until Wednesday.

@tl-photography tl-photography force-pushed the feature/awattar-worst-price-2 branch 2 times, most recently from a3108f7 to 750cd4b Compare July 1, 2024 17:41
@tl-photography tl-photography force-pushed the feature/awattar-worst-price-2 branch from 750cd4b to e72d9b4 Compare July 1, 2024 17:43
@lsiepel lsiepel merged commit f7bcbe1 into openhab:main Jul 12, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Jul 12, 2024
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Jul 18, 2024
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
Signed-off-by: Thomas Leber <[email protected]>
Signed-off-by: Patrik Gfeller <[email protected]>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
@jlaur jlaur linked an issue Nov 16, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aWattar] Bestprice Thing -> feature request: "WorstPrice" channel
6 participants