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

Sensors become stale and not unavailable and can't be deleted #3120

Open
golles opened this issue Nov 1, 2024 · 9 comments
Open

Sensors become stale and not unavailable and can't be deleted #3120

golles opened this issue Nov 1, 2024 · 9 comments
Assignees

Comments

@golles
Copy link

golles commented Nov 1, 2024

Device model, version and app version

Model Name: Apple M3 Pro
macOS Version: 15.0.1
App Version: 2024.9.2
Safari Version: I don't use safari

Home Assistant Core Version

2024.10.4

Describe the bug
Sensors become stale and not unavailable and can't be deleted

To Reproduce
I had issues with my UPS and have connected it to my MacBook, I got a new one and also connected that to the Macbook to check it before installing. After disconnecting, the sensors remain active and can't be deleted.

Expected behavior
Something should happen with these sensors, I think what other integrations do is make them unavailable, which probably makes the most sense.
In my case, I would see them deleted, if they would become unavailable I could delete them manually.

Screenshots

In HA the sensors remain there and look active:
Scherm­afbeelding 2024-11-01 om 11 41 16

After restarting the app on my Macbook, the sensors were removed from here:
Scherm­afbeelding 2024-11-01 om 11 41 01

The delete button isn't clickable, so can't delete them
Scherm­afbeelding 2024-11-01 om 11 46 49

Additional context

@bgoncal
Copy link
Member

bgoncal commented Nov 4, 2024

Correct me if I'm wrong but your UPS entities have no relation to macOS App right? How did you add them to Home Assistant?

@bgoncal bgoncal self-assigned this Nov 4, 2024
@golles
Copy link
Author

golles commented Nov 4, 2024

I guess the app detects all batteries connected to the Mac? The only thing I did is plug in the USB cable.

@bgoncal
Copy link
Member

bgoncal commented Nov 4, 2024

Oh, sweet! I honestly didn't know this was a feature haha, I'll update you as soon as I have more info

@golles
Copy link
Author

golles commented Nov 4, 2024

It is actually nice indeed, this is what I see in my Mac battery settings when the UPS is connected
Scherm­afbeelding 2024-11-04 om 19 40 07

@bgoncal
Copy link
Member

bgoncal commented Nov 5, 2024

After you restarted your mac, were you able to remote those sensors? You can also disable them if needed. Also, if you delete your macbook entry from mobile_app integration, the next time you launch the app form scratch it will recreate everything

@golles
Copy link
Author

golles commented Nov 5, 2024

After I restarted the Mac, they still show up in HA.
Scherm­afbeelding 2024-11-05 om 23 19 29
and they still look active, which still doesn't allow me to remove them.

I understand I can fix this by removing the integration for this Macbook, but that would be ignoring this bug.

But now I think of it, is this a bug from the app or within core?
As the app doesn't show these sensors anymore, shouldn't the integration in core detect them as stale and mark them as unavailable? What do you think?

@bgoncal
Copy link
Member

bgoncal commented Nov 5, 2024

Sorry, I didn't mean to close this bug with the workaround, just giving you short term solution.

I think iOS app needs to ask core to remove those sensors, but I am not sure, @dshokouhi what do you do in Android in such cases?

@dshokouhi
Copy link
Member

what do you do in Android in such cases?

ours are also not removed in these cases, @jpelgrom and I discussed this recently actually as he worked on the sync status between the server for when sensors get enabled/disabled

@jpelgrom
Copy link
Member

jpelgrom commented Nov 6, 2024

ours are also not removed in these cases

I don't believe there are sensors like these which can completely disappear on Android so not completely comparable. But yes, it disables/enables like other integrations do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants