Error with gpslogger

When I add the% BATT in url parameter, as per instructions. I get error 500 and the log below:
my url: https://XXXX.duckdns.org:8123/api/gpslogger?latitude=%LAT&longitude=%LON&device=%SER&api_password=XXX&battery=�TT

I’m, trying curl (console), web browser and gpslogger test in app. all returns same error.

anyone to help me?

LOG ERROR:
Error handling request
Traceback (most recent call last):
File “/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py”, line 381, in start
resp = await self._request_handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web_app.py”, line 322, in _handle
resp = await handler(request)
File “/usr/lib/python3.6/site-packages/aiohttp/web_middlewares.py”, line 88, in impl
return await handler(request)
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/static.py”, line 68, in staticresource_middleware
return await handler(request)
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py”, line 27, in real_ip_middleware
return await handler(request)
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/ban.py”, line 68, in ban_middleware
return await handler(request)
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/auth.py”, line 54, in auth_middleware
return await handler(request)
File “/usr/lib/python3.6/site-packages/homeassistant/components/http/view.py”, line 98, in handle
result = await result
File “/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/gpslogger.py”, line 87, in get
battery = float(data[‘battery’])
ValueError: could not convert string to float: ‘�TT’

From the docs:

https://[IP address Home Assistant]:[Port]/api/gpslogger? latitude=%LAT&longitude=%LON&device=%SER&accuracy=%ACC &battery=%BATT&speed=%SPD&direction=%DIR &altitude=%ALT&provider=%PROV&activity=%ACT

For Home Assistant only the above URL, as written, will work - do not add or remove any parameters.

I’m not sure which instructions you’re following, but they’re not the right ones.

yes initially I put the url as per the instructions of the component, but I was removing parameters to identify the error. and you are wrong that there must be all the parameters, because the url below works, but does not register the percent of battery.

https://XXXX.duckdns.org:8123/api/gpslogger?latitude=%LAT&longitude=%LON&device=%SER&api_password=XXX

the error occurs only when it has the battery=%BATT parameter

Weird. Mine is exactly as in the docs (well, ok, I replaced %SER with the string I wanted to identify the device as), and it works without issue.

What version of Home Assistant are you running?

same error =(

when I put full url:
attrs[‘direction’] = float(data[‘direction’])
ValueError: could not convert string to float: ‘%DIR’

Remove direction=%DIR:

I get the error:
accuracy = int(float(data[‘accuracy’]))
ValueError: could not convert string to float: ‘�C’

remove accuracy=%ACC:
error:
attrs[‘speed’] = float(data[‘speed’])
ValueError: could not convert string to float: ‘%SPD’

remove: speed=%SPD
error:
attrs[‘altitude’] = float(data[‘altitude’])
ValueError: could not convert string to float: ‘%ALT’

remove altitude=%ALT
error:
battery = float(data[‘battery’])
ValueError: could not convert string to float: ‘�TT’

remove battery=%BATT

And finally work with:

https://xxxx.duckdns.org:8123/api/gpslogger?latitude=%LAT&longitude=%LON&device=%SER&altitude=%ALT&provider=%PROV&activit=�T&api_password=XXXX

version 0.70, but this error
occurs in previous versions

I’d raise an issue. There’s something odd going on, since I don’t see it at all, and that way somebody will have a chance to find out what’s going on.

Thanks, but how do I raise an issue?

See the documentation here

I’m running HASS.IO 0.71.0. I was trying to configure gps logger but I get this error:

    Error handling request
    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 385, in start
    resp = await self._request_handler(request)
      File "/usr/lib/python3.6/site-packages/aiohttp/web_app.py", line 338, in _handle
    resp = await handler(request)
      File "/usr/lib/python3.6/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/static.py", line 68, in staticresource_middleware
    return await handler(request)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/real_ip.py", line 27, in real_ip_middleware
    return await handler(request)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 54, in auth_middleware
    return await handler(request)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/view.py", line 98, in handle
    result = await result
      File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/gpslogger.py", line 85, in get
    accuracy = int(float(data['accuracy']))
    ValueError: could not convert string to float: '�C'

I followed the guide (https://www.home-assistant.io/components/device_tracker.gpslogger/ 4) and this is the url entered in the gpslogger app:

https://xxx.duckdns.org/api/gpslogger?latitude=%LAT&longitude=%LON&device=oneplus3&accuracy=�C&battery=�TT&speed=%SPD&direction=%DIR&altitude=%ALT&provider=%PROV&activity=�T&api_password=yyy

What is the language of your smartphone?

My language is italian

I raise an issue, but did not find any error in the homeassistant. gpslogger is opensource, I’m thinking of checking the code to see if I can identify what it can be. I believe that in some language there are going to be invalid characters, as happened to me (in Portuguese)