How does the mac app keep autostarting?

The Home Assistant app in macOS keeps launching itself every 1-2 hours, and I can’t find how it does that so I can stop it.

There is no process in Activity Monitor named anything related to home assistant. There is nothing in the login items. And I have used the app KnockKnock to check all the places where a process could hook itself to be restarted (launchd daemons, cron jobs, etc). I couldn’t find anything! … and yet Home Assistant keeps starting up.

I could probably just delete the app - but I want to understand how is this possible. If this happened with malware it would be a very bad situation, right?

For more context:
This is macOS 13.4 on an Apple Silicon MacbookPro.
I installed the mac app with brew, with

brew install home-assistant

… which just installed the 2023.4,2023.460 release from GitHub.
I used the app for some days and then today I restarted my mac.
I did not start the Home Assistant app, and yet it started by itself after a while - not on login.
I keep quitting it, but after 1-2 hours it just launches itself again.

Any idea?

1 Like

recently I have found that it auto-starts whenever I restart HA itself - quite annoying - but it doesn’t restart otherwise.

Huh. It just started by itself for me as well…

I’m running the MAS version 2023.4 (2023.460) on a 2018 (Intel) Mac mini running macOS 13.4 (Ventura).

FWIW, KnockKnock is looking possibly outdated, so I have also tried sfltool dumpbtm, which seems to be a more recent way to check background runnable stuff in macOS.
It still doesn’t show anything that I could trace back to Home Assistant.

I have narrowed this down to Home Assistant.app being enabled in System Settings / Privacy&Security / Focus. I guess it gets called by the OS, even when it is disabled or not present in the Login/background items pane. Looks to me like a malware problem waiting to happen.

@jchh , maybe you can check whether the app is there in your settings and disabling it stops the autostarting?

Disabling focus made no difference - HA still opens on restart.

HA only has access to the focus status for the sensor binary_sensor.<iPhone name>_focus (which you can disable in the app itself if you want).

But mine doesn’t open on restart, probably because I disabled it both in the Home Assistant prefs and in the OS’s settings’ login items’ “allow in background”.

In my case, the app starts randomly, every few hours - as long as it is enabled in the Privacy/Focus permissions. That’s why I asked if that’s your case.

It is certainly using a start mechanism that is not macOS ‘compliant’. It is a real pain, it drains my laptop battery significantly.

Thank you, I’ve tried disabling this and will wait and see if it helps. There is also now a tracking bug for this autostart issue: Home Assistant macOS randomly opens on its own · Issue #2394 · home-assistant/iOS · GitHub

1 Like