PV / Solar Excess Optimizer: Auto-control appliances (wallbox, dish washer, heatpump, ...) based on excess solar power

2023-12-31 14:33:52.280 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0]
2023-12-31 14:33:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075]
2023-12-31 14:33:52.289 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 5075 W
2023-12-31 14:33:52.290 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:33:52.291 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (5075 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:34:33.763 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:34:33.823 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:34:33.952 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:34:52.279 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68]
2023-12-31 14:34:52.279 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025]
2023-12-31 14:34:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 5025 W
2023-12-31 14:34:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:34:52.289 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (5025 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:35:52.275 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81]
2023-12-31 14:35:52.275 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946]
2023-12-31 14:35:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4946 W
2023-12-31 14:35:52.282 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:35:52.284 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4946 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:35:54.239 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:35:54.256 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:35:54.264 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data: Rate limit for API calls reached. (error 429)
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py”, line 67, in _async_update_data
return await self.forecast.estimate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 156, in estimate
data = await self._request(
^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/site-packages/forecast_solar/init.py”, line 125, in _request
raise ForecastSolarRatelimit(data[“message”])
forecast_solar.exceptions.ForecastSolarRatelimit: Rate limit for API calls reached. (error 429)
2023-12-31 14:36:52.274 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112]
2023-12-31 14:36:52.275 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942]
2023-12-31 14:36:52.282 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4942 W
2023-12-31 14:36:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:36:52.286 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4942 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:37:52.276 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22]
2023-12-31 14:37:52.276 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769]
2023-12-31 14:37:52.282 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4769 W
2023-12-31 14:37:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:37:52.286 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4769 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:38:52.278 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97]
2023-12-31 14:38:52.278 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564]
2023-12-31 14:38:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4564 W
2023-12-31 14:38:52.288 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:38:52.290 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4564 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:39:52.286 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 36]
2023-12-31 14:39:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 4464]
2023-12-31 14:39:52.295 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4464 W
2023-12-31 14:39:52.296 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess power is high enough to switch on appliance.
2023-12-31 14:39:52.297 INFO (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Switched on appliance.
2023-12-31 14:39:52.298 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Adjusting power history by -1380.0.
2023-12-31 14:39:52.298 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export history: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 36]
2023-12-31 14:39:52.299 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Adjusted export history: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0]
2023-12-31 14:39:52.299 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (solar power - load power) history: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 4464]
2023-12-31 14:39:52.299 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Adjusted PV Excess (solar power - load power) history: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0]
2023-12-31 14:39:53.304 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4464 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:39:53.313 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall number.set_value (c:01HK01MDAFMEBHWNY24750CKDS): entity_id=[‘number.go_echarger_241534_amp’], value=2.0>
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/core.py”, line 2083, in _run_service_call_catch_exceptions
await coro_or_task
File “/usr/src/homeassistant/homeassistant/core.py”, line 2104, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 272, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 878, in entity_service_call
single_response = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File “/usr/src/homeassistant/homeassistant/components/number/init.py”, line 96, in async_set_value
raise ValueError(
ValueError: Value 2.0 for number.go_echarger_241534_amp is outside valid range 6 - 32
2023-12-31 14:40:52.282 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4]
2023-12-31 14:40:52.282 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676]
2023-12-31 14:40:52.292 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (79.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 2676 W
2023-12-31 14:40:52.292 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:40:52.295 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (2676 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:41:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21]
2023-12-31 14:41:52.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394]
2023-12-31 14:41:52.291 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4394 W
2023-12-31 14:41:52.292 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:41:52.294 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4394 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:42:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0]
2023-12-31 14:42:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306]
2023-12-31 14:42:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4306 W
2023-12-31 14:42:52.288 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:42:52.291 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4306 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:43:52.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26]
2023-12-31 14:43:52.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446]
2023-12-31 14:43:52.291 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4446 W
2023-12-31 14:43:52.292 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:43:52.296 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4446 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:44:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26, 221]
2023-12-31 14:44:52.286 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446, 4644]
2023-12-31 14:44:52.293 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4644 W
2023-12-31 14:44:52.294 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:44:52.296 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4644 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:45:52.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26, 221, 7]
2023-12-31 14:45:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446, 4644, 4584]
2023-12-31 14:45:52.290 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4584 W
2023-12-31 14:45:52.291 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:45:52.294 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4584 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:46:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26, 221, 7, 118]
2023-12-31 14:46:52.281 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446, 4644, 4584, 4578]
2023-12-31 14:46:52.289 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4578 W
2023-12-31 14:46:52.290 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:46:52.292 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4578 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:47:52.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26, 221, 7, 118, 94]
2023-12-31 14:47:52.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446, 4644, 4584, 4578, 4631]
2023-12-31 14:47:52.289 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Home battery charge is sufficient (80.0/100.0 %) OR remaining solar forecast is higher than remaining capacity of home battery. Calculated average excess power based on >> solar power - load power <<: 4631 W
2023-12-31 14:47:52.290 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Appliance is already switched on.
2023-12-31 14:47:52.293 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.goecharger (Prio 1)] Average Excess Power (4631 W) is still greater than minimum excess power (-10 W) - Doing nothing.
2023-12-31 14:48:52.284 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 68, 81, 112, 22, 97, 0, 4, 21, 0, 26, 221, 7, 118, 94, 79]
2023-12-31 14:48:52.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5317, 5075, 5025, 4946, 4942, 4769, 4564, 3084.0, 2676, 4394, 4306, 4446, 4644, 4584, 4578, 4631, 4360]
2023-12-31 14:48:52.291 DEBUG (MainThread)

