![]() If you ask me, both the package and the HA integration are poorly written, at least regarding proper error handling. (It leaves that to the user, which in this case is the HA integration, which mostly ignores it.) Furthermore, it ignores any status response codes besides 200 & 401. to the log when it receives an error 401. Hmm, maybe another “bug” in the code? I.e., when it tests the connection the first time, and if it works, it doesn’t remember the connection worked, so when it updates (which it does immediately after that, and then periodically) it will test the connection again (which is where you’re seeing the restored message), and then remembers whether or not the connection worked (but ignores any authentication errors.) And even more unfortunate is that the pytraccar package doesn’t bother to write any warnings, etc. Oliver and Peter aren’t setup yet so not expecting data for those two. This returns the following, which looks reasonable. I verified the traccar data using the web api directly to fetch a list of devices (GET /api/devices). The updating repeats at roughly 30 second intervals. 17:28:50 DEBUG (MainThread) Updating device data 17:28:50 INFO (MainThread) Connection to Traccar restored 17:28:50 DEBUG (MainThread) Testing connection to Traccar 17:28:49 INFO (MainThread) Setup of domain traccar took 0.0 seconds. 17:28:49 INFO (MainThread) Setting up traccar I’ve now done that the logging output isn’t particularly useful but does suggest that it’s not finding any devices: 17:28:48 INFO (SyncWorker_6) Loaded traccar from I hadn’t enabled debug logging yet, the above was just the info output. The devices show up and update fine in Traccar itself, so I know that part is ok. I’m not sure what to expect next - I don’t see any new devices or entities added, and if I listen for events I don’t see any traccar-based events generated. 15:08:05 INFO (MainThread) C onnection to Traccar restored On startup, the only relevant line I see in the logs is this: Traccar_host is set to my internal IP address (192.168.1.xxx). I’ve added the following to my configuration.yaml: device_tracker: Home assistant is run as a docker image under docker-compose using plain home assistant (no hassio). I’ve had a traccar server running previously, which is on the same machine (a pi 4) as home assistant but otherwise totally separate. I’m relatively new to home assistant, and trying to add traccar to track locations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |