I always want to enjoy some coffee or tea while working on electronics and since I often work in the early morning, boiling some water is often the first thing I do in the morning.
This is not too much hustle, but I wanted to improve this process and I came up with a way to schedule my kettle to turn on automatically in the morning if it was set to do so. So, before going to bed, I can pour some water into the kettle and "arm" it so it turns on in the morning at a set time. By the time I get down to the kitchen, the water should be boiling and ready for me to start my day.
The kettle is controlled with a relay connected to a Wemos D1 Mini board that is running ESPHome. This is then controlled via Home Assistant where automation checks the state at a specific time and turns off the relay if it is on. I made it that way so the relay is off for most of the time during normal operation, and only turns on when armed, by using the normally closed contacts on it.
WARNING!
This video deals with mains voltage; if you are uncomfortable working with it, please do not attempt to replicate it. By replicating the project, you accept that you understand the risks involved and that you are the only one responsible for any consequences. The project is running on 240V and it is not suited to be done for 110V as the wires handling the load need to be substantially thicker. Additionally, my kettle is rated at 1800W and it is within specs on the relay. Any higher load than that needs to be handled by a better relay!
In the video below, you can see all of the details for the device as well as a full timelapse of me making it.
The code that defines the device in ESPHome is below where we have the relay definition and another push button to define the trigger for arming the device.
switch:
- platform: gpio
id: kettle_relay
name: "Armed"
restore_mode : ALWAYS_OFF
pin:
number: D2
binary_sensor:
- platform: gpio
pin:
number: D1
inverted: true
mode:
input: true
pullup: true
name: "Arm Switch"
filters:
- delayed_on: 20ms
- delayed_off: 20ms
on_press:
then:
- switch.toggle: kettle_relay
Once armed, the trick is to have an automation setup in Home Assistant so it turns off the relay in the morning to return the kettle in normal operation.
alias: Turn on kettle if armed
description: ""
trigger:
- platform: time
at: "05:30:00"
condition:
- condition: device
type: is_on
device_id: 3ba4263115b049fa7db67ee466a9812b
entity_id: defb68a75f6f529904a21538d33b7625
domain: switch
action:
- type: turn_off
device_id: 3ba4263115b049fa7db67ee466a9812b
entity_id: defb68a75f6f529904a21538d33b7625
domain: switch
mode: single
Tools and materials used in the video
- Wemos D1 Mini - https://s.click.aliexpress.com/e/_m0rpDou
- 5V relay Module - https://s.click.aliexpress.com/e/_mKaAw3i
- HLK-PM01 Power Supply - https://s.click.aliexpress.com/e/_om6Dlh6
- Prototyping PCBs - https://www.pcbway.com/project/shareproject/Electrical_box_prototyping_PCB_d2046284.html
- Rework Station - https://s.click.aliexpress.com/e/_okaY5GY
- Helping Hand - https://s.click.aliexpress.com/e/_oDdrH52
- Electrical Box - https://s.click.aliexpress.com/e/_mNDAhfQ
- Push Button - https://s.click.aliexpress.com/e/_EQMAUN7
- Mini PC for Home Assistant - https://s.click.aliexpress.com/e/_okAe1so