WokWi is a ESP32 simulator with some additional steps you can upload a esphome Yaml to visual studio to simulate your project(s)
this youtube example was my inspiration to share with you
There are some pro and cons but its better then having non if a simular simulation would be available in esphome for all compnents i think a lot of Q&A would be gone and make stuff easier … anway lets go with this
O and do note this is not meant to intergrate 1:1 with your esphome on HomeAssistant or any other “exsisting” installation currently you will not get to update via that way but that might change.
The install procedure (win/lin/mac compatible)
Note for windows users, windows defender might trip on python.exe and some other executables … if you allow them it should work fine.
From https://www.python.org/ download phyton3 and install
From Installing ESPHome Manually — ESPHome
then in a command prompt run (from esp website)
pip3 install wheel
pip3 install esphome
Then from Download Visual Studio Code - Mac, Linux, Windows visual studio and install
after installing visual studio open the program and install these exstentions
- visual studio exstention wokwi
- visual studio exstention platformIO
3, visual studio exstention esphome
per project
make a directory lets call it “esphome-code”
if you have a running esphome instance copy and paste the contents of secrets.yaml to a file secrets.yaml you should change the contents to something else
then in a
copy the esphome .yaml file you want to simulate or make a new one
in the terminal (in vscode) type command
…
esphome build .yaml
…
again windows defender errors might pop-up, because they find python3.exe and some other executables unsafe to get those ignored add them to the allowed software list.
in order to get things running you need 2 other files
wokwi.toml
…
[wokwi]
version = 1
elf = “.esphome/build//.pioenvs//firmware.elf”
firmware = “.esphome/build//.pioenvs//firmware.bin”
[[net.forward]]
from = “localhost:8180”
to = “target:80”
…
Forward http://localhost:8180 to port 80 on the simulated ESP32
the diagram.json you need to goto New ESP32 Project - Wokwi Simulator → tab diagram.json
build something you want to simulate (getting the assigned pins is vital) and copy the contents to a VScode file named “diagram.json”
with command pallet (ctrl+shift+P (in windows)) you can start “wokwi simulation”
I did not get the network settings correct and also the captive portal does not show yet but at least its a start.