I am having some issues with the LaMetric component. Everything works fine when booting up PI and Hass, but after some time, the component stops working, and the LaMetric doesn’t display any notifications.
The log displays either “AttributeError: ‘NoneType’ object has no attribute ‘manager’” or “tokenExpired” when I try to send a notification to the LaMetric.
Anyone have an idea what could be causing this?
2017-07-23 13:15:28 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/lib/python3.4/site-packages/homeassistant/core.py", line 1023, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 136, in async_notify_message
yield from notify_service.async_send_message(**kwargs)
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/lib/python3.4/site-packages/homeassistant/components/notify/lametric.py", line 85, in send_message
lmn = self.hasslametricmanager.manager()
AttributeError: 'NoneType' object has no attribute 'manager'
At other times, the log looks like this:
2017-07-22 21:20:21 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/lib/python3.4/site-packages/homeassistant/core.py", line 1023, in _event_to_service_call
yield from service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/notify/__init__.py", line 136, in async_notify_message
yield from notify_service.async_send_message(**kwargs)
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/lib/python3.4/site-packages/homeassistant/components/notify/lametric.py", line 86, in send_message
devices = lmn.get_devices()
File "/home/homeassistant/.homeassistant/deps/lmnotify/lmnotify.py", line 180, in get_devices
r = self.oauth.get(CLOUD_URLS["get_devices"][1])
File "/srv/homeassistant/lib/python3.4/site-packages/requests/sessions.py", line 531, in get
return self.request('GET', url, **kwargs)
File "/home/homeassistant/.homeassistant/deps/requests_oauthlib/oauth2_session.py", line 330, in request
http_method=method, body=data, headers=headers)
File "/home/homeassistant/.homeassistant/deps/oauthlib/oauth2/rfc6749/clients/base.py", line 194, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)