OPTIMIZE ERROR - response of EOS ... {"detail":"Optimize error: 'NoneType' object has no attribute 'individuals'."}
I still notice a similar (or the same? Not sure...) issue right now. As the error look quite similar I'm commenting on this issue. First the Debug-Log:
2025-10-29 07:52:36 INFO [EOS] OPTIMIZE request optimization with: http://10.51.15.101:8503/optimize?start_hour=7 - and with timeout: 180 2025-10-29 07:52:36 INFO [EOS] OPTIMIZE response retrieved successfully in 0 min 0.02 sec for current run 2025-10-29 07:52:36 ERROR [EOS] OPTIMIZE Request failed: 400 Client Error: Bad Request for url: http://10.51.15.101:8503/optimize?start_hour=7 2025-10-29 07:52:36 ERROR [EOS] OPTIMIZE Response status: 400 2025-10-29 07:52:36 DEBUG [EOS] OPTIMIZE ERROR - response of EOS is: ---RESPONSE------------------------------------------------- {"detail":"Optimize error: 'NoneType' object has no attribute 'individuals'."} ------------------------------------------------------------ 2025-10-29 07:52:36 DEBUG [EOS] OPTIMIZE ERROR - payload for the request was: ---REQUEST-------------------------------------------------- {'ems': {'pv_prognose_wh': [0, 0, 0, 0, 0, 0, 0, 14.461866576616421, 267.2485449310099, 867.0728474112371, 1107.4075893484264, 1017.036603571217, 1180.7908113923033, 1097.8266930159841, 464.2285164022285, 213.9346179721963, 66.69079020623752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27.335267200074625, 688.4663907972929, 1005.4491229338391, 1009.9840471995147, 995.2223270086613, 1083.672233444647, 785.6106765879725, 527.0991216865513, 147.29395574057065, 60.532514366096, 0, 0, 0, 0, 0, 0, 0], 'strompreis_euro_pro_wh': [0.0002446, 0.000239, 0.0002392, 0.0002417, 0.0002398, 0.000254, 0.0002882, 0.0003026, 0.000294, 0.0002768, 0.0002603, 0.0002582, 0.000259, 0.0002664, 0.0002804, 0.0003132, 0.0003249, 0.0003258, 0.0003279, 0.0003098, 0.0002968, 0.0002895, 0.000287, 0.0002784, 0.0002446, 0.000239, 0.0002392, 0.0002417, 0.0002398, 0.000254, 0.0002882, 0.0003026, 0.000294, 0.0002768, 0.0002603, 0.0002582, 0.000259, 0.0002664, 0.0002804, 0.0003132, 0.0003249, 0.0003258, 0.0003279, 0.0003098, 0.0002968, 0.0002895, 0.000287, 0.0002784], 'einspeiseverguetung_euro_pro_wh': [0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011, 0.00011], 'preis_euro_pro_wh_akku': 0.0, 'gesamtlast': [762.8074999999999, 474.3687, 548.56585, 419.08285, 394.9488, 613.5179, 538.26335, 1374.1005, 526.96655, 442.48744999999997, 362.6159, 325.61005, 443.71825, 450.31435, 403.79255, 383.83655, 499.5075, 592.73135, 846.6455000000001, 759.61755, 566.327, 487.34434999999996, 470.8836, 396.1783, 385.9665, 392.92769999999996, 399.74694999999997, 419.00175, 391.90065000000004, 575.4481499999999, 920.91125, 1294.36735, 539.32635, 455.98810000000003, 1036.4865, 671.0427, 418.67460000000005, 320.85425, 785.1011000000001, 613.2978499999999, 450.60654999999997, 529.1623, 443.45714999999996, 1288.45845, 665.3677, 741.77555, 794.6551499999998, 515.5790499999997]}, 'pv_akku': {'device_id': 'battery1', 'capacity_wh': 15000, 'charging_efficiency': 0.85, 'discharging_efficiency': 0.85, 'max_charge_power_w': 2300, 'initial_soc_percentage': 51, 'min_soc_percentage': 30, 'max_soc_percentage': 100}, 'inverter': {'device_id': 'inverter1', 'max_power_wh': 2300, 'battery_id': 'battery1'}, 'eauto': {'device_id': 'ev1', 'capacity_wh': 27000, 'charging_efficiency': 0.9, 'discharging_efficiency': 0.95, 'max_charge_power_w': 7360, 'initial_soc_percentage': 50, 'min_soc_percentage': 5, 'max_soc_percentage': 100}, 'dishwasher': {'device_id': 'additional_load_1', 'consumption_wh': 1, 'duration_h': 1}, 'temperature_forecast': [10.1, 10.1, 10.3, 10.3, 10.2, 10.6, 11, 11.3, 11.7, 12.7, 13.6, 14.1, 14.6, 14.8, 14.4, 14, 13.1, 12.2, 12.1, 12.4, 13.1, 13.2, 13, 12.7, 12.8, 12.1, 11.5, 11.3, 10.9, 10, 9.3, 8.7, 9.2, 10, 10.6, 11.1, 11.8, 11.9, 12.1, 11.9, 11, 9.8, 8.9, 8.4, 8.2, 8.1, 7.9, 0], 'start_solution': None} ------------------------------------------------------------ 2025-10-29 07:52:36 ERROR [OPTIMIZATION] Error while updating state: not enough values to unpack (expected 2, got 1) 2025-10-29 07:52:53 DEBUG [BATTERY-IF] successfully fetched SOC = 51.0 %Is this related to the DST topic? I'm unsure as the DST change is now more than 48h ago and shouldn't interfere anymore with the EOS runs?
My Setup in short words: EOS_Connect (0.2.24) and EOS (main) as docker-container on a different host.
I already tried to apply the workaround about changing timezone on the EOS container but this did not work out (or I did not do it correctly).
Originally posted by @stefanheinrichsen in #130
@stefanheinrichsen I've transferred your issue to a new one - it is another behavior ... and with my current knowledge - no interferring with the DST/ time change problem
Is this an instant eror - means no consecutive tries of EOS_connect to request at EOS are done right?
Do you have changed the default config of EOS?
...
As far as I understand the logs it tries to do one run, this fails and after ~5 minutes it tries another run. See a full log file attached.
855a9a00_eos_connect_2025-10-30T06-03-20.972Z.log
Can be related to the Wallbox returning some "unknown" values? On the other side: I tried already removing this sensor from the EOS Config and it did not help.
Regarding the EOS Config: Correct. I did not chane anything for EOS and the container has no volumes. So each docker down/up cycle should reset it completly (which I already did once)
What I did change recently here: I switched my network DHCP range. But this should not cause any issues. Especially as EOS and EOS Connect worked for several days after the change.
... the request to eos looks good and I can see no error...
Especially as EOS and EOS Connect worked for several days after the change.
means you had already a working system ? with successful runs for days?
next step ... check the logs of EOS - here will be usually also some deeper python thrown errors provided - often after this kind of failed tries it is also helpful a to make a restart of EOS...
btw. this error feedback from EOS ('{"detail":"Optimize error: 'NoneType' object has no attribute 'individuals'."} ') I never saw before - a lot others ;-) but not that
Hi @stefanheinrichsen ,
which "main" version of EOS are you using? As far as I know a "monster" pull request has been merged recently including (not sure) some breaking changes ... maybe switching back to last EOS version tagged 1.0 could help ... or give evopt a try ... đ
It seems docker "main" and "latest" refere to "0.1.0+dev" EOS version. Whatever the "+dev" means. I could not figure out which tag this referes to on Github. To make it worse: No old versions are available on dockerhub so I cannot try a former image. :-(
When it comes to the log files of EOS: This is quite weird. I changed the debug level to "TRACE" and restarted the docker container. I see that the new log level has been activated as there are more detailed lines now marked as TRACE. However: Once EOS connect submittes the optimization request: No error messages :-(
The eos.log from within the docker-container (highlighted the important row with linebreaks before and after):
{"text": "2025-10-30 07:37:49.056 | INFO | akkudoktoreos.core.ems:_run:158 - Starting energy management run.\n", "record": {"elapsed": {"repr": "0:20:36.422991", "seconds": 1236.422991}, "exception": null, "extra": {}, "file": {"name": "ems.py", "path": "/opt/eos/src/akkudoktoreos/core/ems.py"}, "function": "_run", "level": {"icon": "âšī¸", "name": "INFO", "no": 20}, "line": 158, "message": "Starting energy management run.", "module": "ems", "name": "akkudoktoreos.core.ems", "process": {"id": 1, "name": "MainProcess"}, "thread": {"id": 123734241306304, "name": "ThreadPoolExecutor-0_0"}, "time": {"repr": "2025-10-30 07:37:49.056627+00:00", "timestamp": 1761809869.056627}}}
{"text": "2025-10-30 07:37:49.056 | INFO | akkudoktoreos.core.ems:_run:177 - Starting energy management prediction update and optimzation parameter preparation.\n", "record": {"elapsed": {"repr": "0:20:36.423222", "seconds": 1236.423222}, "exception": null, "extra": {}, "file": {"name": "ems.py", "path": "/opt/eos/src/akkudoktoreos/core/ems.py"}, "function": "_run", "level": {"icon": "âšī¸", "name": "INFO", "no": 20}, "line": 177, "message": "Starting energy management prediction update and optimzation parameter preparation.", "module": "ems", "name": "akkudoktoreos.core.ems", "process": {"id": 1, "name": "MainProcess"}, "thread": {"id": 123734241306304, "name": "ThreadPoolExecutor-0_0"}, "time": {"repr": "2025-10-30 07:37:49.056858+00:00", "timestamp": 1761809869.056858}}}
{"text": "2025-10-30 07:37:49.057 | INFO | logging:callHandlers:1762 - 10.51.15.111:39434 - \"POST /optimize?start_hour=8 HTTP/1.1\" 400\n", "record": {"elapsed": {"repr": "0:20:36.423559", "seconds": 1236.423559}, "exception": null, "extra": {"request_id": "app"}, "file": {"name": "__init__.py", "path": "/usr/local/lib/python3.12/logging/__init__.py"}, "function": "callHandlers", "level": {"icon": "âšī¸", "name": "INFO", "no": 20}, "line": 1762, "message": "10.51.15.111:39434 - \"POST /optimize?start_hour=8 HTTP/1.1\" 400", "module": "__init__", "name": "logging", "process": {"id": 1, "name": "MainProcess"}, "thread": {"id": 123734852901760, "name": "MainThread"}, "time": {"repr": "2025-10-30 07:37:49.057195+00:00", "timestamp": 1761809869.057195}}}
{"text": "2025-10-30 07:37:59.012 | DEBUG | akkudoktoreos.server.eos:energy_management_task:361 - Check EMS run\n", "record": {"elapsed": {"repr": "0:20:46.379120", "seconds": 1246.37912}, "exception": null, "extra": {}, "file": {"name": "eos.py", "path": "/opt/eos/src/akkudoktoreos/server/eos.py"}, "function": "energy_management_task", "level": {"icon": "đ", "name": "DEBUG", "no": 10}, "line": 361, "message": "Check EMS run", "module": "eos", "name": "akkudoktoreos.server.eos", "process": {"id": 1, "name": "MainProcess"}, "thread": {"id": 123734852901760, "name": "MainThread"}, "time": {"repr": "2025-10-30 07:37:59.012756+00:00", "timestamp": 1761809879.012756}}}
{"text": "2025-10-30 07:37:59.013 | TRACE | akkudoktoreos.utils.datetimeutil:to_datetime:1607 - \nTimezone adapted to: Etc/UTC\nfrom: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC\nto: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC\n", "record": {"elapsed": {"repr": "0:20:46.379596", "seconds": 1246.379596}, "exception": null, "extra": {}, "file": {"name": "datetimeutil.py", "path": "/opt/eos/src/akkudoktoreos/utils/datetimeutil.py"}, "function": "to_datetime", "level": {"icon": "âī¸", "name": "TRACE", "no": 5}, "line": 1607, "message": "\nTimezone adapted to: Etc/UTC\nfrom: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC\nto: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC", "module": "datetimeutil", "name": "akkudoktoreos.utils.datetimeutil", "process": {"id": 1, "name": "MainProcess"}, "thread": {"id": 123734852901760, "name": "MainThread"}, "time": {"repr": "2025-10-30 07:37:59.013232+00:00", "timestamp": 1761809879.013232}}}
and likewise in "docker logs eos-eois-1"
2025-10-30 07:37:49.056 | TRACE | akkudoktoreos.utils.datetimeutil:to_datetime:1607 -
Timezone adapted to: Etc/UTC
from: 2025-10-30 07:37:49.056050+00:00 tz=Etc/UTC
to: 2025-10-30 07:37:49.056050+00:00 tz=Etc/UTC
2025-10-30 07:37:49.056 | INFO | akkudoktoreos.core.ems:_run:158 - Starting energy management run.
2025-10-30 07:37:49.056 | INFO | akkudoktoreos.core.ems:_run:177 - Starting energy management prediction update and optimzation parameter preparation.
2025-10-30 07:37:49.057 | INFO | logging:callHandlers:1762 - 10.51.15.111:39434 - "POST /optimize?start_hour=8 HTTP/1.1" 400
2025-10-30 07:37:59.012 | DEBUG | akkudoktoreos.server.eos:energy_management_task:361 - Check EMS run
2025-10-30 07:37:59.013 | TRACE | akkudoktoreos.utils.datetimeutil:to_datetime:1607 -
Timezone adapted to: Etc/UTC
from: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC
to: 2025-10-30 07:37:59.013180+00:00 tz=Etc/UTC
2025-10-30 07:38:09.013 | DEBUG | akkudoktoreos.server.eos:energy_management_task:361 - Check EMS run
2025-10-30 07:38:09.013 | TRACE | akkudoktoreos.utils.datetimeutil:to_datetime:1607 -
Timezone adapted to: Etc/UTC
from: 2025-10-30 07:38:09.013634+00:00 tz=Etc/UTC
to: 2025-10-30 07:38:09.013634+00:00 tz=Etc/UTC
But unfortunatly no python trace or error message or similar. Is there any other place to search for details? I'm a bit stuck right now. :-(
Addtional question: Do I have to create a EOS.config.json? Right now the file is mostly empty with "null" values. My impression was that the EOS connect call/request will override the EOS config anyway? Is this a valid assumption?
Sensational... đ that is the version with the monster-merge ... đŦ
My proposal is to pull a docker image that has been uploaded/pushed to docker hub 1 months ago...
docker pull akkudoktor/eos:sha256-41aa64d04e34d1ee32b55219d3c3201d98e781375ff0bf92bf90df744aee81a8
Just a guess ... đŦ hope that will do the trick ..
@ohAnd we have to check if the API of the EOS dev version is broken ... đ Can do that this evening..
Tried it already to pull an old "sha..." image but they all fail with "unsupported media type application/vnd.oci.empty.v1+json" (and this is an error I never have seen before). I think those sha-tages are not regularly useable.
But what helped to get my system back again is to build the docker image from source and then re-create the container. So in case someone else needs a small guide what I did:
mkdir /srv/eos-dev && cd /srv/eos-dev
git clone https://github.com/Akkudoktor-EOS/EOS.git
cd EOS
git checkout v0.1.0
docker build -t eos-local .
nano /srv/eos/docker-compose.yaml # Change the image line to: image: "eos-local"
cd /srv/eos
docker compose down && docker compose up -d
After that v0.1.0 is active again and this works indeed. Of course this is only a workaround.
If you need any help getting more details/logs/whatever to furter investigate on the issue with the v0.1.0+dev Version: I'm happy to help in any way I can. Also do you think it might be worth a try to submit a request at the EOS repo to change the docker-build action in a way old images are tagged with a date (so something like :2025-10-01)? This would make such a rollback much easier...
See https://github.com/Akkudoktor-EOS/EOS/issues/726. There is now a hotfix for EOS that might work without changes to EOS_Connect. Users who already migrated to 0.1.0+dev have to edit EOS.config.json. Please add:
{
...
"optimization": {
"horizon_hours": 48,
"genetic": {
"individuals": 300,
"generations": 400
}
},
...
}
I just did a "pull" from the docker hub with the new image, added the mentioned parts into EOS.config.json but still get the same error in EOS connect (and no log messages in EOS). Still the optimization fails. However: With high log level I can see now:
2025-10-30 14:18:39.771 | ERROR | akkudoktoreos.optimization.genetic.genetic:optimierung_ems:846 - No charge rates provided for electric vehicle.
I don't think I can add those values in the EOS connect configuration dialog within HA but maybe it helps anyone here in further investigation?
Charge rates is no longer a general parameter but became a configuration option of the EV. Automatic migration is not so easy here. You may add it also in the EOS.config.json.
...
"electric_vehicles": [
{
...
"charge_rates": [0.0, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0]
}
],
...
The first vehicle in the list is the one that is used by the EOS_Connect optimization.
@b0661 super thanks for the hints --- with the specific config settings on EOS side it is working again also with 0.1.0+dev
I will try something to mitigate the problem ...
@ohAnd charge_rates has become a new parameter for the POST optimize call. So no need to set it in config. You may do likewise.
@ohAnd charge_rates has become a new parameter for the POST optimize call. So no need to set it in config. You may do likewise.
jep... I saw ... but i guess best way fix config to a broader range 10 or 5 % wise to have a good range for "detailed" opt --- or I interpret this wrong ... - but we can discuss in another issue...
@ohAnd charge_rates has become a new parameter for the POST optimize call. So no need to set it in config. You may do likewise.
jep... I saw ... but i guess best way fix config to a broader range 10 or 5 % wise to have a good range for "detailed" opt --- or I interpret this wrong ... - but we can discuss in another issue...
charge_rates is a list of floats [0.0..1.0]. You may create any incrementation steps your car is supporting. Currently it is defaulting to 0.1 steps.
@stefanheinrichsen last develop will now have the detection of new eos version (0.1.0+dev) and automatic config update via API if needed
EOS 0.1.0 (no +dev) is commit 20a9eb78d88b2a6424b5b19a35f9faad0f6ff4fd. On dockerhub https://hub.docker.com/layers/akkudoktor/eos/sha256-41aa64d04e34d1ee32b55219d3c3201d98e781375ff0bf92bf90df744aee81a8/images/sha256-ab50f8c54f4a220ec092c86e1618f78ea7ea8c83e3a1cebe834428aa4248ea94. You may use that as latest stable. +dev versions will change with even breaking changes and no incrementation of version. Next release version will be 1.0.0 due to the many breaking changes in dev.