davidusb-geek / emhass-add-on

The Home Assistant Add-on for EMHASS: Energy Management Optimization for Home Assistant
MIT License
96 stars 29 forks source link

config.yml reordered options #73

Closed GeoDerp closed 9 months ago

GeoDerp commented 9 months ago

Reordered options in hopes to make it easier to read.

GeoDerp commented 9 months ago

@davidusb-geek , @michaelpiron , @purcell-lab Any help with this will be appreciated.

This pull request aiming to re-order the parameters as best as possible to make it easier for new users. We can also add/remove parameters in the options: section and leave it it the schema: section if we want these parameters to be present/hidden on all add-on installs. So the design is to have the required and mainly used parameters in the options: section.

Note that all parameters are set to optional. This is because EMHASS is setup to have default values (values stored in the config_emhass.yaml) for all options if not provided.

davidusb-geek commented 9 months ago

I guess that the parameters that shuld not be optional are those tat lead to a most basic configuration. This is a system with just deferrable loads and probably a PV production. Right?

purcell-lab commented 9 months ago

I've been helping with some other setups lately and each site is a little bit unique, which makes things very difficult to standardise.

One concept I have been toying with is the entity of input_number for each configuration element, that way they can be updated on the fly and you don't have these really long payloads which is where a lot of the errors occur.

The user would be responsible for ensuring each input_number is correctly setup and then the standard day-ahead or mpc call would access those input numbers for input.

I suppose we could use the existing configuration.yaml and then create a blueprint with the calls setup with input_number?

But happy to discuss some other options going forward.

GeoDerp commented 9 months ago

Another idea I had (which would take a while to make) is a html form that would override the need for the add-on configuration tab (the configuration tab would only have url and key). This could be formatted in a way that makes parameters readable, sectioned and also dynamically hidden when certain workloads/parameters are defined.

On submission emhass could set each parameters into a option.json but could also create the necessary inputs/sensors/automations etc (restrictions based on what we can do with the HA API)