[{"data":1,"prerenderedAt":570},["ShallowReactive",2],{"post-esphome-vs-custom-esp32-firmware-en":3,"related-posts-esphome-vs-custom-esp32-firmware-en":524,"related-categories-esphome-vs-custom-esp32-firmware-en":553},{"id":4,"title":5,"author":6,"authorImageUrl":7,"authorUrl":8,"body":9,"categorySlug":486,"categoryText":487,"dateModified":488,"datePublished":488,"description":489,"extension":490,"faqs":491,"image":507,"imageAlt":508,"language":509,"meta":510,"navigation":511,"path":512,"seo":513,"sitemap":514,"stem":515,"summary":516,"tags":517,"__hash__":523},"blog\u002Fblog\u002Fesphome-vs-custom-esp32-firmware.md","ESPHome vs Custom Firmware on ESP32: Which to Use","Mauro Brambilla","\u002Fimages\u002Fauthors\u002Fbruma.jpg","\u002Fabout",{"type":10,"value":11,"toc":469},"minimark",[12,25,44,49,59,62,133,142,146,155,160,181,189,193,196,199,206,210,214,229,232,288,291,295,298,323,327,330,336,341,366,372,376,383,387,411,415,434,449,453,456],[13,14,15,16,20,21,24],"p",{},"Use ",[17,18,19],"strong",{},"ESPHome"," when your ESP32 is a sensor, switch or display that Home Assistant will control: you describe it in YAML and ESPHome generates and builds the firmware. Use ",[17,22,23],{},"custom firmware"," (your own C++ on the Arduino framework or ESP-IDF, or MicroPython) when the board must do something no component covers, like serving its own web app or speaking a protocol of your own.",[13,26,27,28,33,34,38,39,43],{},"All three OpenGizmo projects use custom firmware, built with PlatformIO. This post puts both options side by side with the ESPHome documentation (checked in November 2026) and the real code of the ",[29,30,32],"a",{"href":31},"\u002Fprojects\u002Fgizmo-ticker","Gizmo Ticker",", ",[29,35,37],{"href":36},"\u002Fprojects\u002Fgizmo-reolink-switch","Gizmo Reolink Switch"," and ",[29,40,42],{"href":41},"\u002Fprojects\u002Fgizmo-camera","Gizmo Camera",". One thing up front: I did not rebuild these projects in ESPHome, so where I say a feature has no fit, I mean the documentation I read, not an experiment.",[45,46,48],"h2",{"id":47},"what-does-esphome-do-for-you","What does ESPHome do for you?",[13,50,51,52,58],{},"ESPHome is a tool that turns a YAML file into firmware for an ESP32 or similar chip. Its own ",[29,53,57],{"href":54,"rel":55},"https:\u002F\u002Fesphome.io\u002F",[56],"nofollow","home page"," says it lets you build smart home devices without writing code, and that every device works with Home Assistant out of the box, locally. You list components (a temperature sensor on a pin, a relay, a display), and ESPHome compiles and flashes them.",[13,60,61],{},"Four things come included, and they are worth money in time:",[63,64,65,83,95,121],"ul",{},[66,67,68,71,72,76,77,82],"li",{},[17,69,70],{},"A native API"," for Home Assistant. Add ",[73,74,75],"code",{},"api:"," to the config and the device appears under discovered integrations, as the ",[29,78,81],{"href":79,"rel":80},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fapi\u002F",[56],"API component"," page describes. Encryption is optional.",[66,84,85,88,89,94],{},[17,86,87],{},"Over-the-air updates."," The ",[29,90,93],{"href":91,"rel":92},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fota\u002F",[56],"OTA component"," offers the native protocol, an upload through the device's web page, or a pull from a web server, plus a safe mode to recover from a bad build.",[66,96,97,100,101,104,105,110,111,114,115,120],{},[17,98,99],{},"Wi-Fi fallback."," With an ",[73,102,103],{},"ap:"," block the ",[29,106,109],{"href":107,"rel":108},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fwifi\u002F",[56],"Wi-Fi component"," starts a hotspot only when the router can't be reached (the ",[73,112,113],{},"ap_timeout"," default is 90 seconds), and the ",[29,116,119],{"href":117,"rel":118},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fcaptive_portal\u002F",[56],"captive portal"," lets you change the network or upload firmware.",[66,122,123,126,127,132],{},[17,124,125],{},"A component library."," One example from this blog: the ",[29,128,131],{"href":129,"rel":130},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fdisplay\u002Fmax7219digit\u002F",[56],"MAX7219 display component"," supports chained chips, rotation, and scrolling.",[13,134,135,136,141],{},"That last point matters for fairness. Hardware is not why OpenGizmo skips ESPHome: it has a component for the Ticker's MAX7219 chain, and an ",[29,137,140],{"href":138,"rel":139},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fesp32_camera\u002F",[56],"ESP32 camera component"," whose page includes an Ai-Thinker pin example, the board family the Gizmo Camera uses.",[45,143,145],{"id":144},"how-does-esphome-compare-with-arduino-esp-idf-and-micropython","How does ESPHome compare with Arduino, ESP-IDF and MicroPython?",[13,147,148,149,154],{},"ESPHome sits on top of the frameworks, so the real comparison is a stack. The ",[29,150,153],{"href":151,"rel":152},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fesp32\u002F",[56],"ESP32 platform page"," says ESPHome defaults to ESP-IDF, and offers Arduino for the classic ESP32, S2, S3 and C3, integrated as an ESP-IDF component. Custom firmware means choosing one of the others directly.",[156,157],"blog-table",{":headers":158,":rows":159},"[\"Option\",\"You write\",\"Good fit\",\"Main cost\"]","[[\"ESPHome\",\"YAML, with C++ lambdas when needed\",\"Sensors, switches and displays for Home Assistant\",\"Features come from components, and your own app has no place to live\"],[\"Arduino-ESP32\",\"C++ with Arduino libraries\",\"Custom devices with a big library ecosystem\",\"You write and maintain everything above the libraries\"],[\"ESP-IDF\",\"C or C++ on Espressif's framework\",\"Full control of the chip and its drivers\",\"A steeper start and more code per feature\"],[\"MicroPython\",\"Python, run from a REPL\",\"Quick experiments and scripting\",\"A runtime on the chip and fewer ready libraries for exotic parts\"]]",[13,161,162,163,168,169,174,175,180],{},"Some sources for the table: the ",[29,164,167],{"href":165,"rel":166},"https:\u002F\u002Fdocs.espressif.com\u002Fprojects\u002Farduino-esp32\u002Fen\u002Flatest\u002F",[56],"Arduino-ESP32 docs"," say the 3.3.12 core is based on ESP-IDF 5.5, so the two are one family. The ",[29,170,173],{"href":171,"rel":172},"https:\u002F\u002Fdocs.espressif.com\u002Fprojects\u002Fesp-idf\u002Fen\u002Flatest\u002Fesp32\u002Fget-started\u002F",[56],"ESP-IDF guide"," calls it Espressif's framework for IoT applications, built with CMake and Ninja. MicroPython's ",[29,176,179],{"href":177,"rel":178},"https:\u002F\u002Fdocs.micropython.org\u002Fen\u002Flatest\u002Fesp32\u002Fquickref.html",[56],"ESP32 reference"," lists the ESP32, C3, C6, S2 and S3 and a REPL on UART0 at 115200 baud. The \"main cost\" column is my judgment, not a benchmark: I measured nothing here.",[13,182,183,184,188],{},"For the toolchain side of custom firmware, the ",[29,185,187],{"href":186},"\u002Fblog\u002Farduino-ide-vs-platformio-for-esp32","Arduino IDE vs PlatformIO comparison"," has the details. This post is about the layer above: whether to write firmware at all.",[45,190,192],{"id":191},"when-is-esphome-the-right-choice","When is ESPHome the right choice?",[13,194,195],{},"ESPHome is the right choice when the answer to \"who talks to this board?\" is Home Assistant. In that case you get the integration, the updates and the fallback hotspot for free, and a few lines of YAML replace hundreds of lines of C++ that you would then have to maintain.",[13,197,198],{},"It is also the right choice when you want many similar devices, because each is one short file. And it is the better start if you don't want to write C++: that is the stated point of the tool.",[13,200,201],{},[202,203],"img",{"alt":204,"src":205},"Two cards: ESPHome for sensors, relays, displays, with Home Assistant as the UI and YAML instead of C++; custom firmware for an own web app, setup flow and API","\u002Fimages\u002Fblog\u002Fesphome-vs-custom-esp32-firmware-decision.webp",[156,207],{":headers":208,":rows":209},"[\"If your board...\",\"Use\"]","[[\"Is a sensor, relay or display controlled from Home Assistant\",\"ESPHome\"],[\"Should be set up and updated with no code written\",\"ESPHome\"],[\"Needs a protocol or library with no ESPHome component and you are fine writing a lambda\",\"ESPHome with lambdas\"],[\"Must serve its own web app, not a dashboard\",\"Custom firmware\"],[\"Needs a setup flow, an API or a browser flasher you design\",\"Custom firmware\"],[\"Has to run a standard others can call, such as an MCP server\",\"Custom firmware\"]]",[45,211,213],{"id":212},"what-cant-esphome-do","What can't ESPHome do?",[13,215,216,217,222,223,228],{},"ESPHome is not a closed box, and it has escape hatches worth knowing. Lambdas are ",[29,218,221],{"href":219,"rel":220},"https:\u002F\u002Fesphome.io\u002Fautomations\u002Ftemplates\u002F",[56],"C++ inside YAML"," that can read any component by ID, and the ",[29,224,227],{"href":225,"rel":226},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fexternal_components\u002F",[56],"external components"," feature imports community or local code from a Git repository or a folder. ESPHome also warns that it copies lambdas into the generated C++ without validating them.",[13,230,231],{},"The limits show up when the product is the interface, not the device:",[63,233,234,252,263,282],{},[66,235,236,88,239,244,245,38,248,251],{},[17,237,238],{},"The web server is a fixed page.",[29,240,243],{"href":241,"rel":242},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fweb_server\u002F",[56],"web_server component"," has three interface versions, local assets, optional authentication, and a ",[73,246,247],{},"js_include",[73,249,250],{},"css_include"," for add-ons. Its documentation describes no way to host a separate page of your own.",[66,253,254,257,258,262],{},[17,255,256],{},"The captive portal is a fixed page too."," Its ",[29,259,261],{"href":117,"rel":260},[56],"documentation"," offers Wi-Fi settings and a firmware upload, and its only option is the compression of the embedded assets.",[66,264,265,88,268,273,274,277,278,281],{},[17,266,267],{},"HTTP requests have small defaults.",[29,269,272],{"href":270,"rel":271},"https:\u002F\u002Fesphome.io\u002Fcomponents\u002Fhttp_request\u002F",[56],"http_request component"," keeps a response buffer of 1 kB unless you raise it, and verifies HTTPS certificates by default on ESP32, so a device with a self-signed certificate needs a CA file (",[73,275,276],{},"ca_certificate_path",", which the page recommends) or ",[73,279,280],{},"verify_ssl: false",", which the page says reduces security.",[66,283,284,287],{},[17,285,286],{},"The native API talks to a short list of clients."," The API page says only the ESPHome tool, Home Assistant and ioBroker use it. An AI agent or your own script isn't on that list.",[13,289,290],{},"None of these is a bug. They describe a tool that optimizes for devices, not for products.",[45,292,294],{"id":293},"how-do-updates-and-wi-fi-setup-differ","How do updates and Wi-Fi setup differ?",[13,296,297],{},"ESPHome ships both an update path and a fallback Wi-Fi hotspot, and the two approaches differ in who owns the code. With ESPHome, you configure the fallback hotspot and the OTA platform, and the project maintains the implementation. With custom firmware, you pick every piece yourself, which gives you the freedom and the bill.",[13,299,300,301,304,305,308,309,313,314,317,318,322],{},"OpenGizmo is a good example of the bill. The ",[29,302,119],{"href":303},"\u002Fblog\u002Fesp32-captive-portal-not-working-fix"," is code I own: gizmo-common starts an open hotspot, answers every DNS name with its own address and redirects probes to ",[73,306,307],{},"\u002Fap-setup",". The ",[29,310,312],{"href":311},"\u002Fblog\u002Fesp32-wifi-provisioning-methods-compared","Wi-Fi provisioning comparison"," shows what that costs in security. And there is no OTA at all: the three firmwares use the ",[73,315,316],{},"huge_app.csv"," partition table, a single 3 MB app slot, so updates go over USB from the browser, as the ",[29,319,321],{"href":320},"\u002Fblog\u002Fesp32-ota-update-methods-compared","OTA comparison"," explains. ESPHome users get OTA and a safe mode without writing a line.",[45,324,326],{"id":325},"why-do-the-opengizmo-projects-use-custom-firmware","Why do the OpenGizmo projects use custom firmware?",[13,328,329],{},"Four reasons, and each is visible in the repositories. They are reasons for these products, not for every board.",[13,331,332],{},[202,333],{"alt":334,"src":335},"A XIAO board on a breadboard sends Wi-Fi to a phone showing its settings app, with the tags app on the board and no cloud, and a printed enclosure nearby","\u002Fimages\u002Fblog\u002Fesphome-vs-custom-esp32-firmware-illustration.webp",[337,338,340],"h3",{"id":339},"the-web-app-is-the-product","The web app is the product",[13,342,343,344,347,348,351,352,355,356,361,362,365],{},"Each board serves a Nuxt 4 web app. The build is ",[73,345,346],{},"nuxt generate",", then ",[73,349,350],{},"gizmo-embed"," from gizmo-common turns the static files into gzipped C++ arrays under ",[73,353,354],{},"microcontroller\u002Fsrc\u002Fwebui\u002F",", as the ",[29,357,360],{"href":358,"rel":359},"https:\u002F\u002Fgithub.com\u002Fopen-gizmo\u002Fgizmo-ticker\u002Fblob\u002Fmain\u002Fdocs\u002Fembedded-webui.md",[56],"embedded web UI notes"," describe. The firmware serves them from the not-found handler, with hashed files cached for a year. The finished app image is one file of about 1.7 to 1.8 MB (the ",[29,363,364],{"href":320},"OTA post"," lists the sizes). ESPHome's documented web server has no slot for that.",[13,367,368],{},[202,369],{"alt":370,"src":371},"Build chain: the Nuxt webapp folder, gizmo-embed to gzipped C++, a PlatformIO build, then the board serving the UI","\u002Fimages\u002Fblog\u002Fesphome-vs-custom-esp32-firmware-build.webp",[337,373,375],{"id":374},"the-setup-flow-is-designed-not-configured","The setup flow is designed, not configured",[13,377,378,379,382],{},"The setup page is part of the same web app, and gizmo-common limits what the hotspot can reach to four API paths. That is the kind of detail ESPHome's fixed portal can't express. gizmo-common saves the Wi-Fi credentials in the board's NVS storage through the Arduino ",[73,380,381],{},"Preferences"," library. If the product had no web app of its own, the portal is the part I would hand to ESPHome first.",[337,384,386],{"id":385},"the-camera-speaks-mcp","The Camera speaks MCP",[13,388,389,390,394,395,398,399,402,403,410],{},"The Gizmo Camera answers ",[29,391,393],{"href":392},"\u002Fblog\u002Fesp32-mcp-server-claude-code","Model Context Protocol"," requests at ",[73,396,397],{},"\u002Fmcp",", and serves a guide for agents at ",[73,400,401],{},"\u002Fllms.txt",". The protocol code is ",[29,404,407],{"href":405,"rel":406},"https:\u002F\u002Fgithub.com\u002Fopen-gizmo\u002Fgizmo-camera\u002Fblob\u002Fmain\u002Fmicrocontroller\u002Fsrc\u002Fmcp\u002Fmcp_protocol.cpp",[56],[73,408,409],{},"mcp_protocol.cpp",", 509 lines, and it is covered by native tests. It could be packaged as an ESPHome external component, but the protocol code would still have to be written, just inside a different build system.",[337,412,414],{"id":413},"the-reolink-client-has-its-own-rules","The Reolink client has its own rules",[13,416,417,418,422,423,426,427,38,430,433],{},"The ",[29,419,421],{"href":420},"\u002Fblog\u002Fcontrol-reolink-nvr-esp32","Reolink Switch"," logs in for a session token, refreshes it a minute before the NVR expires it, batches commands, and retries on a fresh connection when the NVR drops a kept one. It also calls ",[73,424,425],{},"setInsecure()"," because Reolink NVRs commonly present self-signed certificates, a trade-off I explain in that post. That logic is in ",[73,428,429],{},"reolink.cpp",[73,431,432],{},"reolink_protocol.cpp",", and the second file is tested on a computer.",[13,435,436,437,440,441,444,445,448],{},"Add the build side: each repository pins the platform, libraries and gizmo-common tag in ",[73,438,439],{},"platformio.ini",", and runs ",[73,442,443],{},"pio test -e native"," before every release. The ",[29,446,447],{"href":186},"Arduino IDE vs PlatformIO post"," shows that file.",[45,450,452],{"id":451},"so-which-one-should-you-start-with","So which one should you start with?",[13,454,455],{},"Start with ESPHome if Home Assistant is the front end, and I'd say so even though I don't use it for OpenGizmo: it removes the parts that are boring and easy to get wrong. Move to custom firmware when you catch yourself fighting the tool. For OpenGizmo that would be the app, the flasher and the API that the board owns.",[13,457,458,459,463,464,468],{},"The cost of that choice is yours to carry. I maintain a portal, a flasher, a release workflow and the protocol code, and the boards have no OTA. What I verified: the ESPHome pages linked above, as of November 2026, and the code of the three repositories. What I did not: that ESPHome can't reproduce any one of these projects, ESPHome's flash or RAM use, and its behavior with the XIAO ESP32-S3 on your hardware. Next, read the ",[29,460,462],{"href":461},"\u002Fblog\u002Fwhat-is-opengizmo","OpenGizmo overview"," to see the whole design, or ",[29,465,467],{"href":466},"\u002Fblog\u002Fwhich-esp32-chip-should-you-buy","which ESP32 to buy"," if you haven't chosen the board yet.",{"title":470,"searchDepth":471,"depth":471,"links":472},"",2,[473,474,475,476,477,478,485],{"id":47,"depth":471,"text":48},{"id":144,"depth":471,"text":145},{"id":191,"depth":471,"text":192},{"id":212,"depth":471,"text":213},{"id":293,"depth":471,"text":294},{"id":325,"depth":471,"text":326,"children":479},[480,482,483,484],{"id":339,"depth":481,"text":340},3,{"id":374,"depth":481,"text":375},{"id":385,"depth":481,"text":386},{"id":413,"depth":481,"text":414},{"id":451,"depth":471,"text":452},"comparisons","Comparisons","2026-11-14T00:00:00Z","ESPHome or custom ESP32 firmware? A decision table, what ESPHome can't do, and why OpenGizmo's own web app, portal and MCP server use PlatformIO.","md",[492,495,498,501,504],{"question":493,"answer":494},"Is ESPHome better than writing custom firmware for ESP32?","Neither is better in general. ESPHome is faster when your board is a sensor, switch or display that Home Assistant controls, because you describe it in YAML. Custom firmware wins when the board must serve its own web app, run its own setup flow or speak a protocol ESPHome has no component for.",{"question":496,"answer":497},"Can ESPHome run custom C++ code?","Yes. ESPHome lets you write C++ inside YAML with lambdas, and you can load community or personal components with the external_components option. The limit is that ESPHome copies lambda code into its generated C++ without validating it, so mistakes surface at compile time, in a file you didn't write.",{"question":499,"answer":500},"Does ESPHome need Home Assistant?","No. ESPHome's own FAQ describes running its device builder independently of Home Assistant, and the optional web_server component lets you read a device and upload firmware from a browser. Home Assistant is where ESPHome shines, though: a device with the native API enabled is discovered there automatically, as long as mDNS works on your network.",{"question":502,"answer":503},"Can I put my own web page on an ESPHome device?","Not as a documented feature. ESPHome's web_server component serves a built-in interface, in three versions, and lets you add a CSS or JavaScript file to it. The documentation describes no way to host a separate custom page, so a full app on the board means custom firmware.",{"question":505,"answer":506},"Should I use Arduino, ESP-IDF or MicroPython for custom ESP32 firmware?","Use the Arduino framework if you want the largest library ecosystem and a gentle start, ESP-IDF for Espressif's native framework with full control of the chip, and MicroPython if you prefer to iterate in a REPL. OpenGizmo uses Arduino-ESP32 built with PlatformIO.","\u002Fimages\u002Fblog\u002Fesphome-vs-custom-esp32-firmware.jpg","A thoughtful maker with round glasses stands between a YAML file and a C++ file, with dashed arrows from both pointing up to an ESP32 board.","en",{},true,"\u002Fblog\u002Fesphome-vs-custom-esp32-firmware",{"title":5,"description":489},{"loc":512},"blog\u002Fesphome-vs-custom-esp32-firmware","Use ESPHome when the board is a sensor or switch that Home Assistant will control. Write custom firmware when the board must serve its own web app, setup flow or API, as OpenGizmo's three do.",[518,519,520,521,522],"ESP32","Firmware","Home Automation","PlatformIO","OpenGizmo","CZ5v9Z8QSDBKxCKZdjgAWHKq1XdHK1N_PyLsNBPPjBI",[525,534,541,546],{"title":526,"description":527,"image":528,"categoryText":529,"categorySlug":530,"tags":531,"path":533},"ESP32 Partition Table Explained: Flash Layout and OTA","What the ESP32 partition table is, how the partitions.csv columns work, the Arduino-ESP32 schemes with sizes, flash offsets by chip, and what N16R8 means.","\u002Fimages\u002Fblog\u002Fesp32-partition-table-explained.jpg","Guides","guides",[518,519,532,521,522],"Embedded Systems","\u002Fblog\u002Fesp32-partition-table-explained",{"title":535,"description":536,"image":537,"categoryText":487,"categorySlug":486,"tags":538,"path":311},"ESP32 Wi-Fi Provisioning: Captive Portal, BLE, Improv","Compare ESP32 Wi-Fi provisioning: hard-coded credentials, captive portal, Espressif BLE and SoftAP, Improv and ESP-Touch, on security and phone setup.","\u002Fimages\u002Fblog\u002Fesp32-wifi-provisioning-methods-compared.jpg",[518,539,540,519,522],"Wi-Fi","IoT",{"title":542,"description":543,"image":544,"categoryText":487,"categorySlug":486,"tags":545,"path":320},"ESP32 OTA Updates Compared: Web, GitHub, HTTPS Pull","Compare ESP32 OTA update methods: ArduinoOTA, web upload, HTTPS pull from GitHub Releases and USB, with partition needs, security and rollback.","\u002Fimages\u002Fblog\u002Fesp32-ota-update-methods-compared.jpg",[518,519,540,539,522],{"title":547,"description":548,"image":549,"categoryText":487,"categorySlug":486,"tags":550,"path":186},"Arduino IDE vs PlatformIO for ESP32: Which to Use","Arduino IDE 2 or PlatformIO for ESP32? Compare library pinning, Arduino-ESP32 3.x, debugging and tests, with the real platformio.ini of Gizmo Ticker.","\u002Fimages\u002Fblog\u002Farduino-ide-vs-platformio-for-esp32.png",[518,551,521,552,519],"Arduino IDE","Development Tools",[554,558,564],{"name":529,"slug":530,"path":555,"count":556,"image":557},"\u002Fblog\u002Fcategories\u002Fguides",11,"\u002Fimages\u002Fblog\u002Fcoingecko-api-esp32-rate-limits.jpg",{"name":559,"slug":560,"path":561,"count":562,"image":563},"Builds","builds","\u002Fblog\u002Fcategories\u002Fbuilds",6,"\u002Fimages\u002Fblog\u002F3d-printed-esp32-enclosure-design-guide.jpg",{"name":565,"slug":566,"path":567,"count":568,"image":569},"Troubleshooting","troubleshooting","\u002Fblog\u002Fcategories\u002Ftroubleshooting",5,"\u002Fimages\u002Fblog\u002Fesp32-brownout-detector-was-triggered.jpg",1795018238036]