BlaQ migration to ESPHome

I just installed a blaQ, really easy, seems to work fine.
I want to migrate the firmware to my ESPHome instance where I manage all my other ESPHome devices.
My ESPHome server did not discover the blaQ, but I can work around that by just creating my own config.

I am looking at the YAML and I can just copy it verbatim and make some changes as needed.

But the “gdolib” is pinned to a hashed version of the library, and this is a problem, as I now need to keep track of the KIO version of the YAML and update to a new pin when upstream changes.

It would be much easier, and portable if the pin was to a branch, e.g. main vs a hash, and then the CI/CD would push to the branch when ready, vs. the YAML needing to be updated.

Could this please be considered, or is there an alternate way to include the majority of the upstream YAML, including interdependencies, and my YAML only does things like API, logging, wifi, web, etc.

E.g.

esphome:
  platformio_options:
    lib_deps:
      - https://github.com/konnected-io/gdolib#4a55112
    build_flags:
      - -Wl,--wrap=esp_panic_handler

vs.:

esphome:
  platformio_options:
    lib_deps:
      # Use a tagged version, e.g. main, or blaq, etc.
      - https://github.com/konnected-io/gdolib@main
    build_flags:
      - -Wl,--wrap=esp_panic_handler

ESPHome should discover the GDO blaQ if it was running it’s original firmware. If you’ve already customized the firmware using the Konnected app, then it would no longer be discoverable by ESPHome.

Anyway yeah it’s an unfortunate thing to have to specify a commit hash in the YAML. The reason for this is because we had a problem before when gdolib was updated on a branch, but when you run esphome run or esphome compile it caches these dependencies so this is one way to force it to update when needed. It’s not as simple as pushing to a branch when ready because often the gdolib changes are coupled with changes in our secplus_gdo component.

Anway, one possible way for you to avoid this is instead of copying our GDO blaQ YAML, just reference it as a package and then you can add to it. That way your device always gets our updates, and you can change/override anything in your copy. For example your device YAML could look like:

substitutions:
  name: konnected-86ed3c
  friendly_name: My GDO
packages:
  konnected.garage-door-gdov2-q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: XXXX
esp32_improv: !remove

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Your customizations here

I did change the config on the app when it built the firmware.
Is there an update password set when using the app for firmware config, or can I just OTA from my ESPHome instance and replace the firmware, or do I need to USB update?

Re hash vs. branch, I can do that, I just have to specify values or empty values for anything I want to change or remove.

At this time there is no OTA password set, although that’s something we will probably add. So yes you can just OTA and rewrite the firmware.

As is the YAML is setting child values that are typically inherited. And when I set the log level in one of my templates, it is in conflict with the IDF log setting, that is typically inherited.

I get this error: ERROR Error while reading config: The local log level VERBOSE for esp-idf must be less severe than the global log level DEBUG.

And it is, to my knowledge, not possible to include two packages that both set log levels and then !remove from one specifically, nor is it possible to include a package then ignore then include another package as there can only be one packages per yaml.

You logger section could be simplified to just set level?

logger:
  level: VERY_VERBOSE
  # hardware_uart: UART0 # -- uncomment on batch 2403; not needed on batch 2404 and newer
  logs:
    esp-idf: VERBOSE
    api: VERBOSE
    api.service: DEBUG
    esp32_ble: DEBUG
    esp32_ble_server: DEBUG
    scheduler: DEBUG
    esp32.preferences: DEBUG
    sensor.filter: DEBUG
    rtttl: DEBUG
    cover: DEBUG
    sensor: DEBUG
    ledc.output: INFO
    json: INFO

My template look something like this:

# Required substitutions:
# device_name
# device_comment

substitutions:
  # Used by garage-door-GDOv2-Q.yaml
  name: ${device_name}
  friendly_name: ${device_comment}

# https://esphome.io/components/esphome
esphome:
  name: ${device_name}
  comment: ${device_comment}

# https://esphome.io/guides/configuration-types.html#local-packages
packages:
  gdov2q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master
  common: !include common.yaml

# Remove items from gdov2q package
esp32_improv: !remove
dashboard_import: !remove
web_server: !remove

The tricky part is that the global log level must be set to more severe than any of the individual component log levels. It sounds like you want to reduce the maximum logging level to DEBUG. I think you should be able to override it in your config like so:

logger:
  level: DEBUG
    esp-idf: DEBUG
    api: DEBUG

Or possibly:

logger:
  level: DEBUG
    esp-idf: !remove
    api: !remove

Lmk if that works.

Yes, I could set individual items, for simplicity I just removed them and ended up doing something like this:

# Konnected blaQ Garage Door Controller
# https://konnected.io/products/smart-garage-door-opener-blaq-myq-alternative
# https://github.com/konnected-io/konnected-esphome/blob/master/garage-door-GDOv2-Q.yaml

# Required substitutions:
# device_name
# device_comment

substitutions:
  # Used by garage-door-GDOv2-Q.yaml
  name: ${device_name}
  friendly_name: ${device_comment}

# https://esphome.io/components/esphome
esphome:
  name: ${device_name}
  comment: ${device_comment}

# https://esphome.io/guides/configuration-types.html#local-packages
packages:
  gdov2q: github://konnected-io/konnected-esphome/garage-door-GDOv2-Q.yaml@master
  api: !include api.yaml
  logger: !include logger.yaml
  ota: !include ota.yaml
  time: !include time.yaml
  wifi: !include wifi.yaml

# Remove unwanted items from gdov2q package
esp32_improv: !remove
dashboard_import: !remove
web_server: !remove
wifi:
  # Remove AP fallback
  ap: !remove
# ERROR Error while reading config: The local log level VERBOSE for esp-idf must be less severe than the global log level DEBUG
logger:
  # Inherit from default logger level
  logs: !remove

# TODO:
# Remove device_class: signal_strength from wifi_signal_pct, set device_class: ""
# https://github.com/konnected-io/konnected-esphome/issues/76
# WARNING Found and merged multiple configurations for ota platform esphome port(s) [3232]
1 Like