I started using AI to help me generate scripts and automations code recently (Gemini and Claude in particular), howewer, I came across an odd behaviour of HASS automation code generated by AI recently (my guess is that it may have something to do with changes made in core 2025.10.X. )
The AIs that I’ve tried thus far are hell bent on using older code syntax sometimes and, in particular, using “service:” instead of “action”. To my knowledge, this was not causing much issues under 2025.9.x, but under 2025.10.x, this wreaked havoc and was quite hard to debug.
The reason is that when you save some code using service: instead of action: in HASS. This snippet for example (for testing):
alias: Task Manager - Daily Check All Tasks
id: task_manager_daily_check_all_tasks
description: Check all tasks daily at 9:00 AM and send notifications for due tasks
trigger:
- platform: time
at: "09:00:00"
condition: []
action:
- repeat:
count: 10
sequence:
- service: notify.mobile_app_iphone
data:
title: "Task Check"
message: "Checking task {{ repeat.index }}"
mode: single
You get an error message indicating the automation was saving but that it could not be set up (without any clue as to why). Then, whether you choose to delete it from the three dots menu or not, the automation remains in the automations.yaml file, and does not show up in the automations UI.
Initially, I didn’t know that and I kept trying to fix the same automation over and over again using the same ID… and the failed attempts kept piling up in the automations file unknown to me (still with nothing showing up in the UI). Then, I started receiving duplicate ID errors…
After that, upon restarting, the automations did appear in the UI but were listed as “unavailable”.
It may seem benign but it took me a long time to figure all that out coz my original automation code was quite lengthy and I had no clue what was causing HASS to fail in setting it up.
The takeways from that are:
- You should be very careful when using AI generated code and make sure you review it thoroughly before trying to save it.
- HASS should update its code validating algorithms to filter out errors like that and/or produce more meaningful errors messages. And, by the way, that’s not the only code syntax error that will still allow you to save your automation but fail at having HASS setting it up.