Can’t get HA running on Mojave

After struggling to get Python updated (as per recent requirements) on my Pi 3b+, I realized that I had other tasks that could be managed by a more powerful machine and bought a Mac mini (time machine, media & Spotify servers, NAS, and so on). On Mojave fresh out of the box, I enabled SSH and VNC, installed Homebrew, brewed Python 3.7.4, and followed the official guide to install on Mac OS, which is dead simple: create a VENV and install. I did NOT create a homeassistant user in the OS because: 1) it wasn’t in the instructions and 2) I never understood the necessity for that anyway. I have these issues:

  • if I run the autostart script as per I receive the error below, and it doesn’t start up. Deleting the plist file and very liberal permissions to that file path changed nothing.
Home Assistant has been installed.         Open it here: http://localhost:8123
/Users/fmon/Library/LaunchAgents/org.homeassistant.plist: Operation not permitted
  • If I run HA in a shell, without changing anything in the stock config folder, the initial onboarding screen will come up in a browser. However, copying over my config folder from the pi breaks startup, and I can’t find a log file to troubleshoot either in the config folder nor in ~/library/logs (there’s one there, but it’s 3 days old).

Thanks in advance for any help here.

Slight update, though this might help someone. Apparently Apple introduced extended privacy controls such that terminal (or your emulator- Termius in my case) need to be allowed to have “full disk access”. This has to be set in settings -> security & privacy -> full disk access (on the left side). Having done this, I now get new error as below. Of note, before adding “full disk access”, I tried sudo’ing the script and got the same error.

Home Assistant has been installed.         Open it here: http://localhost:8123
/Users/fmon/Library/LaunchAgents/org.homeassistant.plist: Path had bad ownership/permissions

A look at the permissions for this file shows the @ sign after all the rwx’s- something about extended security attributes on Mojave. Does anyone know what to do here??

I got it running and am answering myself in case someone comes along. The following isn’t in the HA documentation.

First, understand how to use launchctl, which is the mac version of systemctl. Nice synopsis here:

Running the HASS autostart script referred to in my first post creates a file at the path below; the command to start HA will be:

sudo launchctl load /Users/yourusername/Library/LaunchAgents/org.homeassistant.plist

substitute unload to stop. Also, having that plist in your launch agents will automatically start HA when you log in; it runs as root. Modify the references in the plist with nano to set your output file location. Note that the file names the log homeassistant.log instead of home-assistant.log, so until I fixed that I had two log file being created.

The config files wind up not where you expect at all… the path is /var/root/.homeassistant. You will have to give yourself permission to view that path’s contents.

Now on to fixing all the things that were broken when I put the pi config files in a mac…