Flashing a Kogan Smart Kettle with Tasmota

Flashing a Kogan Smart Kettle with Tasmota

I bought a wifi-connected kettle and flashed it with a custom firmware.

Kogan Smart Kettle
Just Tasmota it with AND it works - platform: mqtt name: “Kettle Power” state_topic: “stat/Kettle/POWER” command_topic: “cmnd/Kettle/POWER” payload_on: “ON” payload_off: “OFF” optimistic: false qos: 0 now with MY DUM TV remote Pressing the record button can toggle the the kettle - id: IR remote Toggle Kettle alias: IR remote Toggle Kettle trigger: - entity_id: sensor.last_ir platform: state to: ’190A332′ condition: [] action: - data:…

This is a "Tuya" product which uses an ESP32 chip. Tuya provides hardware and software for a lot of white-labelled products, and it's a very open platform with a lot of documentation. This means that a lot of off-the-shelf devices can be flashed to run custom firmwares such as Tasmota and ESPHome.

We used to be able to use a tool called tuya-convert, which would hack devices wirelessly and flash a custom firmware over-the-air (OTA). I tried tuya-convert, but I got this error:

Your device's firmware is too new.
Tuya patched the PSK vulnerability that we use to establish a connection.
You might still be able to flash this device over serial.

So I had to open it up, connect some wires, and flash it via serial. I used the GPIO pins on a Raspberry Pi.

It worked! I flashed the kettle with Tasmota and saw data coming into MQTT.

I set up a flow in Node-RED to monitor and control the temperature setting on the kettle.

Hyper Text Coffee Pot Control Protocol

I was worried that I might accidentally ask the kettle to brew coffee, so I implemented support for the Hyper Text Coffee Pot Control Protocol. I did this by returning the HTTP status: 418 I'm a teapot.

(I guess it's not a teapot, but it's certainly not a coffee machine.)

418 I’m a teapot - HTTP | MDN
The HTTP 418 I’m a teapot client error response code indicates that the server refuses to brew coffee because it is, permanently, a teapot. A combined coffee/tea pot that is temporarily out of coffee should instead return 503. This error is a reference to Hyper Text Coffee Pot Control Protocol defined in April Fools’ jokes in 1998 and 2014.

The kettle now responds to an API request at /bc (which stands for "brew coffee"), and will respond with status 418.

~/code/Tasmota $ curl -v 192.168.1.113/bc
*   Trying 192.168.1.113...
* TCP_NODELAY set
* Connected to 192.168.1.113 (192.168.1.113) port 80 (#0)
> GET /bc HTTP/1.1
> Host: 192.168.1.113
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 418
< Content-Type: text/plain
< Content-Length: 12
< Connection: close
<
* Closing connection 0
I'm a teapot
Respond to /bc (“brew coffee”) endpoint with 418 I’m a teapot · ndbroadbent/Tasmota@bbcf57f
Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at - Respond to /bc (“brew coffee”) endpoint with 418 I’m a teapot · ndbroadbent/Tasmota@bbcf57f

The commit that adds this important functionality

FAQ

  • Q: Why would you want to flash your kettle with a custom firmware?
    • A: The original Tuya app uses a cloud service, and I don't like relying on third-party services. Tasmota is fully local and doesn't make any requests to the public internet. This means that I don't need to worry about hacks, leaked data, or the company going out of business and shutting down the app.
  • Q: Ok but why do you have a smart kettle anyway?
    • A: Honestly, because I thought it would be funny. But my wife does like to have it turn it on automatically when she gets out of bed.