Tonepie Cat Litter

Tonepie Cat Litter Upgrade

Project for ESPHome and Home Assistant
Tonepie Cat Litter project website


The Tonepie cat litter runs on Tuya, which can be upgraded to ESPHome. We decouple the tray from the Tuya cloud service and can program our tray as we see fit

Attention! All materials of this project (firmware, circuit diagrams, etc.) are provided “AS IS”. Anything you do with your equipment is done at your own risk. The author is not responsible for the result and does not guarantee anything. Re-flashing the cat litter box requires intervention, which will automatically void your warranty.

Important! Pour the litter into the switched off tray. After power is applied, the automatic tray performs auto-calibration and resets the weight of the filler to zero, and only after that the tray will correctly determine the weight of the pet. If you pour litter into the tray when it is turned on, the tray will think that there is a pet inside. In this case, turn off the power to the tray and reapply power. For example, connect it to a smart socket, then it will be convenient to restart the tray based on power. This way the tray will start auto-calibration and reset the filler weight to zero.

Tray functions:

  1. Automatic cleaning
  2. Manual cleaning
  3. Ionizer
  4. Child protection
  5. Infrared sensor
  6. Removing filler
  7. Calibration of scales for filler and waste tank
  8. Auto calibration when turned on
  9. Sensors:
    • pet weight
    • duration of visit
    • trash can
    • pet in a tray
    • cleaning
Flashing to ESPHome

The board has a WBR3 chip installed. You can find out more about WBR3 here

Before unsoldering the WBR3 chip, just in case, solder two wires to the RXD and TXD pins and take logs, see if your sensors will work when adding the Tuya MCU component. If the sensors work, you can continue the procedure further.

For reference. Usually, in order to remove logs by connecting to the RXD and TXD contacts, the connection is made in reverse (screenshot below), but to my surprise the connection was direct, i.e. not RXD>TXD and TXD>RXD, but RXD>RXD and TXD>TXD. So check both options


To enable debug mode and output packages to the logs, you need to add the following to the lines. This way you can see the packets for each command when you click on the buttons in the Tuya application or through the control panel of the tray itself

#Enable Tuya MCU component

  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 9600
  stop_bits: 1
  data_bits: 8
  parity: none
    direction: BOTH
    dummy_receiver: false

ESP12-F will be used instead of WBR3. They say that WBR3 can be reflashed, but I have no experience and do not want to erase the firmware in WBR3, since the chip itself may be useful in the future, for example, soldering it back and taking logs. Do it at your own discretion, you can upload the firmware directly to WBR3 or replace it with ESP12-F.

There are two ways to upload firmware to the ESP12-F

  1. Buy a programmer for the ESP8266 module

  1. Connect ESP12-F to USB-TTL

For reference! To upload the firmware, you need to close the GPIO0, GPIO15 and GND contacts before power is applied (before you insert the USB-TTL into the computer’s USB connector), and not after, then the ESP12-F will go into firmware mode

Compile the firmware in ESPHome using the configuration of your choice. View configurations here

  1. Basic configuration has only control and sensors without control logic
  2. The advanced configuration has control logic and statuses, and can also have a cleaning schedule. See comments in the configuration.

I uploaded the firmware to the ESP12-F via NodeMCU Flasher. You can download NodeMCU Flasher here.

After uploading the firmware, solder ESP12-F instead of WBR3 and close the contacts with 10 kOhm resistors. Solder a resistor to pins EN and 3.3v, GPIO15 and GND. Why didn’t I solder a jumper shorting GPIO15 and GND? Having measured the multimeters, I saw a resistance of 326-327 kOhm, and since the ESP12-F chip was already soldered, and there was no free one on hand, it was not possible to check the GPIO15 and GND contacts on the chip and on the tray board. Therefore, I did not take any risks and, in order to avoid a short circuit, I closed GPIO15 and GND with a resistor.


Home Assistant

For the card to work, you need to install components


  • You can get the card code here

Countdown timer code. This is needed for the card to see the remaining operating time of the ionizer

    name: "Cat toilet: Ionizer. Timer"
    duration: "00:30:00"
    icon: mdi:creation

- sensor:
    - name: 'Cat toilet: Ionizer. Remaining Time'
      unique_id: cat toilet ionizer remaining time
      state: >
          {% set f = state_attr('timer.cat_toilet_ionizer_timer', 'finishes_at') %}
          {{ '00:00:00' if f == None else (as_datetime(f) - now()).total_seconds() | timestamp_custom('%H:%M:%S', false) }}
      icon: mdi:timer
3D model

I designed a protective removable side, since I didn’t have one in the kit, and I didn’t want to buy it for crazy money from the manufacturer. As a result, I designed and printed a protective removable side. The protective removable side prevents the filler from getting inside the tank, i.e. when cats bury the filler, the filler without a side gets under the tank. You can buy a removable side from the manufacturer

You can download the model here

Protective removable rim for Tonepie automatic toilet tray

Protective removable side printed on a 3D printer


The device is in promo at the moment (Pepper), and I bought it just because this integration exists (been looking for a self cleaning litterbox for a while). Shipment date 09/01, looking forward to integrate this, thanks!

1 Like

Hi, I was wondering: does this custom ESPHome solution allow us to disable the deodorizer? I only want to activate the ozone deodorizer manually (via the hardware button or HA switch) or via an HA automation, so not automatically after a cleaning cycle. This is mainly because of health risks; therefore I would like to switch it on when there is nobody present in the room.

I thought this ESPEasy config would be ideal for that, but in the code I cannot find any parts that turn on the ozone deodorizer, nor any controls of the motor. Is this routine completely ‘hardwired’ in the electronics? Thanks!

You will not be able to turn off the ionizer completely, since this is embedded in the code of the board itself, and esphome uses datapoints. You can add automation to the code that will turn off the ionizer as soon as it turns on

Super, thank you. I have your code up and running and now just set these values to my desired values as follows:

    priority: 200
      - delay: 10s
      - switch.turn_off: idAutoOdorPurificationSwitch
      - switch.turn_off: idInfraredSensor

A question on some possible improvement:
Would it be possible to do a new tare weight action (when having added new litter) after a button press (e.g. manual cleaning cycle)? So you don’t have to power off the entire machine each time?

Before adding new litter, I turn the tray off completely. I connected the tray to the smart plug and remotely turn the tray off/on. If you add litter while the litter box is on, the litter box will show that your pet is inside. For weight determination to work correctly, you need to turn off the tray, add filler and turn the tray on again.

Table with datapoints

1 Like

Thank you! That makes it quite easy.

@azerty9971 made a nice custom component as add on for the Tuya integration
you can find it here : azerty9971 · GitHub
together with him (I gave input and he most of the coding) we managed to add the cat litter box.

I forked that branche an it does show a lot of sensors and switches. not perfect yet but if you want to try


1 Like

Thank you for the proposed option and your work. I gave you a like :grinning:. I won’t be able to try it, since my cat toilet has been transferred to ESPHome and disconnected from Tuya.

I am totally new and kind of inexperienced. But i thought about switching to HA. I have HB on a Rasperry pi 5 now. so i’ll need to wait until HA is supported anyway. But then. I have the dame litter box. just branded “Petlux”. Do you think it will be the very same thing? and, will a newbe be able to do that project?

I am open to learn what I need. As it seems that a proper smart home without HA is not posssible with a product from stock. tried Hubitat, tried Homebridge… Always something they can’t do…


I think under the hood it is all Tuya. Petlux is no exception as far as I can see.

hey everyone… I hope you guys can help.
my tonepie stopped working yesterday. I opened it up and the motherboard was really hot in this corner. I think one of the chips got broke and caused a short circuit. thankfully did not catch fire.

do you know where can I get replacement parts? I contacted the aliexpress seller and they told me they arent producing this anymore and they dont have spare parts…

any help would be greatly appreciated! thanks

We look at the markings and what is written on the body of the electronic component, then we look for documentation and look for a specific model on the market. Possibly available for sale. If it’s not on sale, then we look for analogues that have similar characteristics.

I tried it but its not visible. Either it was removed or it was not there ever…
do any of you guys have a clue which chip could these be?

or how to replace the board I mean where to get another…

I took apart my cat litter and tried to take a look. I used my phone camera with the flashlight on and turned on macro mode. Perhaps the eight-legged one has varnish on top and therefore the markings are not visible. You could try to remove the top layer of varnish or drop some liquid, but I didn’t do this, since I have a working board. You can try to do this yourself, since you have nothing to lose and your board is not working. As they write on the forums on the topic “Help identify the SO8 DC-DC microcircuit,” they write: “Try to remove the varnish with acetone, the markings may appear.”

I’m guessing these are two identical eight-legged buck converters. One simply has more varnish on it, and the second is more or less readable. But it is not exactly. Used AI image search and found a closely similar one. Perhaps this is some kind of DC-DC step-down converter

JW5015B - JW5015B is 40V Synchronous Step-Down Converter

thanks very much @DivanX10 for the help and that you took your time and did all the work. I will try to find the chip on the web.

Also, I did my own research and tried to contact basically all aliexpress sellers (without any luck) then a couple of alibaba sellers to get a working board. Most of them were unable to help (unwilling)

Until I found this seller: App Control Electric Self Cleaning Automatic Litter Box Smart Cat Toilet With Wifi - Buy Electric Self Cleaning Automatic Litter Box Smart Cat Toilet With Wifi 1 Buyer app Cat Litter Boxes House Self-cleaning Auto Cats Litter Box Self Cleaning Smart Automatic Cat Litter Box new Fashion Design Low Noise App Wifi Touch Control Intelligent Electric Self Cleaning Smart Automatic Cat Litter Box Product on
Apparently they are manufacturer. So I asked them to send me a board and they agreed. It is still in transit for weeks possibly. I’ll get back here and post if this or your solution worked.

Thanks again!

Thanks for your feedback. This will be very helpful. After all, something similar could happen to me. We are waiting and will be grateful for the details, for example, you will be able to find out what kind of eight-legged creature it is.

Finally yesterday the package arrived. I received 3 boards and 3 sets of weight measurement metal pads.
Installed and worked like a charm.
Here you can find the store, Leo Liu was very helpful. Also I think I found the original manufacturer (based on the prices)
I took some images but I am unable to upload them here.
Home this helps.

1 Like