Issue with GPSLogger in HASS 0.34.1

My first words to thank you all (devs and community) for this great piece of software that allows me to have a lot of fun in my spare time. My knowledge in computers and electronics is rather limited (mechanical engineer) but not my will to learn all your advices. So here is the question:

Anyone got GPSLogger working in HASS 0.34.1? I have but partially. First of all I have to say that I really don’t know if this is a bug from HASS o from GPSLoger (or from my brain). Let me explain a little bit.

I followed the instructions here: GPSLogger - Home Assistant (missing https:// because I can only post two links)
So setting up GPSLoger is as easy as include this lines in config file:

device_tracker:

  • platform: gpslogger

Being home with my local network, I got this working in the Android app by setting as URL:
http://192.168.0.8:8123/api/gpslogger?latitude=%LAT&longitude=%LON&battery=�TT&device=%SER&accuracy=�C

HASS logger says:

INFO:homeassistant.components.http:Serving /api/gpslogger to 192.168.0.197 (auth: True)
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=device_tracker.lw067088, new_state=<state device_tracker.lw067088=home; longitude=REDACTED, gps_accuracy=20, battery=60.000004, latitude=REDACTED, friendly_name=Dad @ 2016-12-06T23:38:37.944962+01:00>, old_state=<state device_tracker.lw067088=home; longitude=REDACTED, gps_accuracy=22, battery=61.0, latitude=REDACTED, friendly_name=Dad @ 2016-12-06T23:38:37.944962+01:00>>

For the tests I have performed here I did not setup the api_password in HASS (yes, I know the implications but I wanted to keep it as simple as I could) so I have access to my little raspberry-pi from outside and this works properly when I disable the WIFI in my Android phone, leave mi local network and go to myserver:8123 (missing http:// because I can only post two links). HASS logger says:

INFO:homeassistant.components.http:Serving / to RED.ACT.ED.32 (auth: True)
INFO:homeassistant.components.http:Serving /api/bootstrap to RED.ACT.ED.32 (auth: True)

Now I setup to GPSLogger the URL: http://myserver:8123/api/gpslogger?latitude=%LAT&longitude=%LON&battery=�TT&device=%SER&accuracy=�C but nothing appears in HASS logger.

Maybe we are facing a PEBKAC here but any hint or suggestion will be welcome. Thanks!

Tim

Have you tried
curl http://myserver:8123/api/gpslogger?latitude=1&longitude=2&battery=3&device=test&accuracy=4
from a console?

Or open the url in a browser?

1 Like

Thanks for your help!
This is what I got (sorry, no sense to me):
From a console:
$ curl http://myserver:8123/api/gpslogger?latitude=1&longitude=2&battery=3&device=test&accuracy=4
[1] 7148
[2] 3388
[3] 5752
[4] 7464
401: Unauthorized[1]- Done curl http://myserver:8123/api/gpslogger?latitude=1
[2] Done longitude=2
[3] Done battery=3
[4]+ Done device=test

Opening the url in a browser opens the “Save to file” dialog window, so I save it and the contents of that file is:
Setting location for test

Not sure if this makes sense. Thanks again!

If you now open your known_devices.yaml file, I think you will find the “test” device. If so, I think it is something with the setup of the gpslogger app.
Tried to start and stop logging? Sometimes it takes a while before it starts to send.

Hi. Exactly the same problem for me. Command line with curl is working fine. But from gpslogger, does not work. I tried to remove the variables from the gpslogger string (like you did for the curl example, using “test”) : same result.

Regards

Hmm, it works fine here.
Try to check the settings of the app.
There are some settings that requires the phone to move a certain distance and limit how often it will send a new position.
Try also to enable the gps as a source.
It also possible to choose “Log view” in the app, check there are any error there.

I tried and I get
Error 401 unauthorized …??

Do you have an api password?
The have to add &api_password=<password>

Ok, it transfers a file GPSLogger. I open with Notepad and there is “Setting location for test”

@anon35356645 Then it should work.

Now the known_devices contains
test:
hide_if_away: false
mac:
name: test
picture:
track: true
vendor:

And I have a circle in the Front-End (finally).

Only problem it shows AWAY, when I am at home …

That is the test device you see, and the location was sat to (1,2) and that is not your home location.
Now you have to set it up to work with the gpslogger app. But you know that the url and hass is correctly sat up.

In HA my GPS data are (123456 are different in reality)
41.123456
12.123456

In gpslogger
41.123
12.123

maybe reduce to 3 digits in HA?

I do not think you need to do that.
Do know that you are getting the position from the gpslogger app to HA?
If you open the circle in the Front End, you should see the latitude and logitude of that device.

mmhh yes I understand.

I still don’t see myself in the map. And in the front-end I (the smartphone where gpslogger is installed) am away

No I don’t have that

Not inside the TEST circle, not inside my smartphone circle.

This I have in configuration, maybe too many trackers?

device_tracker:
  - platform: owntracks
  - platform: gpslogger
  - platform: nmap_tracker
    hosts: 192.168.1.1/24
    consider_home: 180
    track_new_devices: no

Testing I removed all other components
now in configuration I have only

device_tracker:
  - platform: gpslogger

still inside the circles in front-end no gps position (and smartphone is still AWAY)

it should give coordinates 1,2???

It seems to be related to gpslogger: I get a “error while executing job com.mendhack.gpslogger.loggers.customurl”
debug files gives me a fail to connect.
The same url with curl works fine.

Weird thing : sometimes, I get a success (but quite rare).

Weird…