home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.7k stars 28.86k forks source link

Traccar: device_tracker is not available by the time of `homeassistant.start` #116801

Open ildar170975 opened 1 month ago

ildar170975 commented 1 month ago

The problem

Starting from 2024.5, I see that device_tracker ALWAYS not ready by the time when homeassistant.start event is sent.

alias: test_traccar
description: ""
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: persistent_notification.create
    metadata: {}
    data:
      message: >-
        {{ states('device_tracker.iphone_5s_traccar') }}
mode: single

This gives unavailable in notification. Although the device_tracker.iphone_5s_traccar entity seems to be OK when I open more-info right after HA start.

It did not happen before 2024.5.

What version of Home Assistant Core has the issue?

2024.5.0

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

home-assistant[bot] commented 1 month 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!

Code owner commands Code owners of `traccar_server` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign traccar_server` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


traccar_server documentation traccar_server source (message by IssueLinks)

ildar170975 commented 1 month ago

I see that device_tracker is unavailable during reboot: image

Cannot say for sure was it unavailable before 2024.5. But it was definitely available after homeassistant.start.

ludeeus commented 1 month ago

I have tried to look but could not see any documentation that say that all entities will have gotten an updated state when that event is fired. That will impact all entities for push integrations, so I would expect there to be documentation for it, can you point me to where you have that from?

ildar170975 commented 1 month ago

I am not following an official docs for HA developers. This is needed for HA developers, not HA users. As a user - I say that earlier (before 2024.5) device_trackers for Traccar did not have these gaps in history. This is my opinion, this is what I remember. Ofc I could be wrong. Then you please tell me that I am wrong and Traccar integration never restored it's last state after HA reboot.

Caldin-Maldin commented 3 weeks ago

I confirm, I have now returned to version XA 2024.1. Traccar works perfectly in it. In version 2024.5, the sensors actually go into the unavailable state when rebooted.

Well, the sensors constantly stop updating... https://github.com/home-assistant/core/issues/116628

ildar170975 commented 2 weeks ago

Just checked with 2024.6.1 - and see no unavailable gaps during HA reboots:

изображение

Cannot say if there were any related changes in a code of Traccar server integration.

Closing the issue now. Please let me know if it should be reopened.

ildar170975 commented 2 weeks ago

Reopening, still see it sometimes. Erratic behaviour.

There is an unavailable gap during HA reboot (a below graph is for HA uptime): изображение

issue-triage-workflows[bot] commented 2 days ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

ildar170975 commented 2 days ago

up