It doesn’t seem to be updating in HA every 5 minutes. My wife is 20 minutes away from her last location and it still shows her as being in that zone. How does trackr update their location for her sensor thing. Does she have to have the app running on her phone? Or does someone near her just have to have it running on their phone?
I am not sure, I haven’t been able to test much with that. I believe it will update when anyone with the trackr app is near by. I don’t know how often the trackr app scan though, or how the phones GPS setting effect it.
Thanks. Right, that was the first problem, now I installed with
sudo pip3 install pytracker
and run with
sudo python3 test.py
Which works better, but it still fails with:
Traceback (most recent call last):
File “test.py”, line 18, in
output_device_states()
File “test.py”, line 5, in output_device_states
print("Custom name: " + device.name())
TypeError: Can’t convert ‘NoneType’ object to str implicitly
Tried replacing dashes, space, special characters so I have no strange naming at least…
try doing the pip install without sudo. That fixed that error for me. But I would expect running test.py with sudo would have the same effect so I’m not sure if that will make a difference.
Make sure you are running the latest version of the test.py from github. You are running an old version. Also it looks like you don’t have at least one of your trackrs named.
Thanks! Worked like a charm! My error was that I was using the test-script from above, missed that there was a repo with an update one… I didn’t have any unamed parts.
So what I did so far on an rasbeerry with all-in-one was:
sudo pip3 install pytrackr
create test.py from https://github.com/w1ll1am23/pytrackr
Set username and password in test.py
python3 test.py
And output there is!
Sorry for being a pain
Can’t get this working either for some reason. Entered it in config, created trackr.py by wgetting it - file looks fine. Even tried chmodding it 777 - have another integration in the same directory that is working, but this gives:
Dec 25 10:07:32 raspberrypi hass[2005]: ERROR:homeassistant.bootstrap:Unable to find platform device_tracker.trackr
did you put it in the custom_code/device_tracker directory?
Ok,
I learned some things about the trackr devices today. If you have your phone with you, and the trackr app is running, everything is fine. But the phone has to be running the trackr app (in the background is fine). So it really doesn’t fix the main problem for me with presence detection. The person you are trying to detect has to do something (in this case remember to keep the trackr app running). So here is what I am going to do. I have an old ipad that I am going to put in a central location in my house running the app. Then when trackr devices come within range (approximately 100ft) it will sense the trackr and notify the trackr people’s server. But that brings us to the next problem. Integrating this with HA is internet dependent. If your internet goes down, then so does your presence detection. The good thing is that at least this shouldn’t kill the battery on your phone the way that some of the other presence detection schemes do. Also if you leave whatever your trackr is connected to at home, then your house is going to think you are home and if you leave it at work, HA will think you still are at work. But trackr does have some neat little bells and whistles to try and keep that from happening (at the cost of battery life of course). I think we may be a ways off from true presence detection until we get atomic powered skin implants with cellular transmitters built in.
Ah… Didn’t realize that it should be in a device_tracker directory, now it loads just fine and in the log it is logging:
Dec 27 08:32:01 raspberrypi hass[2005]: INFO:pytrackr.api:Pulled latest state from API.
So far so good. I do not see any actual entities in the “States” view of Home Assistant. What would be the next to get the stuff into HA? Thanks for your patience
/Johan
See if your trackr(s) show up in “known_devices.yaml”. If they do, you can make a group with those names in them and it will make it easier to find them.
Mine are setup as follows in configuration.yaml
device_tracker:
- platform: trackr
username: [email protected]
password: xxxxxxx
in my groups.yaml file I have
all_mobile_devices:
view: no
entities:
- device_tracker.my_keys
- device_tracker.wifes_keys
I have zones setup as well and based on the trackr reporting the lon/lat, HA is reporting the correct zone where the person is.
I still am not getting a satisfactory response from the proximity control. It seems to take forever for it to update and I have never seen it update with two trackers.
One other thing to remember. The trackr is a low powered bluetooth device. Phones within about 100 feet of clean air can sense the device and report it’s approximate location based on where the phone is if they have the app running. If the trackr isn’t around someone with the app running, then the location for it will not be accurate. So if you have the trackr on your key ring and you have your keys and your phone with you, it should work great. If you leave your phone at home and drive off, unless you stop at a stop sign near someone with the trackr app running your location will not update.
Please excuse my noobness with hass, I added:
device_tracker:
- platform: trackr
username: [email protected]
password: xxxxxxx
to configuration.yaml (with my credentials, of course), but don’t see any evidence on the site that anything is working. I don’t see any known_devices.yaml anywhere. Have I missed a step / done something wrong?
did you restart HA? I’m assuming you got the indenting right.
As a side note, you can get the indenting right in here, by pasting your code in the comments window like you did. But then highlight it and press the </> icon above. That makes it keep the formatting it had and doesn’t compress it all to one side. And considering how important spacing is to YAML and Python. It’s good to know.
Thanks. Yes, I’ve restarted it, and I preserved the indenting from the example. (In my post I meant to mark it as code, and forgot)
Are there any errors in the HA log. Check in your states browser <> at the bottom of the left hand menu. Any devices would show up like device_tracker.charlie. I just added one last night and I’m trying to remember the steps I went through. It should have shown up in your known devices if your login criteria are correct.
I’m away from home at the moment. It’s possible I got my password wrong. I will check.
I’m heading home, but I’ll be back online after dinner if you have any questions.
I hope you enjoyed your dinner.
I forgot the caps in my password is all. I did come across the apostrophe problem: “Mike’s Wallet”.
Great,
Glad to hear it. I just spent an hour trying to figure out how to get my son’s phone to show up in the family group. Trackr is nice, you have to keep the app running all the time in order for it to update correctly. But coupling that with zones, I can tell when my kids are at school, or at work, and which store my wife is working at today, as well as when people are home. But it’s not realtime by any measure.