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
When you have a cost tracker that hasn't been reset for more than 2 days (e.g. older than the previous available rates), then you start getting errors in the form of
Traceback (most recent call last):
File "/config/custom_components/octopus_energy/electricity/__init__.py", line 41, in calculate_electricity_consumption_and_cost
rate = next(r for r in rate_data if r["start"] == consumption_from and r["end"] == consumption_to)
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/octopus_energy/cost_tracker/cost_tracker.py", line 225, in _async_calculate_cost
self._recalculate_cost(current, consumption_data.tracked_consumption_data, consumption_data.untracked_consumption_data, rates_result.rates)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/octopus_energy/cost_tracker/cost_tracker.py", line 276, in _recalculate_cost
tracked_result = calculate_electricity_consumption_and_cost(
tracked_consumption_data,
...<5 lines>...
target_rate=target_rate
)
File "/config/custom_components/octopus_energy/electricity/__init__.py", line 43, in calculate_electricity_consumption_and_cost
raise Exception(f"Failed to find rate for consumption between {consumption_from} and {consumption_to}")
Exception: Failed to find rate for consumption between 2024-12-31 08:00:00+00:00 and 2024-12-31 08:30:00+00:00
Reproduction steps
Setup a cost tracker with manual reset enabled
Don't reset the cost tracker for 2 days
Expected behaviour
The cost tracker should continue to work for more than two days or a repair notice should be raised stating the cost tracker needs resetting. Either way, the sensor should not throw an error
Tariff Code
N/A
Integration Version
13.5.1
Home Assistant Version
2024.12.5
Fresh Install?
Not specified
Home Assistant Logs
N/A
Confirmation
I confirm that I cannot find my solution within the documentation
I confirm that I cannot find my solution within the FAQ
The text was updated successfully, but these errors were encountered:
Describe the bug
When you have a cost tracker that hasn't been reset for more than 2 days (e.g. older than the previous available rates), then you start getting errors in the form of
Reproduction steps
Expected behaviour
The cost tracker should continue to work for more than two days or a repair notice should be raised stating the cost tracker needs resetting. Either way, the sensor should not throw an error
Tariff Code
N/A
Integration Version
13.5.1
Home Assistant Version
2024.12.5
Fresh Install?
Not specified
Home Assistant Logs
N/A
Confirmation
The text was updated successfully, but these errors were encountered: