EMHASS: An Energy Management for Home Assistant

Also I can see my forcast can bee way off from time to time. Not sure what I can check here?

You could set your MPC interval to run every six or twelve hours if you need your hot water to run that often, if you limit your prediction horizon then your hot water will then be scheduled for the optimal time every six or twelve hours.

The other approach you could adopt is to increase your running hours based on how long since your hot water was last run, eg if less than 6 hours since last run make run hours zero, if 12 hours since last run make run hours 2, if 24 hours since last run make run hours 12 hours. Your hot water thermostat will only run until your set point is reached so it won’t actually run for 12 hours.

Your solar forecast doesn’t require high accuracy to support a valid optimisation, so it shouldn’t be a big issue.

You can always supply an alternative solar forecast the same way you provide your Nordpool forecasts.

OK. Vill just return to next day optimization then. :slight_smile: thanks.

But how can I then update this more often then?

Problem is if i update 23.57 it only last for 24 hours and if price i very expensive next day 24:00 its better to change before 24:00. And if i do it 15:00 i do not get pv forcast for both days.

Hi

installed emhass but are unable to connect to website, ERR_CONNECTION_REFUSED.

log from emhass
File “/usr/lib/python3.9/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 244, in
config_hass = response.json()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 4 (char 3)
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.9/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 244, in
config_hass = response.json()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 4 (char 3)
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.9/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 244, in
config_hass = response.json()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 4 (char 3)
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.9/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 244, in
config_hass = response.json()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 4 (char 3)
Traceback (most recent call last):
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 971, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3.9/json/init.py”, line 346, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3.9/json/decoder.py”, line 340, in decode
raise JSONDecodeError(“Extra data”, s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 244, in
config_hass = response.json()
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Extra data: line 1 column 4 (char 3)

anybody know whats wrong?

Niklas

Hi, I don’t know your configuration but it seems that you are trying to use a custom url to access the webui. This does not works and I’m currently trying to set the webui directly in HA using ingress. So just keep the url and token parameters to empty and access to webui using the localhost or the local IP address of your device at port 5000

Hi thx for your answer.
I’ve set the url and token to empty but still doesn’t work

Oh sorry I wasn’t clear, it should be the string “empty” for both parameters.

Hi

Tried that but still doesn’t work
Ran the curl command. With errors

Ok, then share more information about your install type, architecture, configuration, etc.
Is the add-on running and started without error messages? Are you able to see the webui at localhost:5000? This was your initial question…

Running on rpi4
Starts up with no errors. Only errors is the ones attached here.

I am not able to see the webgui at all get error in chrome ERR_connection_refused

Could it be something with the weserver?

Try:

http://<your_rpi4_ip_address>:5000

Doesn’t work

Checked this?

Yes set to 5000

Any other app or add-on running at port 5000?

Nope. Tried to set another port. Same error

Might be worth going back to the start.

Can you show your info tab, configuration (YAML) and your log file.

hass_url: empty
long_lived_token: empty
costfun: profit
optimization_time_step: 30
historic_days_to_retrieve: 5
method_ts_round: first
set_total_pv_sell: false
lp_solver: COIN_CMD
lp_solver_path: /usr/bin/cbc
set_nocharge_from_grid: false
sensor_power_photovoltaics: sensor.apf_generation_entity
sensor_power_load_no_var_loads: sensor.power_load_no_var_loads
number_of_deferrable_loads: 5
list_nominal_power_of_deferrable_loads:
  - nominal_power_of_deferrable_loads: 1340
  - nominal_power_of_deferrable_loads: 5000
  - nominal_power_of_deferrable_loads: 11500
  - nominal_power_of_deferrable_loads: 8000
  - nominal_power_of_deferrable_loads: 600
list_operating_hours_of_each_deferrable_load:
  - operating_hours_of_each_deferrable_load: 4
  - operating_hours_of_each_deferrable_load: 2
  - operating_hours_of_each_deferrable_load: 0
  - operating_hours_of_each_deferrable_load: 0
  - operating_hours_of_each_deferrable_load: 3
list_peak_hours_periods_start_hours:
  - peak_hours_periods_start_hours: "02:54"
  - peak_hours_periods_start_hours: "17:24"
list_peak_hours_periods_end_hours:
  - peak_hours_periods_end_hours: "15:24"
  - peak_hours_periods_end_hours: "20:24"
list_treat_deferrable_load_as_semi_cont:
  - treat_deferrable_load_as_semi_cont: true
  - treat_deferrable_load_as_semi_cont: true
  - treat_deferrable_load_as_semi_cont: false
  - treat_deferrable_load_as_semi_cont: false
  - treat_deferrable_load_as_semi_cont: true
load_peak_hours_cost: 0.19
load_offpeak_hours_cost: 0.55
photovoltaic_production_sell_price: 0.66
maximum_power_from_grid: 25000
list_pv_module_model:
  - pv_module_model: Advance_Power_API_M370
  - pv_module_model: Advance_Power_API_M370
list_pv_inverter_model:
  - pv_inverter_model: SolarEdge_Technologies_Ltd___SE7600A_US__208V_
  - pv_inverter_model: SolarEdge_Technologies_Ltd___SE7600A_US__208V_
list_surface_tilt:
  - surface_tilt: 18
  - surface_tilt: 10
list_surface_azimuth:
  - surface_azimuth: 90
  - surface_azimuth: 270
list_modules_per_string:
  - modules_per_string: 29
  - modules_per_string: 21
list_strings_per_inverter:
  - strings_per_inverter: 1
  - strings_per_inverter: 1
set_use_battery: true
battery_discharge_power_max: 16667
battery_charge_power_max: 15000
battery_discharge_efficiency: 0.9
battery_charge_efficiency: 0.9
battery_nominal_energy_capacity: 43519
battery_minimum_state_of_charge: 0
battery_maximum_state_of_charge: 1
battery_target_state_of_charge: 0
web_ui_url: 0.0.0.0
nominal_power_of_deferrable_loads: 5500,1500,7000,3000
operating_hours_of_each_deferrable_load: 10,16,3,1
peak_hours_periods_start_hours: 02:54,17:24
peak_hours_periods_end_hours: 15:24,20:24
pv_module_model: Advance_Power_API_M370,Advance_Power_API_M370
pv_inverter_model: >-
  SolarEdge_Technologies_Ltd___SE7600A_US__208V_,SolarEdge_Technologies_Ltd___SE7600A_US__208V_
surface_tilt: 10,10
surface_azimuth: 90,270
modules_per_string: 29,21
strings_per_inverter: 1,1

Hi.

This is what my info screen looks like

In configuration.yaml no entries at all regarding emhass

Log file full of errors
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 243, in
response = get(url, headers=headers)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 573, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 484, in prepare_request
p.prepare(
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 368, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL ‘empty /api/config’: No scheme supplied. Perhaps you meant https://empty /api/config?
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 243, in
response = get(url, headers=headers)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 573, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 484, in prepare_request
p.prepare(
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 368, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL ‘empty /api/config’: No scheme supplied. Perhaps you meant https://empty /api/config?
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 243, in
response = get(url, headers=headers)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 573, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 484, in prepare_request
p.prepare(
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 368, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL ‘empty /api/config’: No scheme supplied. Perhaps you meant https://empty /api/config?
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 243, in
response = get(url, headers=headers)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 573, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 484, in prepare_request
p.prepare(
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 368, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL ‘empty /api/config’: No scheme supplied. Perhaps you meant https://empty /api/config?
Traceback (most recent call last):
File “/usr/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/usr/local/lib/python3.9/dist-packages/emhass/web_server.py”, line 243, in
response = get(url, headers=headers)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 573, in request
prep = self.prepare_request(req)
File “/usr/local/lib/python3.9/dist-packages/requests/sessions.py”, line 484, in prepare_request
p.prepare(
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 368, in prepare
self.prepare_url(url, params)
File “/usr/local/lib/python3.9/dist-packages/requests/models.py”, line 439, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL ‘empty /api/config’: No scheme supplied. Perhaps you meant https://empty /api/config?