Skip to content

Config V3 & GUI - #1099

Draft
storeman wants to merge 3 commits into
corneel27:mainfrom
storeman:feature/config-ui
Draft

storeman wants to merge 3 commits into
corneel27:mainfrom
storeman:feature/config-ui

Conversation

@storeman

@storeman storeman commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

This is a large commit:

  • a UI config editor:
    • Home Assistant entity id suggestions
    • field validation
    • field-search function
  • Config V3:
    • tariffs are now grouped per date
    • reduced hours on batteries are defined as windows
    • in YAML format
    • no more aliases, all spaces are replaced with _
    • secrets also converted to secrets.yaml
    • full seamless migration to v3: v2 config is backed up and the secrets.json and options.json stay in place, making a rollback easy
  • atomic config save
  • switched to monaco UI editor (supports block-folding)

Sneak peek:

afbeelding afbeelding

Comment thread dao/prog/config/loader.py Fixed
Comment thread dao/webserver/app/v2/routes.py Fixed
Comment thread dao/webserver/app/v2/routes.py Fixed
Comment thread dao/webserver/app/__init__.py Dismissed
@corneel27

Copy link
Copy Markdown
Owner

@storeman
Thank for this PR.
At the moment I have following questions:

  1. I would like to test this locally. Should I therefore fork your branche "feature/config-ui"?
  2. There are three security alerts, can you handle/dismiss these?
  3. Should I wait with the testversion until this PR ready for review and is merged?

@dewi-ny-je

Copy link
Copy Markdown
Contributor

A validated YAML, so no more issues with wrong indentation, nonexisting or duplicated entries in the JSON? Wonderful.

@storeman

storeman commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author
1. I would like to test this locally. Should I therefore fork your branche "feature/config-ui"?

Yes, you can check out my branch (no forking needed). If you start the application, don´t forget to migrate, which will create the migrated yaml files.

2. There are three security alerts, can you handle/dismiss these?

Two are fixed, the third is dismissable. I will try

3. Should I wait with the testversion until this PR ready for review and is merged?

Go ahead and publish a new version. Maybe save this one for the next release. I think the boiler should go in first. Then I will rebase or merge the main again.

@storeman

storeman commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

A validated YAML, so no more issues with wrong indentation, nonexisting or duplicated entries in the JSON? Wonderful.

Correct. The config is much more strict. On config migration all invalid or dupe keys are converted to yaml comments. Which is another benefit of yaml: support of comments.

@storeman

storeman commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

@corneel27 To a fork, you can check it out in another directory, but you could also add it as remote to your current project: git remote add storeman https://github.com/storeman/dao

Then you can use it to check it out like: git checkout storeman/feature/config-ui

@corneel27

Copy link
Copy Markdown
Owner

@corneel27 To a fork, you can check it out in another directory, but you could also add it as remote to your current project: git remote add storeman https://github.com/storeman/dao

Then you can use it to check it out like: git checkout storeman/feature/config-ui

I have tried this:
git remote add storeman https://github.com/storeman/dao runs fine without a message.
But git remote add storeman https://github.com/storeman/dao
gives: error: pathspec 'storeman/feature/config-ui' did not match any file(s) known to git

@storeman

storeman commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Ah, you might need to do git fetch storeman before checking out a branch from a fork

@corneel27

Copy link
Copy Markdown
Owner

I tried this with success:
https://docs.github.com/en/pull-requests/how-tos/review-pull-requests/checking-out-pull-requests-locally

When I start the program I got this error:

2026-12-02 19:43:27 INFO: Migrating from v2 to v3
2026-12-02 19:43:27 ERROR: Configuratie kon niet worden geladen: Configuration keys collide after normalization: \database_da

Process finished with exit code 0

This is the my da-database configuration:

  "database da": {
    "engine": "sqlite",
    "db_path": "../data"
  },

There is no file options.yaml
There is a a file options.lock.
What can I do to find the reason of this?

This is a large commit with:
- a UI config editor with:
  - Home Assistant entity id suggestions
  - field validation
  - search function
- Config V3 with config refactorings:
  - tariffs are now grouped per date
  - reduced hours on batteries are defined as windows
  - in YAML format
  - no more aliases, all spaces are replaced with `_`
  - secrets also converted to yaml
  - full seamless migration to v3: v2 config is backed up and the secrets.json and options.json stay in place, making a rollback easy
- atomic config save
- extensive tests
@storeman

storeman commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

I tried this with success: https://docs.github.com/en/pull-requests/how-tos/review-pull-requests/checking-out-pull-requests-locally

When I start the program I got this error:

2026-12-02 19:43:27 INFO: Migrating from v2 to v3
2026-12-02 19:43:27 ERROR: Configuratie kon niet worden geladen: Configuration keys collide after normalization: \database_da

Process finished with exit code 0

This is the my da-database configuration:

  "database da": {
    "engine": "sqlite",
    "db_path": "../data"
  },

There is no file options.yaml There is a a file options.lock. What can I do to find the reason of this?

DAO tried to migrate but is not able to handle the \database da and \database_da in the migration, both normalize to \database_da. I'll have a look.

@storeman

storeman commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

@corneel27 Could you try again (fetch, then pull) or send me your config so I can test it.

@corneel27

Copy link
Copy Markdown
Owner

Yes, i tried again with your new commits and now the conversion is succeeded.
Do you still want my options.json / options.yaml?

@storeman

storeman commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Nice that it worked! I don't need your files, if they work. I'm creating a migration-test page so users on GoT can test their configs, if they want.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants