#I'm not sure exactly with terminology
1 messages ยท Page 1 of 1 (latest)
The unique ids are most likely device triggers and actions. If that's the case, you will eventually (sooner rather than later) want to move those over to entity state triggers and actions.
I'm talking about in the automations.yaml here is a snippet
alias: Zoom In Main Entrance At 1030
description: ''
trigger:
- platform: time
at: '10:30:00'
condition: []
action:
- service: script.zoom_in_main_entrance_duplicate
metadata: {}
data: {}
mode: single
- id: '1713018586030'
alias: Zoom Out Main Entrance At 1700
description: ''
trigger:
- platform: time
at: '17:00:00'
condition: []
action:
- service: script.zoom_out_main_entrance
metadata: {}
data: {}
mode: single```
- id:...
Ohhhhh, THOSE unique ids. Yeah, those are autogenerated by the UI.
Yeah they suck it makes creating duplicate automations so much harder
You can actually name them whatever you want in the yaml.
I know one guy that literally went through and just started at '1' and kept going up.
As long as it's unique, yeah. BUT, the UI editor might change them... Hold on, let me test that real quick.
This is why I brought it up I was hoping you would say something like that
Ahhhh ok
So no. If you change the id from what the UI has created, it won't allow you to edit it.
๐ฆ
But can I make new ones?
thats what matters to me I dont mind what the IDs are I just want to make automations using the yaml file
Let me try... 1 sec.
When you click duplicate (then make your change) then click save, i think it should autofill the name text field with the original name. then you could just, say change the part that needs to be changed without having to rewrite the whole name every time. When you are duplicating lots of automations that all have the same name except one word it is really annoying. But if i spent less time whining and more time doing it I would probably get it done quicker lol
Ok, so yeah, if you create an automation in automations.yaml and give it an id, you can edit it in the UI.
and the id can be any number as long as its unique?
Wait how is that the case then.
Doesn't even have to be a number
This is great news for me. I really thought the ID would be something important only the UI could decide
So, I guess when you change the id of an existing automation, it messes up the association with the internal reference. BUT, if you create a new automation in YAML and give it a unique id and then reload automations, it works fine.
Why does it not just think of the changed one as a new one
I would think it would look at it and think I have not seen that before I guess it must be new. just like the actual new ones.
Perhaps? I dunno... I haven't dug that deeply into the internals of automations in terms of the UI versus YAML.
Anyway thanks for the help. Much appreciated. I will give your script method a go tomorrow
Sounds like a plan... make sure to ask questions too ๐
@drowsy stone Check this out. I made the script using a field and 1 automation that used it for the first sensor. Then copied the yaml for that and prompted claude ai (competitor to chatgpt, also free):
and within seconds I got back the following:
pasted that into the bottom of automations.yaml and reloaded the config. and that was it. 23 automations completed done for me in about 2 minutes.
They are all working as intended. The only problem was one alias did not include the ambersand (&). Since entity ID's do not include them but I only needed to rename that.
saved me so much time