Custom sensor or other entity to keep and record time

Have a motion sensor set up. I would like to record the time it was triggered during the night (have a kid waking up).
So how could i set up something like this?

You could either have an automation send a notification, or you could have it fire a custom logbook entry (look at the bottom of the page I’ve linked here).

I already have an automation firing a notification to telegram. But instead i would love to have timestamp to be put into the sensor or some other entity so i can feed it on later to the TTS engine to say in the morning

I think logbook would be the way to go unless you only need the last event.

Well i can see that i can fire up custome events to the logbook. But is there a way to get them back to the scripting? Something like

  • service: tts.google_say
    entity_id: media_player.rasp
    data_template:
    message: ‘This is an event from logbook which happened {{ WHAT TO PUT HERE. CUSTOME_LOG_ENTRY.attr=time }} .’
    cache: false

I’ve never scripted retrievals from logbook so I’m out of my depth there, sorry.