I have exactly the same problem in my setup. I have never seen an actual user name in the logbook. I use Postgres as logbook storage backend, which may be related. Is there anyone with a working fix for this or is this a real bug in HA?
Hmmmm…I’m using mariaDB as my backend storage. I wonder if there’s a connection to the database layer and this issue?
I’m on mariadb too if that helps anyone works this out.
FYI, 0.118.0 changed nothing for me.
This still the case for you? I recently switched over to mariaDB and also noticed that my logbook shows service calls instead of automation names as well. I assume that’s the reason for the change?
Yes, this is still the case for me. Although I’m not willing to go back to a file database…mariaDB is so much faster for the amount of data I keep.
Yeah it doesn’t bug me so much, was just curious what the change might be. I guess I found my answer. Thanks!
I have never seen an automation name in my logbook or history view, it’s always just the service name. I use the default database, nothing special. I am running 2021.3.2, it’s been the same for every update. I was really hoping it would start working some point…
I actually saw some different behaviour in the latest release of HA. I have an automation that looks something like this:
automation:
- alias: the_automation
trigger: whatever
action:
- service: script.do_some_stuff
- service: light.turn_on
data:
entity_id: light.my_light
Then, in the log book, it says that light.my_light
was turned on by script.do_some_stuff
. That’s not right.
I posted in the community earlier about this same problem, after I couldn’t find anything related. Automation Triggered not shown in logbook
It always seems to happen that I find a related post (that wasn’t in the suggested topics pop-up) hours after I make one! It’s always reassuring to know others share your pain and then disappointing when the final post isn’t the solution.
I’m running the latest HA OS and basic db. It seems it should be expected behaviour to have the name of the automation that was triggered, appear in the logbook. I’ve even added a service call to the end of an automation for logbook.log and included the automation name, but I still don’t get anything showing in the logbook.
Have any of you managed to resolve the issue?
I still have this issue. I’ve just updated to the latest stable version as of yesterday.
I am also updated to 2021.4.5, and I still have the same issue. I only see things like turned off by service light.turn_off
, or the name of a script, never an automation name. Many times it says nothing at all. I just used my Magic Cube to turn on a light, and in the logbook I see the event of the cube firing, and then Kitchen Light turned on
. It doesn’t tell me anything at all about which automation was used, or even which script the automation called to turn the light on.
I wondered if it might be because I use packages and have my automations broken up into one per file a la Frenck, but I tried making an automation using the UI and it doesn’t behave any differently. Searched GitHub for open issues but I don’t see any.
@SteveDinn @anon43302295 @Markus99 @finity @jeffreykog @mang0 @Anwen
I think I found the problem. In my recorder integration I have included domains. I had automations instead of automation. Now I’ve taken the ‘s’ off ‘automations’ and restarted, the logbook is displaying the automation that triggered the event.
Hopefully that is the fix for you all as well
Oh that is probably what’s going on! I don’t have automations included at all
I feel like an idiot. Why didn’t it occur to me that automations were not included in my recorder! Thanks @AJStubbsy
Nice! I had the same exclusion, and it fixed it for me as well for automations.
When toggling lights from the web interface or mobile app i still see “light was turned off by service light.turn_off”. I’m unsure if this is also setup-related, or intended behavior. I expect it to show the user name, but i’m not sure if that matches the actual behavior. Do you know what is intended here? At least i have an direction to search into now, thanks
The service call log is certainly intended behaviour and I suppose it depends how your integrations and lovelace cards are set up but I don’t know about specifying the user that initiated it. I remember reading a request for this but I can’t find anything that would enable that in the logbook or recorder integrations.
If you do find out I’d be grateful to know how
You’re a scholar and a gentleman, good sir. I also had automations excluded in the recorder. My first test after removing that exclusion proved successful.
Thankyou!
@jeffreykog you’re right. If I toggle something like an input_boolean it does say turned on by and then the user that did it. Maybe this is because it’s a direct control instead of a service call. Would be worth testing with a switch you have and check that integration is properly included in recorder.
Hmm thanks for the confirmation. I removed all logbook, history and recorder config (leaving only the ‘logbook:’, ‘history:’ and ‘recorder:’ tags), and i still see no user history. I have also done a full purge and repack (Service recorder.purge with repack: yes), with no luck.
I store my history in PostgreSQL. Maybe that is related. I could maybe try dumping the entire database and recreating it from scratch. I will report back when i know more