I’ve managed to send HA into an infinite logging loop where it’s so busy it’s unusable and requires a power cycle to recover! I assume I have an error in my yaml? Either way, I assume HA should handle this better. Please help!
My goal is to email myself any time a system error (or warning) happens.
I added the following lines to configuration.yaml:
system_log:
fire_event: true
I wrote the below automation to capture and respond to the trigger:
alias: "HA: Error"
description: ""
triggers:
- event_type: system_log_event
event_data:
level: ERROR
trigger: event
- event_type: system_log_event
event_data:
level: WARNING
trigger: event
conditions: []
actions:
- action: notify.gmail_automation
metadata: {}
data:
title: Home Assistant {{ trigger.event.data.level | title }}
target: [email protected]
data: >-
Time: {{ trigger.event.data.timestamp | timestamp_custom("%a %I:%M:%S%p
%m/%d/%Y") }}
Level: {{ trigger.event.data.level }}
Integration: {{ trigger.event.data.name }}
Source: {{ trigger.event.data.source }}
Message:
{{ trigger.event.data.message }}"
I wrote the following script to test the automation:
sequence:
- action: system_log.write
metadata: {}
data:
level: error
message: Test Message
alias: Log Test
description: ""
Every time I run the script, I can see the automation immediately triggers (“Last Trigger” shows “now”), but the system immediately hangs: I get a message that the connection is lost and it’s attempting to reconnect. I’ve waited several minutes but it doesn’t recover. I finally have to power cycle my HA box to recover. Upon restarting, the “Last Trigger” shows “never”, and when I look in the raw logs, I see hundreds of lines:
automation.home_assistant_error: expected dict for dictionary value @ data['data']
2025-05-14 22:11:20.057 ERROR (MainThread) [homeassistant.components.automation.home_assistant_error] HA: Error: Error executing script. Invalid data for call_service at pos 1: expected dict for dictionary value @ data['data']
2025-05-14 22:11:20.057 ERROR (MainThread) [homeassistant.components.automation.home_assistant_error] Error while executing automation automation.home_assistant_error: expected dict for dictionary value @ data['data']
2025-05-14 22:11:20.058 ERROR (MainThread) [homeassistant.components.automation.home_assistant_error] HA: Error: Error executing script. Invalid data for call_service at pos 1: expected dict for dictionary value @ data['data']
2025-05-14 22:11:20.058 ERROR (MainThread) [homeassistant.components.automation.home_assistant_error] Error while executing automation automation.home_assistant_error: expected dict for dictionary value @ data['data']
I’m running 2025.5.1, OS 15.2, on a Yellow.