I’m new to home assistant and am having trouble getting started. I have what feels like a simple (if a bit offbeat) first project: I want to get a button that logs the history of when this button is pressed and shows the last time the button was pressed.
I saw the below link but I think the code provided is either incomplete or I’m lost trying to follow it (and the solution was NodeRED, but I’m actively trying to learn HA):
It’s possible that you could simply tie that button to a script and then use the History component to view when the script was activated. You could also make a template sensor that registers activity when the script is run and use the History component to count the number of times in a specified range that the sensor sensed the script running.
Thanks for the reply @paddy0174 This seems like it should be straightforward but I’m still confused.
I should I could “Add Card” → “Button” → “Show Code View” and add “show_last_changed: true” but I get an error:
Visual editor is not supported for this configuration:
Key "show_last_changed" is not expected or not supported by the visual editor.
You can still edit your config in YAML.
Does that mean this ‘feature’ is beyond the scope of the GUI & I need to go open the yaml file on the HASS system?
This is what I get for putting a project to the side >_<
So it looks like “button card” that you linked paddy is no longer being updated? The “check-button-card” linked by Sparky-Dave seems to be in use, so I’m currently using that.
This is what I have so far:
type: custom:button-card
show_last_changed: true
name: test button
label: When this button was last pressed
show_label: true
I see the label & the title, but I don’t see anything about when it was last pressed. Thanks for your patience
If there’s an alternative I should be using I’d be happy to look into that instead!