Skip to content

YAML generation – annotate device IDs for maintainability #25871

@davidswelt

Description

@davidswelt

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

Generated YAML (in my case, from an automation with nested conditions) refers to devices and entities by hashes (or other unreadable ID). If this is necessary to do for disambiguation, why can't these be annotated with comments ("# Shop lights 4 (warm)") so that the automation becomes maintainable (in the YAML code)?

(Did not try another browser, clear cache, or try in safe mode as I think the bug is in the design.)

else: - if: - condition: or conditions: - condition: device type: is_on device_id: 8436e5d875f3c6f366b939963322e729 entity_id: aed73ce802872aa0e86c87dcdb2cea81 domain: switch - condition: device type: is_off device_id: 8436e5d875f3c6f366b939963322e729 entity_id: 2539fe28626b46f250f171f29819c968 domain: switch

Describe the behavior you expected

- condition: device type: is_off device_id: 8436e5d875f3c6f366b939963322e729 # Entryway Scene Switch entity_id: 2539fe28626b46f250f171f29819c968 # Switch 1: Home domain: switch

Steps to reproduce the issue

I don't have the means to start with a clean install. If this issue is flaky, the following might not be sufficient.

I reproduce the problem by creating an automation with an action that turns an individual switch on a physical switch with 3 switches on and off. The individual switch is identified by device+entity.

I later chose to "edit YAML", observing just the unreadable device_id and entity_id refs.

What version of Home Assistant Core has the issue?

2025.6.1

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

Problem-relevant frontend configuration

`alias: Example
description: ""
triggers: []
conditions: []
actions:
  - type: turn_off
    device_id: 8436e5d875f3c6f366b939963322e729
    entity_id: aed73ce802872aa0e86c87dcdb2cea81
    domain: switch
mode: single
`

JavaScript errors shown in your browser console/inspector

Additional information

Screenshot

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions