Ich hatte heute Nacht folgendes Sägezahnmuster beim Laden (mal wieder), aber jetzt hab ich mir mal das main Log dazu geschnappt. Lademodus ist preisbasiertes Zielladen, Preisanbieter der generische Energy-charts. Software 2.1.5-Patch.2
Wenn ich das Log richtig lese, dann gibt es folgendes Verhalten. Alle 5 Minuten versucht die OpenWB, die Strompreise zu aktualisieren. Das klappt mal und mal klappt es nicht. Das sieht dann so aus:
Code: Alles auswählen
2024-11-11 04:15:01,958 - {modules.common.component_context:25} - {DEBUG:electricity tariff} - Update Komponente ['Energy-Charts']
2024-11-11 04:15:01,983 - {urllib3.connectionpool:973} - {DEBUG:electricity tariff} - Starting new HTTPS connection (1): api.energy-charts.info:443
2024-11-11 04:15:07,164 - {modules.common.fault_state:49} - {ERROR:electricity tariff} - Energy-Charts: FaultState FaultStateLevel.ERROR, FaultStr OSError None: Unbekannter Fehler None, Traceback:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "<string>", line 3, in raise_from
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse
response.begin()
File "/usr/lib/python3.9/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.9/http/client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/usr/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.9/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.9/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise
raise value
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 447, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='api.energy-charts.info', port=443): Read timed out. (read timeout=5)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/html/openWB/packages/modules/common/configurable_tariff.py", line 27, in update
tariff_state = self._component_updater()
File "/var/www/html/openWB/packages/modules/electricity_tariffs/energycharts/tariff.py", line 36, in updater
return TariffState(prices=fetch_prices(config.configuration))
File "/var/www/html/openWB/packages/modules/electricity_tariffs/energycharts/tariff.py", line 25, in fetch_prices
raw_prices = req.get_http_session().get(url).json()
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/var/www/html/openWB/packages/modules/common/req.py", line 16, in request
return super().request(method, url, *args, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.energy-charts.info', port=443): Read timed out. (read timeout=5)
Code: Alles auswählen
2024-11-11 04:20:11,183 - {control.chargepoint.chargepoint:682} - {INFO:MainThread} - LP 3, EV: Standard-Fahrzeug (EV-Nr.0): Theoretisch benötigter Strom 16A, Lademodus scheduled_charging, Submodus: Chargemode.INSTANT_CHARGING, Phasen: 3, Priorität: False, max. Ist-Strom: 6.04
Code: Alles auswählen
2024-11-11 04:30:10,985 - {control.chargepoint.chargepoint:682} - {INFO:MainThread} - LP 3, EV: Standard-Fahrzeug (EV-Nr.0): Theoretisch benötigter Strom 6A, Lademodus scheduled_charging, Submodus: Chargemode.PV_CHARGING, Phasen: 3, Priorität: False, max. Ist-Strom: 15.52
Da stellen sich mir zwei Fragen:
1) Warum müssen die Energy-Preise alle 5 Minuten abgeholt werden? Aus meiner Sicht sind die doch fix für die kommenden 24h, oder nicht?
2) Warum wird auf PV-Charging submode umgeschaltet, wenn die Preise nicht geholt werden können? Ok, könnte der Fallback sein, Preise unbekannt => safe-mode.
Bonus) Warum kann die Preisinfo überhaupt nicht gelesen werden? Read timeout kommt von der Gegenseite? Könnte das ein DDoS sein, weil alle Welt im 5-Minuten-Takt die Preise abholt?
Wäre es nicht sinnvoller, nur den Fallback eintreten zu lassen, wenn man keine Preisinfo hat? Also weder aktuelle noch gecachte?