Closed Kedryn closed 1 year ago
and a show_last_actioned
for when the last time a scene was run.
did you try
state_display: >
[[[ return entity.last_updated; ]]]
show_state: true
you might want to format that a bit, as indeed it is the raw last_updated returned form the state machine
@andyblac what is show_last_actioned
...... iow, how would you expect button_card to show a non existing state attribute?
well, when I use show_last_changed: true
for a scene button for example, it does not show the last time the scene was accually run, unlike the lovelace entity card. It just seems show the last time anything happened, i.e. if you restart HA the time just gets that time, or if you chnage the scene thats the time it shows. but it does also show the last action time IF nothing has touched the scene since it was last run.
what I am after is a NEW varible that is acutally linked to the state date time, but in human readable format.
or is there another way I don't know about ????
Will be possible with the next release with state_display: [[[ return formatDateTime(entity.state); ]]]
for example in your case.
this is in b7? I cant make it happen I am afraid.
Not yet released. Fixing some bugs with other stuff.
:tada: This issue has been resolved in version 4.0.0-dev.8 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
beautiful!
type: custom:button-card
entity: script.aan_de_slag
show_state: true
state_display: |
[[[ return formatDateTime(entity.attributes.last_triggered); ]]]
@RomRider Thanks for the addition, would it be posible to add the ability the convert to relative time
, i.e. 36 Seconds ago
, 2 Minutes, 36 Seconds ago
, 1 Hour, 2 Minutes ago
?
The difference with relative time is that it needs to update over time automatically like when using show_last_updated so that's something different. I'll see what I can do as I wasn't aware about the last_changed property until reading this thread 😅
if I am allowed to piggyback on this:
would it be possible to only show formatTime
? (making that up as I type, so dont take it to be an existing format)
for many of those last_changed/triggered/updated entities the dat is not important, the time would be though. Having a dedicated setting for it would be very much appreciated
- type: custom:button-card
entity: person.marijn
state_display: >
[[[ return formatDateTime(entity.last_updated); ]]]
show_state: true
@RomRider Thanks, it's just the standard lovelace entity card uses relative time when using a scene entity. also the last_changed
and last_updated
are reset if HA is restarted to the time it was restarted, not very useful. A entity scene does not have a last_triggered
attribute unlike scripts, automations, etc.
In the next version about to be published, I've introduced a relativeTime
function.
So you'll be able to do something like:
state_display: '[[[ return relativeTime(entity.state); ]]]'
And it will update automatically over time.
:tada: This issue has been resolved in version 4.0.0-dev.11 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
@RomRider nice one, works great.
Breaking change in the latest beta on this, please read the release notes ;)
:tada: This issue has been resolved in version 4.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Is your feature request related to a problem? Please describe. Missing a way to show the time from the last update to te displayed entity
Describe the solution you'd like a "show_last_updated" like the "show_last_changed" to display the time since last sensor update (expecially for button related to gps positions)