17-03-12 11:28:56 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.hydroquebec]: required key not provided @ data['contract']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.hydroquebec/
I guess I’m missing the “contract” key, but documention doesn’t specify what is required.
I added the contract number. Now, it does not give an error but returns only one variable “period_mean_daily_bill”, all others are missing. Log shows:
17-03-12 12:21:39 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 359, in async_process_entity
new_entity, self, update_before_add=update_before_add
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 189, in async_add_entity
yield from self.hass.loop.run_in_executor(None, entity.update)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/hydroquebec.py", line 152, in update
self._state = round(self.hydroquebec_data.data[self.type], 2)
KeyError: 'period_total_bill'
I had the same problem in the past after each restart, but normally after few hours the fields were loaded correctly.
Seems to be caused by a request timeout. I think it is set to 15 seconds.