Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

huawei_lte device_tracker and sensor entities are not updated after a device_tracker/device_scan and binary_sensor/ConnectionStatus #54243

Closed
outofsight opened this issue Aug 7, 2021 · 7 comments · Fixed by #54447

Comments

@outofsight
Copy link

outofsight commented Aug 7, 2021

The problem

device_tracker entities states are not (more) updated when a device connect / disconnect from network (ethernet or wifi); sensor readings are stationary.

After enabling debug log for huawei_lte we can read several periodic messages like [homeassistant.components.huawei_lte] lan_host_info={...} that reports correct device state (Active is 1 when device is connected, and Active is 0 when disconnected from network) but entity state doesn't reflect active state in debug log.

Explictly calling service homeassistant.update_entity is needed to update state.

When home assistant starts integration reports connected devices as "home". [[Not more: If another device connect to network a device_tracker entity is added with state "home".]]

But if one of these device disconnect from network, corresponding entity state is not updated (state is still "home").

If homeassistant restarts with some device disconnected from network, corresponding entity states are "not_home" even after the device reconnect.

Deleting and recreating integration doesn't help. Adding integration by UI or by YAML doesn't change.

Apparently integrations is not polling updates: after disabling and enabling againg system options / auto polling in the UI, entities and states are updated.

I configured the integration by YAML since beginning. The issue first appeared few days ago (after a core update?): a second instance of the integration appeared in the UI (added by some autodiscovery? by the updated core? not manually by me). I noticed also many entities corresponing to no more existant old devices. I manually deleted both instances of huawei_lte integration. But when home assistant restarted (same YAML) device_trackers stopped working.

What is version of Home Assistant Core has the issue?

core-2021.8.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

huawei_lte

Link to integration documentation on our website

https://www.home-assistant.io/integrations/huawei_lte

Example YAML snippet

huawei_lte:
  - url: !secret router_url
    username: !secret router_user
    password: !secret router_password
    notify:
      name: SMS
      recipient:
        - [...]

Anything in the logs that might be useful for us?

Additional information

No response

@probot-home-assistant
Copy link

huawei_lte documentation
huawei_lte source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @scop, @fphammerle, mind taking a look at this issue as it has been labeled with an integration (huawei_lte) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@outofsight outofsight changed the title Incorrect state of huawei_lte device_tracker entities huawei_lte device_tracker and sensor entities are not updated Aug 9, 2021
@outofsight outofsight changed the title huawei_lte device_tracker and sensor entities are not updated huawei_lte device_tracker and sensor entities are not updated after a device_tracker/device_scan and binary_sensor/ConnectionStatus Aug 9, 2021
@Maaaciek1
Copy link

Same problem in my installation since upgrading to 2021.8 core.

@scop
Copy link
Member

scop commented Aug 11, 2021

Does this happen both ways, i.e. entity states are stuck in both connected and not, or is it one way only, e.g. so that if a device becomes disconnected, it no longer becomes connected (or vice versa)?

Can you post an exact debug info row (with any info you don't want to share in public scrubbed) showing the Active key and value? We're expecting them to be strs (e.g. 'Active': '1') but the original report says Active = 1 which leaves some room for interpretation.

@scop
Copy link
Member

scop commented Aug 11, 2021

Hmm it seems none of our entities are updating any more, and the reason seems quite clear too -- not sure why it has ever worked, maybe by accident :P. Anyway seems something in 2021.8 really brought up the breakage, bisecting some to find exactly what it was.

scop added a commit to scop/home-assistant-core that referenced this issue Aug 11, 2021
Since 91a2b96, we no longer key this by the router URL, but the relevant
config entry unique id.

Closes home-assistant#54243
MartinHjelmare pushed a commit that referenced this issue Aug 11, 2021
Since 91a2b96, we no longer key this by the router URL, but the relevant
config entry unique id.

Closes #54243
balloob pushed a commit that referenced this issue Aug 16, 2021
Since 91a2b96, we no longer key this by the router URL, but the relevant
config entry unique id.

Closes #54243
@Maaaciek1
Copy link

Not exactly related to the issue but I have no idea how to ask this question elsewhere: Is there a way to shorten the time needed to change home status of device trackers to not_home? It's 5 minutes now, I belive. 1 minute for my HA would best suit my needs.

@scop
Copy link
Member

scop commented Aug 18, 2021

See https://www.home-assistant.io/help/ (forum, discord)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants