Skip to main content

Gadget Wisdom

Designing a B-Mode: How I’m Building Fail-Safe Smart Home Devices with ESPHome

In a previous post, I discussed migrating to ESPHome for my smart devices. That initial migration was pretty straightforward—flashing firmware, configuring YAML, and getting basic functionality running.

But now I’ve started refining things. ESPHome isn’t just about turning things on and off. It’s about designing smarter devices—devices that don’t just rely on a central hub, but can think for themselves when they need to.

Dawn-Dusk Automation

The first item I built using ESPHome was dawn to dusk lighting control. ESPHome makes this possible with its sun component, which calculates sunrise and sunset time based on provided latitude and longitude.

To make that work, you need a time source. The most popular one is getting it from Home Assistant, but you can also use:

  • An NTP server, for independence from your Home Assistant instance, but still requiring a local or remote time server.
  • RTC Hardware Clocks for full independence

Switches and Manual Overrides

Next, I added a templated switch. These aren’t tied to physical hardware and control logic on the device (e.g. enable/disable the dawn-dusk logic).

This gives me some flexibility. For my style of planning,I want any automations running on device to be something that can be disabled if from Home Assistant, which has more capabilities. Simple logic runs locally, but still is controlled by the larger brain.

Important External States for Smarter On-Device Logic

ESPHome allows you to import the state of external entities into your device. Most commonly, you would sync states from Home Assistant, but there is a more powerful alternative in the packet transport component.

This component lets you import the state of sensors to be shared directly ESPHome device to ESPHome Device without a server in between. Even if a server crashes, the system still works, even if the functionality may be limited.

Designing for Failure: My “B-Mode” Smart Home

Resilence is something I prefer to prioritize. Inspired by Disney theme park ride design, I’ve incorporated what I call “B-Mode”.

In Disney-speak, A-Mode is full, ideal operation. B-Mode is what happens when something breaks—so the show can go on, just in a simplified form.

In my design, B-Mode is:

  • Smart lights that fall back to dawn-dusk mode if Home Assistant is unreachable
  • Ability to enable/disable on-device automations by communicating directly with the device
  • Direct Connections between devices to keep key functions running locally
  • Physical Buttons that Always Work, even if the connection is down

And the key: none of this happens by accident. You have to plan for outages and decide what should keep working in your design. ESPHome gives you the tools.

? Final Thought

Your smart home shouldn’t break just because your server does.

With ESPHome, you can build resilience into every device—whether it’s a light switch, a plug, or a sensor. Start simple. Add layers. Think about what matters when things fail.

That’s what B-Mode is all about.

 

Published on August 29, 2025
Categories:

Leave a Reply

Your email address will not be published. Required fields are marked *

Get New Posts By Email