-
Notifications
You must be signed in to change notification settings - Fork 3k
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 date range picker to energy period selector #14337
Add date range picker to energy period selector #14337
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello 🙂
I like the idea but I think there is some design adjustment/questions :
- As the period text length can change, the UI jumps in desktop because the buttons are displayed after the period text.
- There is a today button inside the picker that set the period to today and another today button outside the picker that set the period start to today. It's confusing.
Also, having text buttons, text, icon buttons is not perfect. I'm sure we can improve it
I agree, but I could not think of an elegant naming convention for this problem. |
Is there any remaining task for this issue which I could assist with getting it over the finish line? @TillFleisch @piitaya Happy to provide critical feedback. |
I agree with removing the former today button if the date picker allows a today selection and it seems redundant. |
One possible name for the "today" button could be "now" or "recently". This would help separate the today button and the today date picker functionality. I don't know if this terminology will translate well into other languages. |
I'm thinking about it more, and your addition to the widget supports ranges. Today is only a range of hours. Maybe we should leave that to the existing functionality, and refactor the date range widget to show the following:
This way the user could determine how granular they want it to be, and then use comparison to get this period to last period on the chart. The capability to choose arbitrary start and stop dates is really popular with the community. It would be the critical missing piece for users to compare usage with billing periods and dates starting on a date determined by their utility provider. For instance my billing period can be anywhere from 30-34 days and starts whenever they decide to take a reading. |
Removing the "today" option from the date-range picker is likely a bad idea because it's an option in every other instance of the date range picker and will thus confuse users. I presume the reason as to why we have the separate today button is that the previous implementation only allowed single day/time-interval changes. With the new functionality the old "today" button is not necessary as the user can select the current period directly by either using schortcuts (within the date-range picker) or selecting the period manually. |
d490857
to
980e460
Compare
I rebased the changes onto the current dev branch, since the date-picker dependency has been upated. |
Is there anything blocking this? Looking forward to having this integrated. |
I think this PR just got lost because it's pretty old now and the devs probably don't even look that far back when reviewing. Is there a chance that you could open another one @TillFleisch? |
2d0416e
to
60c5d45
Compare
@piitaya, i have rebased this branch/PR on dev to keep up with related changes. Which further changes are necessary to close this PR? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@rrozema Seriously... 7 hours before your comment the change was made... |
This comment was marked as off-topic.
This comment was marked as off-topic.
I played around with this design a little more on mobile and noticed that the narrow/small time handle is quite inconvenient: My solution for narrow screens reduces the size of the arrow buttons. This does not feel like a 'legal' move.
Is there a 'smallest phone size' Home Assistant is targeting design-wise? Does anyone have other suggestions, recommendations or opinions on this? |
72a0e6a
to
d654c23
Compare
I think the automatically applied cast label is incorrect. |
It would be great to see this go live someday. Can I help? |
This reverts commit d5a2aca.
d9cc503
to
b088a4f
Compare
We could also show Quarters as |
It is not supported by the default |
Quarters are often vague, and depending on the country - or even individual corporations - Q1 can mean anything from Jan 1 - Mar 31, or Feb 1 to Apr 30, or Jun 15 to Sep 15, etc. |
@teodorch85, please open a separate issue for this (if there isn't already one), so that we can keep track of this issue. I too can replicate this on a (core 2024.2.2/front 20240207.1) instance. The reported values don't change, once enough days have been selected so that "months" are shown in the bar charts. Adding a day in this scenario does not change the values when it should. Note that the low-carbon circle does change. |
Proposed change
Replace/Add the date range picker from history/logbook to the energy dashboard. This enables custom date ranges on the energy dashboard.
Pre-defined range selection is still possible using the date range picker. The arrows still serve the same functionality as before.
Original proposal:

Current proposal:
See comment
Type of change
Example configuration
Additional information
The date range picker always opens to the right and can thus potentially leave the window.
This behaviour should be changed before this PR get's approved. I did not want to mess with that part, but ideally the date picker would always open towards the middle of the window.
Checklist
If user exposed functionality or configuration variables are added/changed: