Generate config (yaml) from template?

A two part question:

  1. Is there a way to build a custom workflow in the init (first time) HA workflow? I would like to have a configuration page (ideally lovelace page) that would allow me to configure some system parameters as part of a first time startup “wizard”.

  2. Is there a way to build some configuration (yaml file) from template, ideally based on some information collected in step 1?

My use case: say I have 4 switches statically defined, but I only want to expose 2,3 or all 4 to homekit (and keep track of which of them are “enabled” internally too), depending on this initial, one-time config.

  auto_start: true
  filter:
    include_entities:
      - switch.s1
      - switch.s2
      - switch.s3
      - switch.s4
  entity_config:
    switch.s1:
      name: S1
      type: valve
    switch.s2:
      name: S2
      type: valve
    switch.s3:
      name: S3
      type: valve
    switch.s4:
      name: S4
      type: valve
  name: Switch Controller
  port: 56332

or

  auto_start: true
  filter:
    include_entities:
      - switch.s1
      - switch.s2
      - switch.s3
  entity_config:
    switch.s1:
      name: S1
      type: valve
    switch.s2:
      name: S2
      type: valve
    switch.s3:
      name: S3
      type: valve
  name: Switch Controller
  port: 56332

or

  auto_start: true
  filter:
    include_entities:
      - switch.s1
      - switch.s2
  entity_config:
    switch.s1:
      name: S1
      type: valve
    switch.s2:
      name: S2
      type: valve
  name: Switch Controller
  port: 56332

Thank you!

No to both questions.

There’s nothing in Home Assistant to automate the production of YAML configuration files.

Thanks for the answer. For point 1, there is clearly a provision to do so, when you first set up your location/units/etc… Is that something that is considered? Planned? Is there any interest in adding that functionality? I might need to add it, so I might as well contribute it back if there is nothing already there/planned.

For point 1, a software developer can create a config flow for the integrations they are building.

Integration Configuration | Home Assistant Developer Docs (home-assistant.io)

That’s for configuring a new integration and not for the general-purpose you requested “configure some system parameters as part of a first time startup”.

I’m not a member of the development team (not a volunteer software contributor) so I can’t answer what the team might be considering to include in their future plans. If you are well versed in python and can build such a facility, you should probably contact them via Discord and get feedback for your proposal.