Smart Automation Success: Automating My Kettle with Xiaomi Switch

I wanted to share my recent success in automating my kettle using Home Assistant and a Xiaomi Zigbee wall switch. It’s been a fun project that has saved me so much time in the morning!

The Setup:
I installed a Xiaomi Zigbee wall switch to control my kettle. The idea was simple: press the switch to turn the kettle on, and have it automatically turn off once the water is boiled. I set up an automation in Home Assistant that turns the switch off after 2 minutes and sends a notification to my phone.

The Challenge:
Initially, I ran into an issue where the load_power attribute wasn’t updating in real time in Home Assistant. The Mi Home app showed real-time updates, but HA was delayed by about 4 minutes. This meant my automation wasn’t as reliable as I wanted it to be.

The Solution:
After some research and tweaking, I realized that using the built-in delay in the automation was sufficient for my needs. I also created a template sensor to track the current power usage, which helps me monitor the kettle’s status without additional hardware.

Here’s a quick look at my setup:
yaml

  • action:
    • delay: 00:02:00
    • data:
      entity_id: switch.plug_158d0001xxxxxxx
      service: switch.turn_off
    • data:
      message: Your kettle is boiled and ready to go.
      title: Kettle
      service: notify.ios_josephs_iphone
      alias: Kettle Off after 2 minutes
      condition:
      id: ‘1518998764824’
      trigger:
    • entity_id: switch.plug_158d0001xxxxxx
      from: ‘off’
      platform: state
      to: ‘on’

And the sensor setup:
yaml

  • platform: template
    sensors:
    kettle_current_power:
    friendly_name: ‘Kettle Current Power’
    value_template: ‘{{float(states.switch.plug_158d0001xxxxxx.attributes.load_power)}}’
    unit_of_measurement: W

The Results:
This setup has been a game-changer for me. I no longer have to guess whether the water is boiled—it just turns off automatically and sends me a notification. It’s small changes like this that really make smart home tech worth it!

Tips for Others:

  • If you’re dealing with delays in attribute updates, consider using built-in delays in your automations instead of relying on real-time data.
  • Template sensors are incredibly useful for creating custom monitoring solutions.
  • Don’t be afraid to experiment with different automation timings—what works for one device might not work for another.

I’d love to hear how others are automating their daily routines—feel free to share your setups in the comments! :rocket: