How to redefine substitutions?

I had the idea to setup a substitution as a central default value and later on - if necessary - assign a different value. I also tried to put the 2nd assignment into a packages:/substitions: section after substitions: in the core file, but this does not change anything.
Looking at the validation output it becomes obvious that the 2nd assignment does not cause an error but is ignored which renders my idea of having a central default void. Any hint on how to solve the problem is welcome!

# Core file:
substitutions: 
  <<: !include conf/substitutions/common01.yaml
  <<: !include conf/substitutions/overwrite_standards/room_a.yaml

# common01.yaml:
dallas_upd: !secret DALLAS_UPDATE_INTERVAL_005M

# room_a.yaml
dallas_upd: !secret DALLAS_UPDATE_INTERVAL_003S

BTW: the directories where common01.yaml and room_a.yaml are stored have sym links to the root secrets.yaml file on a Linux file system.

It looks to me like the packages: link merge and override capabilities could work. The substitutions: block would need to go in the included files.

#Core file:
substitutions:
  node_name: mydevice
  device_verbose_name: "My Device"

packages:
  common: !include conf/substitutions/common01.yaml
  room_a_overrides: !include conf/substitutions/overwrite_standards/room_a.yaml

# common01.yaml:
substitutions:
  dallas_upd: !secret DALLAS_UPDATE_INTERVAL_005M

# room_a.yaml
substitutions:
  dallas_upd: !secret DALLAS_UPDATE_INTERVAL_003S

1 Like

Only if both assignments of the same variable name (default and override) appear in the packages: section the last assignment is valid. If any assignment was done outside the packages: context this will rule despite another assignment in packages: . I tested this with the latest version of ESPHome.

Thank you!