hemantkamalakar / haconfigs

My Home-Assistant configuration files
60 stars 20 forks source link

Google Fit issues #3

Closed bastshoes closed 5 years ago

bastshoes commented 5 years ago

Hello.

First of all Thank you for your great sensor.

I've added custom sensor. Activated Fintness API. Sensors fetched some initial data. But I'm getting errors:

Update for sensor.andrey_steps fails

Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/util/__init__.py", line 315, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/app/homeassistant/util/__init__.py", line 315, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/sensor/google_fit.py", line 310, in update
    self._update_steps_data()
  File "/config/custom_components/sensor/google_fit.py", line 427, in _update_steps_data
    get(userId='me', dataSourceId=STEPS_DATA_SOURCE, datasetId=DATA_SET). \
  File "/usr/local/lib/python3.6/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/googleapiclient/http.py", line 837, in execute
    method=str(self.method), body=self.body, headers=self.headers)
  File "/usr/local/lib/python3.6/site-packages/googleapiclient/http.py", line 163, in _retry_request
    resp, content = http.request(uri, method, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/oauth2client/transport.py", line 175, in new_request
    redirections, connection_type)
  File "/usr/local/lib/python3.6/site-packages/oauth2client/transport.py", line 282, in request
    connection_type=connection_type)
  File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 1322, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 1072, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "/usr/local/lib/python3.6/site-packages/httplib2/__init__.py", line 996, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 986, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python3.6/ssl.py", line 975, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/lib/python3.6/ssl.py", line 944, in send
    return self._sslobj.write(data)
  File "/usr/local/lib/python3.6/ssl.py", line 642, in write
    return self._sslobj.write(data)
ConnectionResetError: [Errno 104] Connection reset by peer

I'm getting same error for all google fit sensors. And data is not updating.

Could you help with issues?

bastshoes commented 5 years ago

Sensors updates started. But error still persist.

hemantkamalakar commented 5 years ago

Thanks. How frequently you are polling?

bastshoes commented 5 years ago

Every 5 min.

bastshoes commented 5 years ago

Update: component update data only twice a day.