Closed Hiekkaharju closed 1 month ago
I'm not 100% clear what you want to achieve?
The use case is that for certain tracker I typically want to see where it has been today. But sometimes I want to know where it has been in more recently. And as it's routes are often such that they overlap or are very close to earlier ones, it can be difficult to see that with that view. So currently I have to edit the dashboard to change the number in history_start: # hours ago to get a cleaner view of a shorter period. Of course a start/end date AND time selection, like in HA history view, would be a more generic solution to this, but I'm not aware if and how one could use such with a custom card.
So a DateTime picker instead of the Data picker. Could be doable by forking the custom:energy-date-selection and add some options to it.
Another possible approach is use something like https://github.com/GeorgeSG/lovelace-time-picker-card to update an entity ala input_datetime.somethingsomething
. The Map card could then in theory be configured to use that entity as startTime/endTime source.
Could potentially even support as historyStart: input_datetime.myEntity
I assume it'd be possible to find the entity and subscribe to changes on it, tho mechanism would ultimately be quite different to linking in with the energycard date ranges, but i imagine fairly doable.
I'm not sure how this approach with time picker card should be interpreted when currently it is possible to give dynamic ( 8 hours ago ) and absolute ( 9:46 ) times in start and end times. Perhaps it would mean allways absolute times on the start and end days selected by energycard, or today if that is not defined.
I have a proof of concept using a input_number.test_number_value
controlled via custom:numberbox-card
. WIll see if i can grab an hour or two free this weekend to turn it in to something usable.
I must say that you either know really many custom cards or are good in finding suitable ones :) I'm looking forward to what you will at some point present. Thank you for your effort.
I'm more aless just blindly search HACs for something that sounds relevant :P The approach for the below doesn't actually use the other card at all, it instead just talks to the entity that card is managing. In theory this means it could be controlled via any card/integration that can set the value, which could give some interesting results.
Any feedback on my proof of concept
To me the approach looks good. Would seem to do what I wanted already now. Naturally making it more generic for others, and possibly for my coming desires, would be great - at least allowing the same for end time. Also I did not notice anything special in the code, but js really is not my area.... Unfortunately I can't actually try the #47 version now.
Now I got to also try. With stock entities card controlling the input_number for now. Got it working ok. Both with or without suffix and with various suffixes. If I got it right, you did not (yet) enable this possibility on entity level.
Thanks for getting this ready. btw: I'm now using this in a panel-type view with custom:hui-element to have a big map but still have the controlling entity in the same view
I actually tried doing this with https://github.com/iantrich/config-template-card and an input_number, but the way the template card draws the card "inside" it prevents this card from drawing anything else than the map (it always draws the card from scratch, only a single render() during lifetime of one card instance). I considered an FR about the way this card is drawn but abandoned it. Now inspired by the date explore capability by @thybag I suggest similar functionality for exploring # past hours. E.g. if pastHoursHistoryEntity is set and points to an entity that returns a number, consider it as if
were defined and # is the number returned by the entity. This could be both on card and entity levels.