#I'm not sure exactly with terminology

1 messages ยท Page 1 of 1 (latest)

drowsy stone
#

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.

wheat crown
#

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:...
drowsy stone
#

Ohhhhh, THOSE unique ids. Yeah, those are autogenerated by the UI.

wheat crown
#

Yeah they suck it makes creating duplicate automations so much harder

drowsy stone
#

You can actually name them whatever you want in the yaml.

wheat crown
#

REALLY

#

I can just put anything in the ID field??

drowsy stone
#

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.

wheat crown
#

This is why I brought it up I was hoping you would say something like that

drowsy stone
#

Ahhhh ok

#

So no. If you change the id from what the UI has created, it won't allow you to edit it.

#

๐Ÿ˜ฆ

wheat crown
#

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

drowsy stone
#

Let me try... 1 sec.

wheat crown
#

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

drowsy stone
#

Ok, so yeah, if you create an automation in automations.yaml and give it an id, you can edit it in the UI.

wheat crown
#

and the id can be any number as long as its unique?

wheat crown
drowsy stone
wheat crown
#

This is great news for me. I really thought the ID would be something important only the UI could decide

drowsy stone
#

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.

wheat crown
#

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.

drowsy stone
#

Perhaps? I dunno... I haven't dug that deeply into the internals of automations in terms of the UI versus YAML.

wheat crown
#

Anyway thanks for the help. Much appreciated. I will give your script method a go tomorrow

drowsy stone
#

Sounds like a plan... make sure to ask questions too ๐Ÿ™‚

wheat crown
#

@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):

https://pastebin.com/Hu5FykFi

and within seconds I got back the following:

https://pastebin.com/TrZPDGX8

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