To use this ESPHome device simulator you will need the install the following:
pip3 install wheel
pip3 install esphome
pip3 install pillow==10.2.0
- On Windows, also:
pip3 install python-magic-bin==0.4.14
- Open a console and navigate to the repo.
- Change directory to the device directory you want to simulate for example
cd esp32
- Run
esphome compile test-esp32-device.yaml
and wait for the download and compiling to finish. - In VSCode open the command palette (CTRL+SHIFT+P) and search for
Wokwi: Start Simulator
- Modify the
test-device.yaml
to test your own code.
You can customize your ESP32 device by adding buttons, sensors, LEDs etc
- Open a new ESP32 project on Wokwi https://wokwi.com/projects/new/esp32
- In the simulation side click the "+" and select the parts you want to add. Yes you can add more then one !!
- Wire the part to the correct GPIO pins on the ESP32 board.
- Go to the
diagram.json
tab and copy the content of the file. - Paste the content into the local
diagram.json
file. - Modify the
test-device.yaml
to work with the new components i've added. - Recompile the ESPHome device by running
esphome compile test-device.yaml
. - Run the Simulator.
- PROFIT !!
Huge thanks to Wokwi for making this project possible!!