Skip to content

MacOS Home Assistant Companion prevents Mac from sleeping until display unlocked #6258

Open

Description

@Morac2

Does the issue also happen in Safari?

Not applicable (native app feature)

The problem

Home Assistant periodically blocks the Mac from sleeping while it does database-background-access. It's supposed to release that block after it finishes, but I have found that frequently when I wake my Mac from sleep and then lock the screen shortly after, that Home Assistant will issue a PreventUserIdleSystemSleep for database-background-access and not release it until I unlock my screen. At which point it releases the assertion. This prevents the Mac from sleeping the entire time the screen is locked. I've seen it keep the lock for over 16 hours.

It doesn't do this all the time, but it is frequent enough that I see it daily. I attached a log from yesterday and today showing Home Assistant preventing preventing sleep and releasing it several times before it prevents sleeping at 2026-11-10 00:11:36 am and holds the assertion until I unlocked the screen at 08:40:14 am at which point it released the assertion.

Basically the bug is that Home Assistant is not releasing the sleep assertion while the display is off which is preventing the Mac from sleeping

Here's the relevant part of the pmset -g log logs:
home-assistant-sleep-log.txt

Which platform has the issue?

macOS

Which device model are you using?

M4 Mac Studio

Which OS version is the device running?

MacOS 27.2.1

What version of the app has the issue?

2026.10.3 (2026.3322)

What was the last working version of the app?

No response

What version of Home Assistant Core are you running?

2026.11.0

Steps to reproduce

  1. Run Home Assistant Companion.
  2. Lock screen.
  3. Unlock Mac some time later.
  4. Run pmset -g log to check if Home Assistant has blocked sleeping.

Look for lines like:

2026-11-10 06:26:36 -0500 Assertions PID 701(runningboardd) Summary PreventUserIdleSystemSleep "app<application.io.robbie.HomeAssistant.136579355.136584940(501)>701-1437-36619:database-background-access(FinishTask)" 06:26:42 id:0x0x100008537 [System: PrevIdle]
2026-11-10 09:05:13 -0500 Assertions PID 701(runningboardd) Released PreventUserIdleSystemSleep "app<application.io.robbie.HomeAssistant.136579355.136584940(501)>701-1437-50388:database-background-access(FinishTask)" 00:09:07 id:0x0x100009715 [System: DeclUser kDisp]

Expected behavior

Home Assistant Companion should release the PreventUserIdleSystemSleep when it finishes the database-background-access task even if the screen is locked.

Did you upload your companion app logs through the form above?

Yes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions