Replace the software of the Rituals Genie ESP with ESPhome

Hi,

Like the title says, i would like to have local control over the Rituals Genie. And as there is a ESP inside, i would be possible. i’ve searched the forum but i didint find if anyone has done this before.

Did anyone already managed to do this?

You’ll have to tell us how it works, ie what is the esp connected to.

If you end up needing to roll something yourself, looking at the source code for the Home Assistant integration might be a good way to figure out what cloud control features there are to localise.

If you want to progress developing some ESPHome firmware, I’d suggest posting detailed photos of internals.

1 Like

Thanks @nickrout and @Mahko_Mahko.

The device is basicly switching on a fan that runs past a parfume cartrigde.
It also has a rgb led on the front. it uses micro usb for power.
the cloud integration also shows a percentage of the tank of the cartridge and the scent of the cartridge but those are not that relevant i would say.

image

The inside looks like this:



I’m assuming it still works, so with a multimeter set to volts, test the I/O to the ESP chip (back to GND and also Vcc) with each function operating and see what you get. From there you should be able to figure out which pins are outputs and which are inputs and what the functions of the pins are. Then some code can be created.

1 Like

The fan is probably a simple pwm device. The speed is controlled via pwm.

Heaven knows how they tell the contents of the cartridge. Does it have any electrical contacts, like a printer ink cartridge does?

I’d probably see if I can find some signals here or directly on the pins.

image

image

if you have a signal analyser then great. You could also set up another esp with UART debug and see if you can rx any UART messages from the devices tx.

I’m relatively rooky with reverse engineering so not sure on the above though.

What are the markings on this chip ?? It might be doing all the work and have a serial connection to the ESP.
chip

Yes, that is a very Tuya thing to do.

Hi,

I really love how everyone is chipping in! great to see and many thanks @nickrout, @sparkydave, @gaz99, @Mahko_Mahko

This is the first time im doing such a thing, so please bare with me.
Ive done the voltage measurring as @sparkydave suggested according to the scheme of @Mahko_Mahko
image

Side Pin Voltage fan off Voltage fan on Remark
Left 3v3 3,3 3,3
Left EN 3,3 3,3
Left IO14 0 0
Left IO12 0 0
Left IO13 0 0
Left IO15 0 0
Left IO2 3 3
Left IO0 3,3 3,3
Left GND 0 0
Right GND 0 0
Right IO16 3,3 3,3
Right TOUT 3,3 3,3
Right RST 0 3,3
Right IO5 3,3 1,6 Yellow wire of fan has same voltage
Right GND 0 0
Right TXD 3,3 3,3
Right RXD 3,3 3,3
Right IO4 0 2,3 Blue wire of fan has same voltage, and fluctuates when changing “amount of perfume”

So i seems like IO5 and IO4 are the ones we need.
in the cloud integration the “amount of perfume” (translated “hoeveelheid parfum”
in the screen below) can be set and if i change that setting, the voltage of IO4 fluctates accordingly
image

@gaz99 these are the readings on that chip:

@nickrout for the cartridge there are no contacts. but when i peel off the sticker that says “do not remove” :slight_smile: it shows something like an NFC or RF tag:

If anyone could help me in the right direction on how to proceed that would be great!

That sort of makes sense, the only reference to the NXP RC522 chip I can find is a 13.56 MHz Mifare contactless controller. That chip probably reads the tank level and the perfume type wirelessly and decoding that info may be a challenge.

The fan and LED control should be fairly easy to do in ESPHome.

As said, i dont really mind the tank level and perfume type.

I’ve only used ESPhome ready made projects, could someone tell me were to start?

If this device is a Tuya device under the hood (as Nick hinted at), then one way to check is to see if it can be added to Tuya Smart and/or Tuya Smart Life apps.

If it is a Tuya device, then firmware development may get a lot easier, as you can flash it with the Tuya MCU component then just figure out the data points which isn’t too hard.

If the app recognises the device, you can back out at that point and consider how you are going to flash it.

If it’s not Tuya, you can progress other options.

Somehow this one “doesn’t quite feel like a Tuya device” to me, but it’s worth checking.

Just thinking, if it is tuya, it would probably not have an esp32, but one of their beken chips.

If all is wanted is the fan operating, then the ledc component is what you’re going to need ESP32 LEDC Output — ESPHome

1 Like

The picture at the top the OP posted says it is an ESP-WROOM-02 which a quick internet search suggests it is an 8266 device. Should be fairly easy to control a fan and LED. Would be cool to read the RFID though.

You are right, I looked at it too quickly and thought it said esp-wroom-32

But that’s a zero not a three. So Espressif ESP-WROOM-02 — PlatformIO latest documentation

And for pwm ESP8266 Software PWM Output — ESPHome

Thanks all, im going on vacation now, but after i’ll get to experimenting

1 Like

Had a look at a tank here.
The RFID sticker is on the black plastic part of the tank.
No connection to the tank it self.
So i guess it only says the name of the scent.
So i guess they do a timer thing for when they think the tank has dried out.

Very interested in this, nice to have local control :slight_smile: (always :smiley: )
And mine had dropped out of it’s app, and i can’t seem to add it back in.
It gets an ip on my network, but no luck.

So let’s hope we can solve this and get it in ESPhome :smiley:

The pwm part should be easy. But do we want timer things on the esp,or just do it automations in homeassistant? :slight_smile:

IO16 is for the Connect button.
IO3 is for the button at the rear.

Just managed to flash it with ESPhome firmware :smiley:
Just a simple fan on/off and speed control so far.

I used a NodeMCU as a usb serial programmer.
Got some info on that from here: Getting Started - Tasmota

Solderd som pin headers in the holes for that.(see picture)
Connected TX pin from Nodemcu to the TX pin on the board.
Connected RX pin from Nodemcu to the RX pin on the board.
Normaly you go from RX to TX and vice versa.
But when using NodeMCU as serial programmer the website i mentioned said not to do the cross.

I connected GND from NodeMCU to the GND on the pin header on the board.
And i just hold the 3 volt and a ground to IO0 and connected an flashed with ESPhome.

So now it can be controlled with timers from HA.
But at least i want the LED working. So have to figure out what kind of led it is, and how it’s connected to the ESP.

The LED is WS2812 and connected to ESP in IO15

Another fun thing i’m thinking of, wich should be easy.
Add a capacitive touch sensor connected to the base.
So you can just touch the genie, and it starts for some minutes or something :slight_smile:
Make it a real genie :woman_genie: