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
365 stars 102 forks source link

InfluxDBClientError: unable to parse #89

Open galmok opened 4 years ago

galmok commented 4 years ago

I got a new error today, and I am not sure how to fix it:

2020-04-10 18:09:54 INFO     Writing Points to Influx: charge_state
Traceback (most recent call last):
  File "./apiscraper.py", line 498, in <module>
    poll_interval = state_monitor.check_states(poll_interval)
  File "./apiscraper.py", line 269, in check_states
    if self.request_state_group():
  File "./apiscraper.py", line 262, in request_state_group
    influx_client.write_points([json_body])
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 490, in write_points
    tags=tags, protocol=protocol)
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 551, in _write_points
    protocol=protocol
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 327, in write
    headers=headers
  File "/usr/lib/python3/dist-packages/influxdb/client.py", line 286, in request
    raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"unable to parse 'charge_state,display_name=My\\ cár\\ name,vin=5YJSA7E28FFXXXXXX  1586534994053000000': invalid field format"}

I think the issue is due to the 1586534994053000000 (first 10 digits is normal unix timestamp) at the end, but I really am not sure. Anyway, something is wrong, and I haven't looked at the code yet.