946 words
5 minutes
Desk, Coffee, Sleep - Simple Automations

I walk into my home office - click - and the desk lights up. Some time later - ping - my phone tells me the coffee machine is ready. And when the workday is done, the desk - click - shuts down on its own.

Magic? Not quite. Just Home Assistant and a few power outlets.

Home Assistant Automations#

I have written about Home Assistant a few times. The part I like most is that it is a gigantic toolbox. Similar to paperless-ngx, it can solve all kinds of problems - no matter how tiny they might seem.

As I mentioned in my post about mail automation, I really do enjoy automating things. Most of the time the upfront work takes longer than the time an automation will ever save. But building it is the fun part.

Here is a small selection of automations I built in Home Assistant and genuinely enjoy having.

NOTE

These are based on WiFi power outlets flashed with Tasmota. I specifically bought ones that also report power usage, because that enables much nicer automations.

Power Outlet Automation#

My desk has two WiFi power outlets:

  • One mainly for my personal computer
  • One for “everything else” (display, speakers, chargers, …)

I also ended up with a Philips Hue dimmer switch from a bundle. In the Hue ecosystem it is meant to control lights (in my case: Hue Play Lightbars as indirect lighting).

But the nice part is that the dimmer switch can be remapped in Home Assistant. The Play Lightbars are Hue, the outlets are not - and Home Assistant happily ties those worlds together.

So one of the four buttons now controls the desk power via MQTT:

  • Short press: turn the desk outlets on (safe default, avoids accidental shutdowns)
  • Long press: turn the desk outlets off
alias: Desk & Computer Off
description: Switch off the Desk and Computer Switch
triggers:
  - device_id: ...
    domain: hue
    type: long_press
    subtype: 1
    unique_id: ...
    trigger: device
conditions: []
actions:
  - type: turn_off
    device_id: ...
    entity_id: ...
    domain: switch
  - type: turn_off
    device_id: ...
    entity_id: ...
    domain: switch
mode: single

Once that worked, it was hard not to add a bit more.

With the Hue bundle I also got a motion sensor. Again: easy to integrate into Home Assistant. I use it for a simple “morning automation”: on workdays, if there is motion between 6:00 and 9:00, the desk turns on.

The best part, though, is using power draw as a signal. My desk standby power is surprisingly high (around 40 W), so I prefer cutting power completely. If the desk outlet stays below a threshold (for example 45 W) for 15 minutes, Home Assistant switches it off automatically.

Desk Switch Auto Off

The end result is exactly what I wanted: I sit down and things wake up. When I am done, I just leave.

Out of curiosity, I calculated a simple “what if” case: what would it cost if this outlet stayed on for a full year without the desk being actively used? At an average standby draw of 40 W, that comes to 0.96 kWh per day, or roughly 350 kWh per year. Assuming an electricity price of 0.30 € per kWh, that is about 105 € per year.

Coffee Machine State#

As mentioned in my post about espresso makers, I love good coffee, but I do not love waiting for an E61 machine to warm up.

The solution (again) was a WiFi power outlet. It publishes its state via MQTT and can also be controlled via MQTT. Whenever the outlet changes to “ON”, Home Assistant starts a timer. When it expires:

  • I get a push notification on my phone (via the Home Assistant app)
  • My pixel clock on the desk shows that the machine is ready

I used to do this with iOS Shortcuts, but Home Assistant made it easier to send the same signal to multiple devices.

Nobody Home (Or Awake) Automation#

Another WiFi power outlet automation.

When I started with Home Assistant (in a rented apartment), I had no built-in smart home stuff. Power outlets were the easiest way to get results quickly - and they are still useful.

In this case I wanted to reduce standby consumption and also deal with one very specific problem: my TV sometimes turned itself on in the middle of the night. It also benefited from a regular reboot anyway. A smart outlet solved both.

The trigger is simple: when both my wife’s phone and my phone leave the WiFi, I treat that as “nobody is home (or awake)”. In that state, the TV definitely does not need power, so Home Assistant turns the outlet off. As soon as either phone appears in the network again, the outlet is automatically switched on again.

I did not apply this rule to the computer or coffee machine. The computer might be left on intentionally (updates, downloads, …), and the coffee machine might be switched on while on the way home.

Final Thoughts#

Home automation is fun when it works.

I am still surprised by how much you can do with Home Assistant - mainly because you can make things fit your exact needs. You are not forced into whatever the vendor thought was a good idea.

Even tiny annoyances like “I have to keep holding a button to switch off power” are worth solving. Not because it is hard, but because it removes friction from daily life and even saves money.

One lesson that matters more than it should: keep a clean naming scheme and structure. Once you add a few devices, it gets confusing fast if names are inconsistent.

That is also why I set up Home Assistant from scratch after moving. My first setup started as a test and slowly turned into “production” without ever getting cleaned up.

For now, these automations work great. And judging by my track record, more will follow.

Enjoyed the post? Have questions or feedback? I'd love to hear from you! Feel free to drop me an email at blog@jerey.at.

Desk, Coffee, Sleep - Simple Automations
https://jerey.at/posts/ha-automations/
Author
Anton A. Jerey
Published at
2026-03-17