@LeoW4 as you can see from the logs, PV Power minus Load Power is positive in your case.

PV Power is the currently generated solar power. So if you generate no solar power, the sensors value must be zero.

Load Power is the current Load Power of the complete house. So if you charge your car with 5000W, your Load Power has to be 5000W (+ Load of other electrical devices in the house).

One of the two entities - Load Power and PV Power - has wrong values. Probably the Load Power has negative values instead of positive ones.

Thanks, I’ll have to look at that again, the wallbox is only activated when, as in my case, 4000W min charging power is required or earlier?

Amazing stuff!

Looks like this could help me keep the total house current consumption below my 3 x 25A main fuses!

With heating / AC / Wallbox / induction cooking / oven etc. Etc. And a 4kwh solar peak + 15kwh home battery hybrid converter.

Can I define appliances per phase in order to keep all three phases below 25A?

Need to read up a lot :+1:t2:

Does anyone have an idea how to get the Load and Export Power as individual entities from the SolarEdge Modbus integration?

These templates should help:

    modbus_load:
      friendly_name: "Load"
      device_class: power
      unit_of_measurement: W
      value_template: "{{ (states('sensor.solaredge_i1_ac_power')|int(0) 
                        - states('sensor.solaredge_m1_ac_power')|int(0))}}"

    modbus_generation:
      friendly_name: "Production"
      device_class: power
      value_template: "{{ (states('sensor.solaredge_i1_ac_power')|int(0)  }}"
      unit_of_measurement: W

    modbus_export:
      friendly_name: "Export"
      device_class: power
      value_template: "{{ max(0,states('sensor.solaredge_m1_ac_power')|int(0)) }}"
      unit_of_measurement: W    
      
    modbus_import:
      friendly_name: "Import"
      device_class: power
      value_template: "{{ min(0,states('sensor.solaredge_m1_ac_power')|int(0))|abs }}"
      unit_of_measurement: W  
1 Like

Thanks Mark!

1 Like

Ok so I have set this automation up to turn a dehumidifier on and off. It will not turn it on even though the conditions are perfect for it today (was feeding 15kWh into the grid at the time). This is from my logs when I manually run the automation/blueprint. Any ideas where I have gone wrong?

2024-01-09 13:49:54.178 INFO (MainThread) [homeassistant.components.automation.excess_solar_dehumidifier] Excess Solar - Dehumidifier: Running automation actions
2024-01-09 13:49:54.178 INFO (MainThread) [homeassistant.components.automation.excess_solar_dehumidifier] Excess Solar - Dehumidifier: Executing step call service
2024-01-09 13:49:54.180 INFO (MainThread) [custom_components.pyscript.file.pv_excess_control.pv_excess_control] [switch.dehumidifier_power (Prio 1)] Registered appliance.

And the blueprint:

alias: Excess Solar - Dehumidifier
description: ""
use_blueprint:
  path: pv_excess_control.yaml
  input:
    automation_id: excess_pv_control_dehumidifier
    grid_voltage: 240
    pv_power: sensor.modbus_generation
    load_power: sensor.modbus_load
    export_power: sensor.modbus_export
    appliance_switch: switch.dehumidifier_power
    defined_current: 2
    actual_power: sensor.dehumidifier_smartplug_power

And step details from the Trace Log

Executed: 9 January 2024 at 13:49:54
Result:

params:
  domain: pyscript
  service: pv_excess_control
  service_data:
    automation_id: excess_pv_control_dehumidifier
    appliance_priority: 1
    export_power: sensor.modbus_export
    pv_power: sensor.modbus_generation
    load_power: sensor.modbus_load
    home_battery_level: null
    min_home_battery_level: 100
    dynamic_current_appliance: false
    appliance_phases: 1
    min_current: 6
    max_current: 16
    appliance_switch: switch.dehumidifier_power
    appliance_switch_interval: 5
    appliance_current_set_entity: null
    actual_power: sensor.dehumidifier_smartplug_power
    defined_current: 2
    appliance_on_only: false
    grid_voltage: 240
    import_export_power: null
    home_battery_capacity: 0
    solar_production_forecast: null
    appliance_once_only: false
  target: {}
running_script: false

@BeastHouse you need to paste an excerpt from your home assistant logfile after enabling debug logging according to the first post.

The first block in my post was from the log file - that’s all that pops up in there when I fire the automation, and that’s with DEBUG enabled as per the docs.

Am I missing something?

the home-assistant.log should rather look like:

2024-01-13 11:03:51.274 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 11:03:51.275 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -159]
2024-01-13 11:03:51.283 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Force battery charge necessary: capacity=6 kWh|remaining_capacity=5.4 kWh|remaining_forecast=6.2958 kWh| kwh_offset=1 kWh
2024-01-13 11:03:51.285 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_14_switch_0 (Prio 1)] Cannot switch off appliance, because appliance switch interval is not reached (0/5).
2024-01-13 11:03:51.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_11 (Prio 2)] Cannot switch off appliance, because appliance switch interval is not reached (1/5).
2024-01-13 11:03:51.287 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_11 (Prio 2)] Home battery charge is not sufficient (10.0/100.0 %), OR remaining solar forecast is lower than remaining capacity of home battery. Calculated average excess power based on >> export power <<: 0 W
2024-01-13 11:03:51.289 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_11 (Prio 2)] Average Excess power not high enough to switch on appliance.
2024-01-13 11:03:51.293 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Force battery charge necessary: capacity=6 kWh|remaining_capacity=5.4 kWh|remaining_forecast=6.2958 kWh| kwh_offset=1 kWh
2024-01-13 11:03:51.294 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_14_switch_0 (Prio 1)] Cannot switch off appliance, because appliance switch interval is not reached (1/5).
2024-01-13 11:03:51.296 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_11 (Prio 2)] Cannot switch off appliance, because appliance switch interval is not reached (1/5).
2024-01-13 11:03:51.297 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_14_switch_0 (Prio 1)] Home battery charge is not sufficient (10.0/100.0 %), OR remaining solar forecast is lower than remaining capacity of home battery. Calculated average excess power based on >> export power <<: 0 W
2024-01-13 11:03:51.298 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_14_switch_0 (Prio 1)] Average Excess power not high enough to switch on appliance.
2024-01-13 11:03:51.299 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_14_switch_0 (Prio 1)] Appliance is already switched off.
2024-01-13 11:03:51.300 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] [switch.shelly_plug_11 (Prio 2)] Appliance is already switched off.

it took me some time to set it up correctly but reading the log carefully and create non negative sensors helpd at the end. Many thanks!!!

1 Like

ok found it!

