How I Finally Knocked Out a 9-Year-Old Home Assistant Wake on LAN Todo

I finally closed a nine-year-old Home Assistant todo by wiring SleepIQ bed presence, HASS.Agent, and Wake on LAN together so my work PC can be ready before I get to the office.

Some ideas sit on the todo list way too long.

Issue #24 in my Home Assistant repo was opened back on January 20, 2017. The goal was simple: wake my work computer automatically so it would be ready when I started my day. Nine years later, Codex helped me knock it out in a few hours.

The final version was not just a plain Wake on LAN button. I already had SleepIQ bed presence working in Home Assistant, and I had HASS.Agent entities available for my office PC. That made it possible to split the workflow into two clean halves:

  • When I get into bed, Home Assistant locks the PC and tells HASS.Agent to sleep the monitors.
  • When I get out of bed on a workday morning, Home Assistant presses the Wake on LAN button for CARLO-HOMEPC.

I kept the change isolated to the existing package for that machine, which lives here on GitHub: config/packages/hass_agent_homepc.yaml.

- alias: "CARLO-HOMEPC - Wake on Workday Morning Bed Exit"
  id: 6d40b8b2-8fa9-4250-84bd-cb1c3fc9e7c9
  mode: single
  trigger:
    - platform: state
      entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
      from: "on"
      to: "off"
      for: "00:02:00"
  condition:
    - condition: state
      entity_id: person.carlo
      state: "home"
    - condition: state
      entity_id: input_boolean.guest_mode
      state: "off"
    - condition: time
      after: "05:00:00"
      before: "09:00:00"
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
  action:
    - service: button.press
      target:
        entity_id: button.carlo_home

That is the nice part of this setup. The automation is practical and boring, which is exactly what I want for something that runs at the start of the day. It only fires on weekday mornings, it checks that I am home, and it respects guest mode.

Codex also helped with the cleanup around the change. It refreshed the package docs, updated the old GitHub issue with the actual implementation plan, opened the branch, submitted the pull request, merged it, and closed the issue.

The funny part is that the first morning after implementation proved the Home Assistant side was correct, but the PC still did not wake from the magic packet. The logs showed that the wake automation had not fired that Sunday because it was workday-gated, and a later manual press of the Wake on LAN button still did not bring the Dell back. So the remaining work is on the workstation itself: BIOS Wake on LAN settings, Intel NIC power settings, and Windows Fast Startup.

Even with that last bit still being tuned, getting this nine-year-old item out of my backlog felt great. The Home Assistant plumbing is now in place, the repo is cleaner, and the next workday test is going to be a lot easier to reason about.

Draft generated with help from Codex

TAGS