This project aims to customize and integrate an Air Wick air freshener into a smart home system using the Zigbee protocol. The modification allows remote control and automation of the air freshener via Zigbee2MQTT.
- Air Freshener (Official Website)
- ESP32-H2 Supermini (Buy on AliExpress)
- Li-ion 14500 3.7V Battery
- Two 300kΩ Resistors
- Drill & Drill Bits
- Wires
- Soldering Iron
A detailed guide on disassembling the Air Wick device and making the necessary modifications can be found here.
- Since the device operates in sleep mode, there may be a delay of up to 10 seconds before executing the spray command after it is sent.
- By default, the spray interval is set to 120 minutes. You can change this value in the Exposes tab in zigbee2mqtt. Setting the value to 0 disables automatic spraying.
- The battery status report is sent once per hour.
- The Reset command in the Exposes tab is used to reset the spray counter.
- Holding the BOOT button for approximately 1.5 seconds will reset the device and put it into pairing mode.
This project can be built with the ESP-IDF build system
To compile the firmware, ESP-IDF v5.3.2 is required. Make sure you have the correct version installed before building the project.
Configure:
idf.py set-target esp32h2
Build:
idf.py build
Flash:
idf.py flash
This project is supported via an external converter. To integrate it into Zigbee2MQTT, follow these steps:
cp proj_dir/z2m/air_wick.js zigbee2mqtt_dir/data
vi configuration.yaml
Add the following line to configuration.yaml
:
external_converters:
- air_wick.js
Save the file and restart Zigbee2MQTT to apply changes.
Once the device is paired successfully, make sure to check the Bind tab. The settings should appear as shown in the screenshot.
Additionally, check the Reports tab and ensure that all reports are disabled.
This project is open-source and distributed under the MIT License.