2024-01-13 21:30:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 21:30:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2216, -2067, -1962, -1952, -1951, -1943, -1949, -1936, -1960, -2038]
2024-01-13 21:31:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 21:31:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2216, -2067, -1962, -1952, -1951, -1943, -1949, -1936, -1960, -2038, -2248]
2024-01-13 21:32:27.464 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 21:32:27.464 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2216, -2067, -1962, -1952, -1951, -1943, -1949, -1936, -1960, -2038, -2248, -2273]
2024-01-13 21:33:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 21:33:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2216, -2067, -1962, -1952, -1951, -1943, -1949, -1936, -1960, -2038, -2248, -2273, -2271]
2024-01-13 21:34:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] Export History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2024-01-13 21:34:27.463 DEBUG (MainThread) [custom_components.pyscript.file.pv_excess_control.on_time] PV Excess (PV Power - Load Power) History: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2216, -2067, -1962, -1952, -1951, -1943, -1949, -1936, -1960, -2038, -2248, -2273, -2271, -2281]

There is approx 5000 lines of this repeated in my logs.

Hi all,

I have victron / modbus and am stragling what to use for
Export Power
or
Combined Import/Export Power

I have seen on some screenshot that someone used helper sensor.
Which of the modbus entities should I use ?
Anyone using victron - any tip or guidance ?

thanks a lot

below my blueprint automation-call

alias: PV Excess OGKind2
description: ""
use_blueprint:
  path: pv_excess_control.yaml
  input:
    automation_id: PV Excess OGKind2
    appliance_priority: 2
    pv_power: sensor.power_pv_current_template
    export_power: sensor.active_power_outgoing
    load_power: sensor.filtered_realistic_homepower
    home_battery_level: sensor.scb_battery_soc
    home_battery_capacity: 6
    solar_production_forecast: sensor.solcast_pv_forecast_forecast_remaining_today
    appliance_switch: input_boolean.pv_excess_eheating_helper
    defined_current: 2.8
    actual_power: sensor.shelly_plug_11_power

the priority level is missing and don#t use “_” for the ID. This are just hints as I am not the owner of the blueprint.

I created the sensors as template sensors to be shure they get not negative or unknown. the script does not like it …
As I use a hybrid inverter with battery - separate export / import sensors are needed.

as i do not have a victron I rahter cannot help you direct.

Thanks
I hope someone with victron will reply what they used.

Thanks anyway

Let’s see if you can discover the right sensory by yourselves… list what sensors are listed in HA.

First of all a big thanks to the creator!
I am new in to the PV game and got my first success with the PV Excess Optimizer today. There are though a couple of things that I needed to change in the code.
So see it as a mix of a proposal and feedback to me whether I am doing it right.

#1 The Wallbox / Car can only do whole numbers for the current. Thus I changed:
excess_amps = round(avg_excess_power / (PvExcessControl.grid_voltage * inst.phases), 0) + prev_amps
Would it make sense to have the amps step-size adjustable?

#2 It seems the code switches an appliance on, if excess power >= the defined power. There seems no margin. I changed it to
if avg_excess_power >= defined_power+150:
This requests another 150W. Maybe the margin should be configurable. If there is no margin you can have on/off/on/off sequences.

#3 What to do with a Wallbox that does not report power
I have a Entratek (IOCharger) Wallbox. Not sure why the solar company did choose it but I guess for price. The lousy thing does not report the current power. It does report the current used but that also only with a delay of 5 minutes. The current code uses the defined power instead. For a wallbox which can be tuned to different current this seems to be a bad choice. Thus better use the current set to the charger as it is a dynamic appliance:
actual_current = _get_num_state(inst.appliance_current_set_entity, return_on_error=inst.min_current)

#4 What to do, if you only have a combined import/export meter and a battery?
I have a Fenecon Home system. The HA integration only provides combined import/export power to the grid. It features also consumption w/o charging, battery SOC and PV production power too. Now the current code does not work with that combination well. It ignores the battery. So I commented the warning and error parts from the code. And changed the power calculation to
if PvExcessControl.import_export_power:
# Calc values based on combined import/export power sensor
import_export = int(_get_num_state(PvExcessControl.import_export_power))
export_pwr = abs(min(0, import_export))
excess_pwr = int(_get_num_state(PvExcessControl.pv_power) - _get_num_state(PvExcessControl.load_power))
It is basically just the last line of the else branch copied up. This seems to work with the Fenecon system and prioritizes the car charging over the Fenecon Home battery.

Or you can put a filter on your excess power sensor to smooth the signal.