My custom component worked as expected and showed the config_flow forms first time I ran it.
There was an issue with the underlying package which I fixed. Around that time I also put the github workflow hassfest into lint the code and resolved a few issues it threw up. They were mainly to do with strings.json and manifest.json.
The custom component now tries to use every configuration.yaml entry as its own and complains they are wrong. Running HASS Core dev version: 2025.2.0.dev0 (updated in December)
2025-01-07 13:59:50.990 ERROR (MainThread) [homeassistant.config] Invalid config for 'sonnenbackup' at configuration.yaml, line 10: 'scene' is an invalid option for 'sonnenbackup', check: scene, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 12: 'logger' is an invalid option for 'sonnenbackup', check: logger, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 17: 'isal' is an invalid option for 'sonnenbackup', check: isal, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 19: 'sonnenbackup' is an invalid option for 'sonnenbackup', check: sonnenbackup, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 2: 'default_config' is an invalid option for 'sonnenbackup', check: default_config, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 2: required key 'api_token' not provided, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 2: required key 'ip_address' not provided, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 5: 'frontend' is an invalid option for 'sonnenbackup', check: frontend, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 8: 'automation' is an invalid option for 'sonnenbackup', check: automation, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
Invalid config for 'sonnenbackup' at configuration.yaml, line 9: 'script' is an invalid option for 'sonnenbackup', check: script, please check the docs at https://www.home-assistant.io/integrations/sonnenbackup
2025-01-07 13:59:50.990 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'sonnenbackup': Invalid config.
It specifically complains about two config keys:
required key ‘api_token’
required key ‘ip_address’
which is odd, since they are two of six required parameters used by config_flow. I don’t know where it gets only these two names. The names mentioned are the actual CONF_ values.
Config_flow parameters:
from homeassistant.const import (
CONF_IP_ADDRESS,
CONF_API_TOKEN,
CONF_PORT,
CONF_MODEL,
CONF_DEVICE_ID,
CONF_SCAN_INTERVAL,
)
Configuration.yaml:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
logger:
default: info
logs:
custom_components.sonnenbackup: debug
isal:
#custom component
sonnenbackup:
Googling how components use the yaml file for settings has yielded no results. So no clue how or why the component is complaining about yaml config lines.
hassfest is identifying these two issues:
2025-01-06T22:54:57.8676835Z Integration workspace - /github/workspace:
2025-01-06T22:54:57.8677510Z ##[error]* [ERROR] [MANIFEST] Domain does not match dir name
2025-01-06T22:54:57.8678344Z ##[error]* [ERROR] [CONFIG_FLOW] Config flows need to be defined in the file config_flow.py
The problem is the domain name does match the dir name. Always has and wasn’t changed since the first time when hass actually ran the component as expected.
Obviously, config_flow exists since it ran fine just before this error. I assume the problem with the dir name is causing it to think config_flow isn’t in the wrong dir it’s looking at.
Screen grab from vscode where domain name and dir name can be seen together.
The mystery is what is hassfest looking at to decide domain name doesn’t match dir name?
I suspect that is what hass looks at causing the errors loading the component.
Any clues? Anyone?