Using last_changed value in button name but it doesn't update #98
Unanswered
MattPuffin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Disclaimer: While I'm not new to HA, I am new to going much deeper than just accepting what HA shows me with the default cards. So apologies if I am going about this completely wrong!
paper-buttons-row has blown my mind in terms of how much better it has made my lovelace views look, but it's sent me down a rabbit hole for perfection which maybe isn't the best :)
I set up a row to show my back door sensor and a temperature sensor for the room, but I wanted the door sensor to say how long it had been since the state last changed (I used to have a history graph showing the door sensor but it was awful)
This is what I have set up:
And this is the code:
The issue it that when the state of the door changes, the button updates to say 0 seconds ago, but it will stay saying that until the browser is refreshed etc. Is there a way to force it to update every x seconds for example?
I would also love it if I could force the x minutes ago to be on a new line so the button would read:
Back Door
3 minutes ago
But that's much more trivial, if I can just get it working I'll be happy!
Beta Was this translation helpful? Give feedback.
All reactions