-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add ability to set sitemap chart period to a future period #2518
Comments
We just need to define the sitemap syntax to request a chart in future Waiting for the best proposal. @openhab/android-maintainers for info. The change in Basic UI will then be easy. |
I just checked, a value starting by a minus for the period would be rejected by the current syntax. |
Ok, I believe I found an easy and relatively intuitive solution that is also backward compatible. The idea is to extend the value of the period attribute to accept an optional prefix, either "last:" or "next:". |
Maybe a stretch, but what if someone comes up with the request to have a timerange from past to future? I don't have a use for it, but I could see it being useful. The way this is going we would need yet another syntax to make that possible. I am not saying we should support this, but we may create something that would allow a reasonable syntax when we would do something like that. And in such a case I don't think we can get away from 2 (or even 3) arguments: "history", "future" and "resolution". You could skip "resolution" if you expect the user to always use the same for history and future (and give an error when not). |
I suggest that we should not consider '-' as 'minus' symbol but consider rather as a 'range-until' marker. The new syntax would be
|
This is a good point, what if we want a chart that spans a period from the past to the future? I like the suggestion of "last:" and "next:" to indicate past and future periods though I think the terms "past:" and "future:" are possibly more self documenting/intuitive. What if we used symbols such as brackets or square backets to indicate that new syntax is being used? The existing syntax could be left as is and a new syntax introduced such as:
To indicate a period of two days into the past and one week into the future. The previous syntax could maybe be deprecated at a future point. |
What about something like an offset?
|
As I suggested in my prior post, you do not need the prefixes. The syntax for the above range can be simplified to '2D-W' .. |
I am ok with @andrewfg proposal. This would also require a change in the chart servlet to support this new syntax and compute automatically start and end date/times from this period if not provided. |
Indeed it can be simplified, yes. There are pros and cons to both verbose intuitive syntax and concise less intuitive syntax for users with a variety of skill levels and... ability to read documentation. I know, because I don't always read the documentation fully myself :) |
Apropos this, @lolodomo, can you make a note that any eventual PR should also update the doc. :) |
Yes, obviously. |
Closes openhab/openhab-webui#2518 Signed-off-by: Laurent Garnier <[email protected]>
Closes openhab/openhab-webui#2518 Signed-off-by: Laurent Garnier <[email protected]>
Related to openhab#2518 Signed-off-by: Laurent Garnier <[email protected]>
* [sitemap] Extend chart periods to cover past and future Closes openhab/openhab-webui#2518 Signed-off-by: Laurent Garnier <[email protected]>
Related to #2518 Signed-off-by: Laurent Garnier <[email protected]>
Remains to do an update of openHAB documentation. |
Also remains to adjust sitemap UI configuration. |
You mean sitemap generator in Main UI ? |
Yes, indeed, parser and configuration UI. I will have a look into that. |
@lolodomo maybe also the dropdown list for the time series button ?? |
Already done and merged. |
Chart widget sitemap configuration has been extended with support for future periods in openhab/openhab-core#4172. This adds configuration in the UI. See #2518. Signed-off-by: Mark Herwege <[email protected]>
Related to openhab/openhab-webui#2518 Signed-off-by: Laurent Garnier <[email protected]>
I have now proposed the change in the documentation. @openhab/ios-maintainers |
The Android app handles the chart period as string, but doesn't try to parse it. So I guess it should work with the new syntax. |
Fine. Through the "menu" to update the chart period, you could now also propose predefined periods in the future, like I did in Basic UI. |
#2284) Related to openhab/openhab-webui#2518 Signed-off-by: Laurent Garnier <[email protected]>
Documentation now updated. |
Which UI are you reporting an issue for?
The problem
I have changed my electricity supply tariff to the Agile tariff with Octopus in the UK. This is a dynamic tariff with a unit price per each 30 minute period of the day. The future (the prices for the next day are released at 16:00GMT every day) prices can be read via the Octopus API, for instance the prices for the North West can be found here.
I have persisted the future prices with some rub code with the help of JimT using a timeseries item and would like to be able to show the future prices in a chart in a sitemap but can only configure the chart to show historic prices.
Your suggestion
Allow charts in sitemaps to be configured to show future periods as well as past periods. Maybe allow future periods for the same durations as the current past periods.
Your environment
OH 4.1.2
Additional information
I opened a thread in the OH community about this here and was advised to raise an issue here.
The text was updated successfully, but these errors were encountered: