Hi Markg , thanks for your patience on this . Your suggestion of deleting the octopusagile.json file means that the integration starts now . I also have octopusagile.rates populated , as well as a few other octopusagile entities but no timers. I tried calling octopusagile.update_timers as a service but it threw the following error:
2021-01-01 15:08:15 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140593900333136] min() arg is an empty sequence
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1484, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/octopusagile/__init__.py", line 129, in handle_update_timers
min_rates = myrates.get_min_times(required_slots, date_rates, parsed_requirements)
File "/config/custom_components/octopusagile/OctopusAgile/Agile.py", line 115, in get_min_times
min_key = min(d, key=d.get)
ValueError: min() arg is an empty sequence
I also tried calling octopusagile.half_hour as a service and got the following:
2021-01-01 15:02:31 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140593900333136] 'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1445, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1484, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/octopusagile/__init__.py", line 176, in handle_half_hour_timer
for device in devices:
TypeError: 'NoneType' object is not iterable
also, , assuimg I get some timers out of this does the integration itself call the timer.start function in some way ? or is that someting for me to call in a seperate Automation ? if it is the latter is there a reccomended condition that should be true in order to trigger the Automation - I’m assuming running the automation is something you would do on a daily basis once the timers have been updated - is triggering the automation by time the best way or does octopusagile raise some event that I can hook into ?