lephisto / tesla-apiscraper

API Scraper for pulling Vehicle Statistics from the Tesla Owner API into an InfluxDB + Grafana Dashboards
GNU Lesser General Public License v3.0
364 stars 102 forks source link

Invalid Field Format #51

Closed bad1dea closed 5 years ago

bad1dea commented 5 years ago

apiscraper | Exception in thread elevator: apiscraper | Traceback (most recent call last): apiscraper | File "/usr/local/lib/python3.7/threading.py", line 917, in _bootstrap_inner apiscraper | self.run() apiscraper | File "/usr/local/lib/python3.7/threading.py", line 865, in run apiscraper | self._target(*self._args, **self._kwargs) apiscraper | File "/tesla-apiscraper/srtmread.py", line 29, in elevationtoinflux apiscraper | ifclient.write_points(elev_json_body) apiscraper | File "/usr/local/lib/python3.7/site-packages/influxdb/client.py", line 490, in write_points apiscraper | tags=tags, protocol=protocol) apiscraper | File "/usr/local/lib/python3.7/site-packages/influxdb/client.py", line 551, in _write_points apiscraper | protocol=protocol apiscraper | File "/usr/local/lib/python3.7/site-packages/influxdb/client.py", line 327, in write apiscraper | headers=headers apiscraper | File "/usr/local/lib/python3.7/site-packages/influxdb/client.py", line 286, in request apiscraper | raise InfluxDBClientError(response.content, response.status_code) apiscraper | influxdb.exceptions.InfluxDBClientError: 400: {"error":"unable to parse 'drive_state,display_name=xxx,vin=xxx 1557350116668000000': invalid field format"} apiscraper | apiscraper | apiscraper | INFO:apiscraper:Asleep since: 0 Sleeping for 32.0 seconds.. apiscraper | 2019-05-08 21:15:33 INFO Asleep since: 0 Sleeping for 32.0 seconds..

MortenCB commented 5 years ago

I get this a lot as well. It seems to work fine, but obviously some data is not getting stored. I don't know the reason for this. Any ideas?

lephisto commented 5 years ago

Umlauts in Displayname/Vehiclename?

wtran63 commented 5 years ago

Looking into this, this is due to the strm package not providing any data based on long/lat. Adding in a elevation is None check before writing to db will resolve this.

bad1dea commented 5 years ago

great guys! thanks.