Open ildar170975 opened 2 months ago
Hey there @ludeeus, mind taking a look at this issue as it has been labeled with an integration (traccar_server
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
traccar_server documentation traccar_server source (message by IssueLinks)
After a manual reloading the integration - info is valid again. But the issue is that data should not become invalid.
If anything prevents the integration to work properly (internet issues, timeouts etc) - there are should be corr. messages in Log.
And binary_sensors for "status" are unknown
- WTH?
This sensors for status
LOOKS normal:
In fact some of them are unknown
:
And this is not just a "displayed state" - it seems to be a real state:
The source value could be online
or unknown
- then WTH a binary_sensor
is used?
Why not a sensor
?
If you have chosen a binary_sensor
- then make it on / off
, not on / unknown
.
Hint: the unknown
state in considered by users as "there is smth wrong with my sensor".
In this particular case the unknown
value for a source status is absolutely normal value - it merely means "no updates from a device within some period".
Moreover - a device_tracker state becomes outdated as well, even when a status sensor is ON. Before 2024.5 it was working fine.
Anyone from Dev team - are you going to do anything about Traccar? Trackers stop being updated after a few hours after HA reboot. See no feedback here.
Until you can provide the logs for whats happening on your system (hint, mine does not have these symptoms), there is not really much to look at. The data is updated over a WebSocket connection to the traccar server, so a) that connection stopped (which would have produced logs) or b) your server stopped sending data.
Can you tell me what logs are needed? There is nothing in Log related to Traccar (except a "Waiting on integrations to complete setup" with a long list of integrations).
As I already described:
@ludeeus
Tell me, are you trying to re-establish a connection to Traccar server after loosing an access to Internet?
Guess - not.
I see that for every device_tracker
a value of last_updated
is immediately before some "no internet access" event.
As I said already - I see no messages in Log. Are you willing to fix the issue? Then at least tell me how I can help you.
Can you tell me what logs are needed? There is nothing in Log related to Traccar (except a "Waiting on integrations to complete setup" with a long list of integrations).
As I already described:
- reboot HA
- sensors show correct data (at least same as reported by traccar-web)
- after several hours (I could not touch HA at all) - sensors stuck on their values
Have you set debug for traccar in your logging configuration ?
homeassistant.components.traccar_server: debug
pytraccar: debug
I have in enabled debug in my logs and apparently the integration is retrying fine after problem with server access.
File "/usr/src/homeassistant/homeassistant/components/traccar_server/coordinator.py", line 198, in import_events
events = await self.client.get_reports_events(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pytraccar/client.py", line 145, in get_reports_events
response: list[ReportsEventeModel] = await self._call_api(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pytraccar/client.py", line 105, in _call_api
raise TraccarConnectionException(
pytraccar.exceptions.TraccarConnectionException: Could not communicate with Traccar - Cannot connect to host XXXXXXXXX:443 ssl:default [None]
Have you set debug for traccar in your logging configuration ?
No, using default settings for logger. That is why I said several times that there is no messages in log & asked how I can get more info.
Shall I add the "pytraccar: debug" line as well?
Have you set debug for traccar in your logging configuration ?
No, using default settings for logger. That is why I said several times that there is no messages in log & asked how I can get more info.
Shall I add the "pytraccar: debug" line as well?
I made this to try to find a problem in my environment that occurred sometimes and apparenrly is not ocurring on 2024.5 anymore.
using debug will use more space, but maybe can help you to find the source of your problem.
With these settings
logger:
default: warn
logs:
homeassistant.components.traccar_server: debug
pytraccar: debug
I see this Log (filtered by "traccar" word):
The last message was at ~18:26, at bout same time I rebooted my router:
Now it is 18:43, sensors are not updating, no new "Received subscription data" messages in Log.
Then I reloaded the integration manually at ~18:45:
And again sensors are updated:
If the new updated integration needs to be manually reloaded after rebooting a router - I would not call this a proper change.
Hello, I have the same problem. Trackers selectively stop showing the correct state and position, and freeze in a certain place, although everything is displayed correctly on the web page. This started after the update to XA 2024.5. Before this there were no problems for two years... There is no information about errors in the logs.
Rebooting the integration helps. After this, all sensors and trackers display the correct information and position.
Added to see logs
logger:
default: warn
logs:
homeassistant.components.traccar_server: debug
pytraccar: debug
And it turns out that at a certain time there is a last entry regarding traccar and thatβs it, sensor updates stop there. The same time is listed in the last_updated attribute
I noticed one more thing. All trackers immediately stop updating in XA, but if one of these trackers is rebooted by the XA service
service: homeassistant.reload_config_entry
data: {}
target:
entity_id: device_tracker.Ρ
Ρ
Ρ
Ρ
Ρ
Ρ
Ρ
Ρ
then the rest are also updated and show the correct state.
but if one of these trackers is rebooted by the XA service
Probably because all trackers have same config entry.
Π²ΡΠ΅ ΡΡΠ΅ΠΊΠ΅ΡΡ ΠΈΠΌΠ΅ΡΡ ΠΎΠ΄ΠΈΠ½Π°ΠΊΠΎΠ²ΡΡ Π·Π°ΠΏΠΈΡΡ Π² ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ
ΠΡΠΎ-ΡΠΎ ΠΏΠΎΠ½ΡΡΠ½ΠΎ))) ΠΠ°ΠΌ ΡΠ΄Π°Π»ΠΎΡΡ ΠΊΠ°ΠΊ-ΡΠΎ ΡΠ΅ΡΠΈΡΡ ΠΏΡΠΎΠ±Π»Π΅ΠΌΡ?
@ludeeus Can you at least leave some feedback?
I have tried many times in my environment to block the connection between traccar and homeassistant DROPing and REJECTing packets. And it returns correctly.
I use a remote traccar 6.1 with https and my homeassistant runs on docker x86_64. Maybe the users that are having trouble have a different environment that creates an error that integration cannot recover and require the reload to restart.
As workaround until someone give a log that contains information to track the problem I suggest to check last_updated / last_changed and reload if is outdated.
To get other dates from traccar this commit make available as attributes : https://github.com/ivanfmartinez/home-assistant-core/commit/328e01ea4459cffb1040ad20fb981df2c15e6189
I use a remote traccar 6.1 with https and my homeassistant runs on docker x86_64. Maybe the users that are having trouble have a different environment that creates an error that integration cannot recover and require the reload to restart.
My setup is: HA in docker, Traccar demo server. To reproduce - simply reboot a router. Interesting thing is that there is no error-like messages in Log (see my post) in case of any failure.
As workaround until someone give a log that contains information to track the problem I suggest to check last_updated / last_changed and reload if is outdated.
This is what I do now to reload Traccar integration: -- there is a PING binary_sensor to check Internet availability (OFF - no internet) periodically; -- there are automations which check that binary_sensor; if it was OFF then became ON -> a custom event "internet_restored" is sent; -- some automation reloads Traccar config entry when that "internet_restored" event comes.
@ildar170975, @ludeeus
I found out that this problem arose with the transition to version HA 2024.3.
Now on the "combat" server HA 2024.2.5, on the "test" server - 2024.3.3. I temporarily turn off the Internet, literally for a second, all sensor updates on the βtestβ server stop, on the βcombatβ server everything works.
On the "test" server - 2024.3.3. (installed in a virtual machine, debian, supervisor), nothing is installed except Traccar integration, clean server.
In my case it stopped working after update to 2024.5. I am absolutely sure about it since never miss a HA update. Router is rebooted automatically every day at 06:00 for last few years. So, after 2024.5 see no Traccar updates after any router's reboot.
May be simply reproduced by unplugging an Ethernet cable from a HA machine. Besides - as I demonstrated earlier - there are NO messages in LOG. Even with debug messages ON.
@ildar170975 Here's my option. The first server is the main one, 2024.2 The second is test, 2024.3 If the Internet is briefly disconnected and then turned back on, the first server continues to update data, but the
https://github.com/home-assistant/core/assets/79503021/37e1ee1b-609d-4113-a294-2ffc5665937a
second one stops.
@Caldin-Maldin Thanks for the test! Well, let's say that it is not really important in which particular version it was broken. In your case it happened in 2024.3, in my case in 2024.5. The issue is that it was BROKEN, and I wonder why it is being ignored by HA dev team.
I think I have the same problem. Traccar stops sending data after some undefined time. Reloading the integration immediately remedies the situation. I will take a look into the logs and provide more details asap.
Running HA: Core 2024.6.4 Supervisor 2024.06.0 Operating System 12.3 Frontend 20240610.1
Traccar on the official paid version of Traccar at server.traccar.com
The problem
In 2024.5 for all my devices - status & battery_level are wrong.
Take this:![image](https://github.com/home-assistant/core/assets/71872483/845481b2-fea2-459c-b2c1-968aa8c095a5)
which is in fact (from a web page)
(and battery_level is a correct value)
Or this:
which is in fact:
![image](https://github.com/home-assistant/core/assets/71872483/a0fb308b-fdc2-4457-852e-293fb67724a7)
Or this:
with this history for the status:
although the device was seen a few minute ago in fact:
and it's last status was
![image](https://github.com/home-assistant/core/assets/71872483/538f6cbe-20e4-483f-a5d8-a08f186a83a9)
No messages in Log:![image](https://github.com/home-assistant/core/assets/71872483/f9709f35-2ca5-4a97-a30d-ccbe56c6de2e)
What version of Home Assistant Core has the issue?
2024.5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
traccar server
Link to integration documentation on our website
https://www.home-assistant.io/integrations/traccar_server/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response