Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105521

How to know the author of HA reboot?

$
0
0

Good evening!
For logging purposes I would like to know the user who restarted HA.
Here I found a nice method to understand the type of HA shutdown.
Since I already have an automation that triggers when HA reboots (and I would like to avoid creating one for when shutdown) I thought of something like this:

- trigger:
  - platform: homeassistant
    event: shutdown
  sensor:
    name: "autore_ultimo_riavvio_piattaforma"
    icon: mdi:information-variant-circle-outline
    state:  "{{ user_info(trigger.event.context.user_id).name}}"

In order to record in the sensor the user who requested the reboot and go and read it in the reboot automation.

But the state is: unknown

Same in:

state:  "{{ trigger.event.context.user_id}}"

Where I’m wrong?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>