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

emhass does not start after initial install #50

Closed ehajer closed 9 months ago

ehajer commented 1 year ago

EMHASS 0.4 Home Assistant 2023.10.1 Supervisor 2023.10 System Raspberry Pi4 Raspbian 5.10.107-v71+ Frontend 20231005 - latest

After installing Emhass as addon, I tried to start the server with the default configuration from Supervisor panel. afbeelding

Changing the configuration in the UI can be done, but saving the configuration after that is not possible. afbeelding

In the Supervisor logs I find this errors: 23-10-13 10:51:09 ERROR (MainThread) [supervisor.addons.addon] Add-on 5b918bf2_emhass has invalid options: not a valid value. Got {'hass_url': 'empty', 'long_lived_token': 'empty', 'costfun': 'profit', 'logging_level': 'INFO', 'optimization_time_step': 30, 'historic_days_to_retrieve': 2, 'method_ts_round': 'nearest', 'set_total_pv_sell': False, 'lp_solver': 'COIN_CMD', 'lp_solver_path': '/usr/bin/cbc', 'set_nocharge_from_grid': False, 'set_nodischarge_to_grid': False, 'set_battery_dynamic': False, 'battery_dynamic_max': 0.9, 'battery_dynamic_min': -0.9, 'load_forecast_method': 'naive', 'sensor_power_photovoltaics': 'sen... 23-10-13 10:51:09 WARNING (MainThread) [supervisor.addons] Can't start Add-on 5b918bf2_emhass

Even when trying to start the addon in a CLI I get an error: afbeelding

I am realy looking forward to start using this great project in my home installation, but at the moment I'm out of options to get it working.

davidusb-geek commented 1 year ago

Hi, this is the first time that I see this kind of error.

What does the EMHASS logs says?

Also that supervisor log message is truncated. We won't be able to debug any further with that information.

ehajer commented 1 year ago

Hi David,

Thanks for your fast reaction.

The EMHASS Logs stay empty because EMHASS is not starting at all.

Just half hour ago I came a few steps further to a solution:

As mentioned before, what I did after installing the addon, I made my first settings in the configuration, but when I tried to save these I got an error: “Cannot save configuration…”.

After putting back the default/build-inn configuration again EMHASS refused to start, pointing me back to the configuration.

I now just copied a configuration file from one of the users on the EMHASS/HomeAssistant community page and I was able to save this as yaml-file and after that Emhass started just Fine.

This makes me very happy!! So now I’m working on my one configuration and will start learning how your fantastic project is going to run on my system. There’s a lot of reading to do I ‘ve seen, as well on the forum as in your extensive documentation.

So, many thanks again for your reaction and ofcours for this fantastic project.

Question still is, what is wrong with the build-inn configuration file? Maybe you can look in to that?

Greetings,

Erik Hajer

The Netherlands

Van: David @.> Verzonden: vrijdag 13 oktober 2023 14:25 Aan: davidusb-geek/emhass-add-on @.> CC: ehajer @.>; Author @.> Onderwerp: Re: [davidusb-geek/emhass-add-on] emhass does not start after initial install (Issue #50)

Hi, this is the first time that I see this kind of error.

What does the EMHASS logs says?

— Reply to this email directly, view it on GitHub https://github.com/davidusb-geek/emhass-add-on/issues/50#issuecomment-1761431371 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AWUXBNDYQ2PQS4F77TQ6OHDX7EXKFAVCNFSM6AAAAAA566JUNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRRGQZTCMZXGE . You are receiving this because you authored the thread.Message ID: @.***>

jatty commented 1 year ago

I think i have tracked down the problem:

The initial configuration after install contains non-parsable timestamps:

list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "02:54"
  - peak_hours_periods_start_hours: 1044
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: 924
  - peak_hours_periods_end_hours: 1224

When setting right time stamps (like the first one "02:54", even without the quotes), the config file is parsable again.

jatty commented 1 year ago

There seems to be foo which malforms the time stamps at roll-out for values > 12:00 midday without quotes. Workaround could be using 12-hour clock values:

  - peak_hours_periods_start_hours: 5:24p
  - peak_hours_periods_end_hours: 3:24p
  - peak_hours_periods_end_hours: 8:24p
davidusb-geek commented 1 year ago

This original issue seems to have been solved and a workaround was also provided by @jatty

europer commented 1 year ago

no, i still have the error, even with the workaround, latest version (installed it yeterday)

europer commented 1 year ago

Update I tried the yaml file I the post before and now it works..strange

" Thanks for the last update 0.4.2. But I get the same error. "..Failed to save add-on configuration, not a valid value..." With default or not. Is the add on version. Happy sun ☀️☀️☀️🌞"

jatty commented 1 year ago

It seems i don't have tested the patch appropriately.

As a workaround, you should be able to get into the yaml configuration within homeassistant and modify the values in these lines like this:

list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "06:00"
  - peak_hours_periods_start_hours: "17:00"
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: "09:00"
  - peak_hours_periods_end_hours: "23:59"
pbix commented 11 months ago

Also had this issue today with v0.4.2. Below is a screenshot showing the invalid time values in the default configuration as they appear right after installation during the initial config. Reformatting just these two time values was all I needed to do to get it to save properly.

Hope this helps.

image

davidusb-geek commented 10 months ago

This is still an ongoing issue. Reopening it...

davidusb-geek commented 9 months ago

Most probably solved with latests releases...