Naming convention for Scripts, Scenes and Automations

The way Scenes, Scripts and Automations get a unique ID when added in the UI is the same. They get assigned to a unique ID.

But the way this ID gets used in other scripts and automations differs.

The Scenes get added with their entity_id like scene.some_name_based_on_friendly_name
The Scripts get added with their ID like this: script.1577229841234

For sure the way scenes get added is easier to read, unfortunately it’s likely to mess up easily too!
If you change the Friendly Name of a Scene it’s not working anymore in automations and scripts where the scene was included, because the entity_id has changed.

I therefore would like to propose only to use the numerical version of the entity_id in scripts and automations. For readability it would be great if the UI Script editor and the UI Automation Editor would display the Friendly Name instead of the entity_id. This way it would still be possible to see what an automation is doing.

Completely disagree. The some_name_based_on_friendly_name means something. Random number means nothing.

3 Likes

Completely agree with you. That’s why I think the user should see the ‘Friendly Name’ when using the WebUI editor for Automations, Scripts and Scenes. The random numbers should only be used by the system to avoid flows to break.

Do people really use the webui for automations etc? shudder

Yes, very much so as it provides so much boiler plate. Then jumpingin into YAML whenever I need to do something more, which is not always the case.

Let’s be open to all levels of using HA and not “shudder” at those who are not black belt rockstar coding ninjas who do all their coding in vi and compile everything from source.

Three years Necro post :slight_smile:

But after those 3 years of development I have moved more to the UI construction of scripts and automations. The UI got better and so did I .

I often look at the yaml too. Horses for courses.

1 Like

Better late than never :stuck_out_tongue:

Glad to hear that things improved this much in the last years - that is the true positive takeaway from this :slight_smile:

I have moved over to the UI mostly too. Just using YAML for tweaking and fast find/replace patterns. My config files are getting cleaner en shorter with every release. Love it!