Push a button, create a time and date entry on the dashboard (need help with timestamps)

I’m trying to create an automation where, after a button is pushed, meds are marked as “taken” with a time and date stamp visible on the dashboard.

I’ve got the automation so that after the button is pushed, it changes the toggle to “done”. I just don’t know how to integrate a time and date stamp that would show when it was done.

Any help would be gratefully appreciated :slight_smile:

Hello,

Creating a date/time helper is the first step.
Then, you can use the service set_datetime in your automation

service: input_datetime.set_datetime
data:
  time: " {{ now().strftime('%H:%M:%S') }} "
target:
  entity_id: input_datetime.pills

To show it at the right time, you can use a conditional entity card, condition beeing that the toggle is “on”

Thank you. This is so close, I’m going to mark it solved. I think I can figure out the date part on my own :slight_smile:
Thanks again!

1 Like