Hi all,
I’m struggling with an automation that always fails to load with this error:
Message malformed: extra keys not allowed @ data['0']
The problem is that Home Assistant does not tell me WHICH key is invalid, so I’m stuck guessing.
Context:
- Home Assistant Core
- automations.yaml in YAML mode
- Other automations in the same file work fine
- notify.mobile_app_* works in other automations
- This error appears even when I remove triggers and conditions
This automation fails:
- id: highest_humidity_room_manual_test
alias: TEST – Highest humidity room (manual)
mode: single
actions:
- action: notify.mobile_app_justy2
data:
title: "TEST humidity"
message: >
{% set ns = namespace(room='', value=0) %}
{% set v = states('sensor.adela_humidity') | float(0) %}
{% if v > ns.value %}{% set ns.room = 'Adela' %}{% set ns.value = v %}{% endif %}
{% set v = states('sensor.john_humidity') | float(0) %}
{% if v > ns.value %}{% set ns.room = 'John' %}{% set ns.value = v %}{% endif %}
{% set v = states('sensor.living_room_humidity') | float(0) %}
{% if v > ns.value %}{% set ns.room = 'Living room' %}{% set ns.value = v %}{% endif %}
{% set v = states('sensor.bedroom_humidity') | float(0) %}
{% if v > ns.value %}{% set ns.room = 'Bedroom' %}{% set ns.value = v %}{% endif %}
{% set v = states('sensor.storage_humidity') | float(0) %}
{% if v > ns.value %}{% set ns.room = 'Storage' %}{% set ns.value = v %}{% endif %}
Result: {{ ns.room }} ({{ ns.value }} %)
Questions:
- Is there any way to get MORE DETAILED validation errors than just
data['0']? - Is there a recommended way to TEST automations schema-wise before runtime?
- Is this error usually caused by:
- missing required keys (like triggers),
- mixing old/new automation syntax,
- or something else entirely?
Any advice on how to debug these schema errors properly would be really appreciated.