Log dates when a button has been clicked

I have a Philips Hue button configured at this time to do whatever I tell HA to do through an automation. I’m trying to achieve a date logger whenever I press a certain button. For instance, when I feed the cats, I can push the button and everyone will know when the cats were given their meal.

The counter is a nice option, but only tells you how many times. A push notification is also possible, but meh. I’d rather have something in the dashboard for instance that says when the button has been pushed the last time ánd maybe holds a history somewhere.

Create an automation based on the button press that sets the date of a input_datetime helper.

Hi! :slight_smile:

This seams to do what I need, although when I add this in the dasboard as an entity, it is ‘changeable’. Is there a way to make it look like a normal (every other) sensor on the dashboard?

what do you mean normal?

See screenshot:

Seems like the date/time is editable, but I want it to look like the “battery sensor” for the smoke detector, with text at the right side, clicking on it will get a history tab as well :slight_smile:

Well, I’m not sure what you’d expect out of a date history. But to get it to only show as a date, you’d have to make a template sensor from the input_datetime.

template:
- sensor:
  - name: Cat feed time last
    state: "{{ states('input_datetime.xyz') }}"

Exactly what I needed. Bit weird I didn’t remind that myself, since I’ve been using templates regularly lately :smiley:

Thank you!

let me know if you need help formatting the date/time in the UI

I have a wood pellet stove that I use for heat. I would like to do something very similar for keeping track of when I add fuel to the stove. I would push a button for each bag added to record date and time. But I want to access the history of these events so I can graph my fuel use over time.

How can I see when each button press happened over the last 6-12 months?