feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Allow specifying `vars:` for Remote/Git Packages

Open barndawgie opened this issue 1 year ago • 4 comments

Describe the problem you have/What new integration you would like We would like to create configurations in which we instantiate multiple copies of our components, but with different configuration. We are trying to do this using remote packages, but hitting an issue where vars: is not supported for remote packages as they are for !include packages.

E.g. we would like to create config like the following:

econet:
  url: https://github.com/bitfliq/esphome-econet
  ref: zones-initial
  file: econet_hvac_base.yaml
zone1:
  url: https://github.com/bitfliq/esphome-econet
  ref: zones-initial
  file: econet_hvac_zone_template.yaml
  vars:
    zoneid: "1"
    zonename: "Zone1"
    requestmod: 4
    thermostat_address: 0x380
zone2:
  url: https://github.com/bitfliq/esphome-econet
  ref: zones-initial
  file: econet_hvac_zone_template.yaml
  vars:
    zoneid: "2"
    zonename: "Zone2"
    requestmod: 5
    thermostat_address: 0x381

Please describe your use case for this integration and alternatives you've tried: Our ESPHome component (https://github.com/esphome-econet/esphome-econet) can be used to control a thermostat. For homes with multi-zone HVAC systems, we'd want to instantiate multiple thermostats on a single ESPHome controller.

Additional context Some additional details around this ask were discussed in ESPHome discord: https://discord.com/channels/429907082951524364/1191494270624993420

barndawgie avatar Jan 02 '24 00:01 barndawgie

I want to use configurations from my own git repo on the NAS, that feature would makes it easier for multiple copies of components in combination with the home assistant esphome addon. Because the addon don't support multiple configuration files on a easy way.

KG3RK3N avatar Jan 30 '24 18:01 KG3RK3N

This would really benefit some of our configurations over at https://github.com/esphome-econet/esphome-econet as for multi-zone HVAC systems you will want to create a component for each zone/thermostat and currently we end up copying lots of yaml configurations when we'd rather have a single YAML that we can import repeatedly for each zone.

barndawgie avatar Feb 04 '24 21:02 barndawgie

This would highly reduce unnecessary package copies and make them much more extensible and maintainable.

mariodivece avatar Feb 16 '24 15:02 mariodivece

I made PR which allows to include vars in remote package files. You can test it. https://github.com/esphome/esphome/pull/7606

pszafer avatar Oct 15 '24 08:10 pszafer