Friendly name in Automation

The other day I wrote an automation, when I looked at the yaml, I see a device and entity id. What I named the device, I think that is the ‘friendly name’ isn’t there.

Why isn’t it? Can’t we have it as a comment?

Given that HA is moving away from yaml, why would anyone need to see the friendly name in the yaml code? It serves no functional purpose and if you are editing your automations in yaml alone, you could always add the friendly name as a comment.

I’m not sure I see the need for more cruft in the yaml code when there’s already a lot going on there in the first place.

I was adding a zigbee button today using the ui to set all the things I want to turn off when I leave.
I’d have liked to duplicate it, find the duplicate in yaml and do a search replace from off to on and delete the items that I don’t want turned on.

I’m really new at this so if there is a better way I’m paying attention.

When you are using the Device_id style Entity_id this kind of thing happens. It’s recommended by those that are not happy with the limitations of that to use traditional entity_ids instead.

Why and how to avoid device_ids in automations and scripts.

2 Likes

Have you looked at the new labels? You can write an automation to turn off everything with the label xxx, then add or remove the label on entities without having to revisit the automation itself.

2 Likes

I have now, thanks for the link. Very useful.