Logbook entries with incorrect metadata

Hi,

This is my first post even though I am hooked to HA since 2019 :grin:
So first let me thank the HA crew and the comunity for enabling HA :wink:

And now to my question.
For several weeks now I experience problems with the Logbook entries. Most of them do not indicate what triggered the event, sometimes they are weird. Help please :pray: It really complicates debugging for me :pleading_face:

In the example screenshots below there are a couple of entries that look like I expect them to be: triggered by an automation that is triggered by a state of the helper (which is changed by a generic thermostat) or by the state of some entity.
All other entries are also triggered by automations (except the unavailable ones and the ones I triggered manually), but they either do not indicate what triggered them or say that the switch was turned on/off by the state of the same switch ( and it does not make much sense :slight_smile: )


And this is how logbook looks like on all of my switches (Zigbee, Tasmota etc.) I think it started after I did a bunch of important changes during my christmas holidays (thats making it hard to pinpoint the exact reason). I may have even forgoten some :roll_eyes:

  • updated the HA to 2022.12.8,
  • migrated Sqlite to MariaDB acording to this post
  • added NginX
  • added new and refactored some automations (found out how to use options in automations :muscle:) and I think they became more complex in general.
  • started using Modbus
  • started using Samba Backup

My setup:
Home Assistant 2022.12.8
Supervisor 2022.12.1
Operating System 9.4
Frontend 20221213.1 - latest
Runs on a VirtualBox on Windows 10 pro laptop with i5-8350U, 16GB Ram and SSD

Hi,

Today I noticed something that might be related:

I was debugging a problem where one valve turned on and then immediately off:
image
I went to check if there are multiple automations firing at the same time. To do that I went to the Related tab in the entity info screen:
image
In here I see 6 automations listed as including this switch.
same 6 automations are listed when I filter automations list:


But upon inspecting the code of these automations I see that only 2 of these automations actually include the switch.

Tried to search the wiki, but could not find anything related (but hat may just be my search skill problems…)

I have this thought that if my system has corrupted relationships between automations and entities (or it stopped updating) maybe this is why Logbook is not indicating what is firing events properly?