You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I've been trying for days to get EMHASS configured, with some help from ChatGPT. It is very complicated!
However, it still doesn't work and I cannot figure it out. ChatGPT is sending me into loops.
And the error I'm still getting after 24 hours of data gathering, all variables are giving the correct data in Developer Tools!
[2025-09-17 07:15:51 +0200] [25] [ERROR] The retrieved JSON is empty, A sensor:sensor.power_load_no_var_loads may have 0 days of history, passed sensor may not be correct, or days to retrieve is set too high. Check your Logger configuration, ensuring the sensors are in the include list. [2025-09-17 07:15:51 +0200] [25] [INFO] Retrieving data from hass for load forecast using method = naive [2025-09-17 07:15:51 +0200] [25] [INFO] Retrieve hass get data method initiated... [2025-09-17 07:15:51 +0200] [25] [ERROR] Exception on /action/dayahead-optim [POST] Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 1511, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/src/emhass/web_server.py", line 393, in action_call input_data_dict = set_input_data_dict( ^^^^^^^^^^^^^^^^^^^^ File "/app/src/emhass/command_line.py", line 316, in set_input_data_dict np.transpose(np.vstack([P_PV_forecast.values, P_load_forecast.values])), ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'bool' object has no attribute 'values'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I've been trying for days to get EMHASS configured, with some help from ChatGPT. It is very complicated!
However, it still doesn't work and I cannot figure it out. ChatGPT is sending me into loops.
My config is:
HA config:
`
template:
name: "Totaal stroomimport kWh"
unit_of_measurement: "kWh"
device_class: energy
state_class: total_increasing
state: >
{% set laag_in = states('sensor.p1_electricity_consumed_peak_cumulative') | float %}
{% set hoog_in = states('sensor.p1_electricity_consumed_off_peak_cumulative') | float %}
{{ (laag_in + hoog_in) | round(3) }}
name: "Power Load No Var Loads"
unit_of_measurement: "kW"
device_class: power
state_class: measurement
state: "{{ states('sensor.power_load_no_var_loads_raw') | float(0) }}"
name: "Power Load No Var Loads W"
unit_of_measurement: "W"
device_class: power
state_class: measurement
state: "{{ (states('sensor.power_load_no_var_loads_raw') | float(0)) * 1000 }}"
name: "Power Photovoltaics"
unit_of_measurement: "W"
device_class: power
state: "{{ states('sensor.envoy_122334026157_current_power_production')|float(0) * 1000 }}"
availability: "{{ has_value('sensor.envoy_122334026157_current_power_production') }}"
sensor:
source: sensor.totaal_stroomimport_kwh
name: "Power Load No Var Loads Raw"
unit_time: h
unit: kW
round: 3
`
My EMHASS config:
objective: cost inputs: power_load_no_var_loads: sensor.power_load_no_var_loads_w load: sensor: sensor.totaal_stroomimport_kwh type: energy consumption: true days: 0.01 pv_power_forecast: method: ha entity_id: sensor.power_photovoltaics load_power_forecast: method: ha entity_id: sensor.power_load_no_var_loads_w elec_prices: dynamic_prices: true price_sensor: sensor.current_electricity_price_all_in battery: max_capacity: 5 max_charge_power: 2400 max_discharge_power: 800 eff: 0.9 soc_init: sensor.lilygo_rs485_marstek_battery_state_of_charge soc_min: 11 soc_max: 100 forecast: horizon: 24 optimization: solver: cbc interval: 60 time_step: 1 outputs: battery_power: sensor.lilygo_rs485_marstek_battery_power battery_soc: sensor.lilygo_rs485_marstek_battery_state_of_charge charge_power_entity: number.lilygo_rs485_marstek_forcible_charge_power discharge_power_entity: number.lilygo_rs485_marstek_forcible_discharge_power
And the error I'm still getting after 24 hours of data gathering, all variables are giving the correct data in Developer Tools!
[2025-09-17 07:15:51 +0200] [25] [ERROR] The retrieved JSON is empty, A sensor:sensor.power_load_no_var_loads may have 0 days of history, passed sensor may not be correct, or days to retrieve is set too high. Check your Logger configuration, ensuring the sensors are in the include list. [2025-09-17 07:15:51 +0200] [25] [INFO] Retrieving data from hass for load forecast using method = naive [2025-09-17 07:15:51 +0200] [25] [INFO] Retrieve hass get data method initiated... [2025-09-17 07:15:51 +0200] [25] [ERROR] Exception on /action/dayahead-optim [POST] Traceback (most recent call last): File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 1511, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/src/emhass/web_server.py", line 393, in action_call input_data_dict = set_input_data_dict( ^^^^^^^^^^^^^^^^^^^^ File "/app/src/emhass/command_line.py", line 316, in set_input_data_dict np.transpose(np.vstack([P_PV_forecast.values, P_load_forecast.values])), ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'bool' object has no attribute 'values'
I'm lost guys.... please advise!
Beta Was this translation helpful? Give feedback.
All reactions