2 m

A coffeemachine, a watercooker and a Amazon Echo Speaker on a countertop.I love coffee! Especially when I have to wake up early. So, I’m using a smart plug to turn on this magical device when I dismiss my alarm. However, I’m not getting up early every day, so it would be a waste of coffee to turn on the machine every morning. Luckily, I have a solution for that. I made a simple switch which turns on the coffee machine when I wake up.

The process is really simple. I created one automation which turns on the coffee when my night mode is disabled. After turning on the switch of the coffee machine, this automation will turn itself off. That way, I don’t have to remember to turn off the switch by myself. That automation looks as follows:

  alias: Coffee In The Morning
  description:
  trigger:
  - entity_id: switch.night_mode
    for: 00:09:00
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data: {}
    entity_id: switch.coffeemachine
    service: switch.turn_on
  - data: {}
    entity_id: switch.coffee_in_the_morning
    service: switch.turn_off
  mode: single

Second, I created a switch to toggle this automation on and off. A few lines in my configuration file are taking care of that:

      coffee_in_the_morning:
        friendly_name: "Coffee in the morning"
        value_template: "{{ is_state('automation.coffee_in_the_morning', 'on') }}"
        turn_on:
          service: automation.turn_on
          data:
            entity_id: automation.coffee_in_the_morning
        turn_off:
          service: automation.turn_off
          data:
            entity_id: automation.coffee_in_the_morning

After restarting Home Assistant, I got one beautiful switch which turns on the coffee machine when I wake up. The great thing about this method is, that it turns itself off after it turned on the coffee machine. Now I can turn on the switch when I prepare the coffee machine for the following day, without thinking about the day after tomorrow.

If you drink a lot more coffee than I do, you can always change the automation to leave it on and create an extra one to turn it back on after you turned it off.