Improvement Xiaomi smart kettle (I need help!)

  • Hello!
    Recently, I purchased a smart Xiaomi kettle. But to my disappointment, he seemed quite stupid.๐Ÿ˜„ I can not turn it on remotely, I can only change its settings from the application on the smartphone. Therefore, I thought about its automation with the help of MySensors.

    smart Xiaomi kettle

    On the panel of the kettle there are two touch buttons and two LEDs - boiling and heating. I want to connect the MySensors node to them. The activation signal is applied to the buttons, and the work status is received from the LEDs.

    two touch buttons and two LEDs

    Perhaps you have already encountered similar projects in this forum... Please share links to them here.๐Ÿ™Œ

    Perhaps you have a similar sketch in your collection? I will be very grateful if you share it.

    I am sure that such a device will be useful to many participants in this forum, to improve their not very smart devices.๐Ÿ˜‰

  • @vladimir I do not understand the purpose of switch a kittle remotely. If there is no water, what would you do?

    Additionally, I think you'd find very little in internet on your topic. It required hacking into existing Xiaomi electronics. If you want to do that, you need to dismantle the kettle and reverse engineer it.

  • @alexsh1 I do not see problems that do not allow connecting to the control panel of the kettle.
    These images I took on the Internet:

    alt text

    alt text

    I have already done this with a Chinese-made desk lamp. For this, I used a sketch of the relay node. But everything was easier there, I removed the button and connected the output from the Arduino instead. I rarely use a desk lamp, so I allowed myself to sacrifice a button for the sake of experimentation. I usually manage it through Siri.
    On the teapot, I still want to leave the physical buttons, and get feedback about their condition.

  • @vladimir hey, but for safety reasons, how do you counter the fact that if there is no water in it, you just don't burn your house down. I did some quick calculations but the advantages of remotely setting the kettle on versus burning the house down, don't seem that favourable ;).

  • @omemanti It has protection against heating without water. But, I do not plan to launch it when I am away from home. I just want to use it in automation scripts, for example in the morning when the alarm sounds a wake-up call.

  • @vladimir If you do not see a problem, why not dismantling it and connecting a relay to simulate a button press?

    I have automated a coffee machine to switch on/off at a certain time to preheat, but I still fail to understand why would anyone need a smart kettle remote control.

  • @alexsh1 In fact, the purpose of this post is not to understand "why," but to understand "how" to automate the device so that there is feedback from it. At the code level.

  • either purchase a standard cheap kettle, and a wallplug, then you can switch on/off via this. Or else you need to create a device that can emulate a persons capacity touching
    This guy used a floating pin on Arduino, and then set it to GND, maybe worth a try...

  • If anyone is interested in this project, then I hasten to inform you, good news! ๐ŸŽ‰
    Today I came across a device "Venta Connected (WiFi control for Venta LW45 humidifier)" from the user @reinhold
    Here is a link to the device page:
    @reinhold, thank you for this project! ๐Ÿ™Œ

    I tried to adapt the code of this device to fit my needs. Here's what I got:

    #define SKETCH_NAME "XiaomiSmartKettle"
    #define SKETCH_VERSION "1.0"
    #define MY_DEBUG                     // Enable debug prints to serial monitor
    #define MY_RADIO_NRF24               // Enable and select radio type attached
    #define MY_REPEATER_FEATURE          // Enabled repeater feature for this node
    #include <SPI.h>
    #include <MySensors.h> 
    //***** MySensors settings
    #define WAITING_TIME 250
    // Pin Setup:
    // Button & LED Actions (output):
    //   - PIN_BOIL  D3 ... Boil button press
    //   - PIN_WARM   D4 ... Warm button press
    // LED detection (input, pullup):
    //   - LED_BOIL   D5 ... Boil LED 
    //   - LED_WARMPOWER  D6 ... Warm power LED (Warming is on, but the heating is not involved yet)
    //   - LED_WARMACT  D7 ... Warm action LED (Warming is on and the heater is running)
    #define PIN_BOIL 3
    #define PIN_WARM 4
    #define LED_BOIL 5
    #define LED_WARMPOWER 6
    #define LED_WARMACT 7
    #define ID_BOIL 1
    #define ID_WARMPOWER 2
    #define ID_WARMACT 3
    //#define ID_REPEATER 254
    bool boil = false;
    bool warmpower = false;
    bool warmact = false;
    bool prev_boil = false;
    bool prev_warmpower = false;
    bool prev_warmact = false;
    MyMessage msg_boil(ID_BOIL, V_STATUS);
    MyMessage msg_warmpower(ID_WARMPOWER, V_STATUS);
    MyMessage msg_warmact(ID_WARMACT, V_STATUS);
     ***** Implementation
    void setup() {
      // PIN modes
    void presentation() {
      present(ID_BOIL, S_BINARY, "Kettle BOIL", true);
      present(ID_WARMPOWER, S_BINARY, "Kettle WARM POWER", true);
      present(ID_WARMACT, S_BINARY, "Kettle WARM ACTION", true);
      sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
    void loop() {
      bool changed = false;
      if (boil != prev_boil) {
        Serial.println(F("BOIL changed from "));Serial.print(prev_boil); Serial.print(F(" to ")); Serial.println(boil);
        changed = true;
        prev_boil = boil;
      if (warmpower != prev_warmpower) {
        Serial.println(F("WARMPOWER changed from "));Serial.print(prev_warmpower); Serial.print(F(" to ")); Serial.println(warmpower);
        changed = true;
        prev_warmpower = warmpower;
      if (warmact != prev_warmact) {
        Serial.println(F("WARMACT changed from "));Serial.print(prev_warmact); Serial.print(F(" to ")); Serial.println(warmact);
        changed = true;
        prev_warmact = warmact;
    void receive(const MyMessage &message) {
      switch (message.sensor) {
        case ID_BOIL:
            if (message.type == V_STATUS) {
              bool newstate = message.getBool();
              Serial.print(F("Incoming message to set BOIL to: "));
              if (boil != newstate) {
                Serial.println(F("   => Emulating button press to toggle BOIL"));
              } else {
                Serial.println(F("   => No need to change BOIL state"));
            } else {
              Serial.print(F("Incoming message for ID_BOIL, unknown message type "));
        case ID_WARMPOWER:
            if (message.type == V_STATUS) {
              bool newstate = message.getBool();
              Serial.print(F("Incoming message to set WARMPOWER to: "));
              if (warmpower != newstate) {
                Serial.println(F("   => Emulating button press to toggle WARMPOWER"));
              } else {
                Serial.println(F("   => No need to change WARMPOWER state"));
            } else {
              Serial.print(F("Incoming message for ID_WARMPOWER, unknown message type "));
        case ID_WARMACT:
            if (message.type == V_STATUS) {
              bool newstate = message.getBool();
              Serial.print(F("Incoming message to set WARMACT to: "));
              saveState(ID_WARMACT, newstate);
              if (newstate==1) {
              } else {
            } else {
              Serial.print(F("Incoming message for ID_WARMACT, unknown message type "));
            Serial.print(F("Incoming message for sensor "));
            Serial.print(F(", which cannot receive any messages, type="));
    void readKettleState() {
      boil = digitalRead(LED_BOIL) == LOW;
      warmpower = digitalRead(LED_WARMPOWER) == LOW;
      warmact = digitalRead(LED_WARMACT) == LOW;
    void pressButton(int pin) {
      digitalWrite(pin, HIGH);
      digitalWrite(pin, LOW);
    void ledOn(int pin) {
      digitalWrite(pin, HIGH);
    void ledOff(int pin) {
      digitalWrite(pin, LOW);

    I have not yet verified this code on the device, since I do not have all the necessary components. But it compiled without errors, and that makes me happy already!

    I have only the fear that the function of warming the water will not work correctly, since the kettle has two LEDs that display the status:
    LED_WARMPOWER - Warming is on, but the heating is not involved yet
    LED_WARMACT - Warming is on and the heater is running.

    I would be grateful if you could help me fix this. ๐Ÿ™Œ Perhaps you will notice other errors in the code, please tell me about them. ๐Ÿ˜‰

  • @vladimir Hello, are there any kettles to buy, that have on/off function enabled via bluetooth? Xiaomis newer models maybe?

Log in to reply

Suggested Topics