Configuration of integration through CLI

Hello,
is there a way to configure an integration through CLI? For Shopping list I specify :shopping_list inside configuration.yaml but after a start of HA I need to hit a “Configure” button inside Integrations.

I need to automate this step as only configuration.yaml file is persistent for me.

I don’t know if this is possible, however I just want to let you know, that HA is moving away from configuration of integrations through YAML, at one point all integrations will only be able to be configured through the UI. PRs for new integrations are only accepted if it is configurable through the UI.

That’s not good, booth ways should be kept or other method should be created.

I run HA inside Travis CI to test Mycroft home assistant skill functions. With configuration.yaml I can preserve a same and easily extensible dev environment for all builds. For now only shopping list is falling for my as it need user interaction and it’s not possible.

Other solution would be know here and how are integrations stored after they are configured so I can preserve this fille as well, but it must be in some human readable format, so every change to that file are possible to review.

Good or not, it has been decided and discussed to death here.

The config for UI integrations is stored in the files in the hidden .storage directory. They are stored in .json format.

1 Like

Ok, as blog post say, YAML will continue to live and new integrations will be configured through UI if possible.

I will dig into .storage dir, json is fine with me. Thanks for pointing me.

Yes, for automations, scripts etc., but NOT for configuration of integrations.

Not if possible, they have to be configured through the UI, otherwise HA team will not accept the pull request.

Then how will I set this in Integration?

input_boolean:
  mycroft_vk_bool:
    name: "Mycroft bool"
    initial: off

switch:
  - platform: template
    switches:
      mycroft_vk_switch:
        friendly_name: "Mycroft sw"
        value_template: "{{ is_state('input_boolean.mycroft_vk_bool', 'on') }}"
        turn_on:
          service: input_boolean.turn_on
          data:
            entity_id: input_boolean.mycroft_vk_bool
        turn_off:
          service: input_boolean.turn_off
          data:
            entity_id: input_boolean.mycroft_vk_bool

I said for NEW integrations, these are both existing integrations, which were there before the blogpost about the future of YAML, but they will be moved to the UI sooner or later.

If they are not moved yet, its ok. Thx

So what stays available in YAML in the end?

All other integrations that do not communicate with a device and/or service, are configured via YAML or via Storage Collections (these enable both YAML and UI capabilities used by, e.g., Lovelace and zones). Examples of these other integrations:

  • Integrations that integrate transports. These integrations allow users to define their own protocol, e.g., MQTT, serial, GPIO.
  • Integrations that process Home Assistant data and make this available to other integrations, e.g., template, stats, derivative, utility meter.
  • Integrations that provide automations, e.g., automation, device_sun_light_trigger, alert.
  • Integrations that help controlling devices and services, e.g., script, scene.
  • Integrations that expose Home Assistant data to other services, e.g., Google Assistant, HomeKit.

Per this part of the Future of YAML blog post (emphasis added), template sensors (and template switches, fans, etc. by extension) and input_* will not have YAML support removed.

2 Likes

For shopping list, new setting are stored inside .storage/core.config_entries.