rnbrg

Ossi Rönnberg

Giving a Zavepower Energy Optimizer a Second Life with ESPHome and Home Assistant

I recently started working on esphome-zavepower, an open-source ESPHome project that turns the discontinued Zavepower Energy Optimizer / Pool Sweden SmartBox into a local Wi-Fi bridge between a Balboa-based spa and Home Assistant.

Instead of throwing away perfectly capable hardware because its original ecosystem is no longer useful, the idea is to replace the original firmware with ESPHome and make the board completely locally controlled.

The result is a surprisingly capable little Home Assistant interface for a hot tub.

What is the Zavepower board?

The board I have is marked EB00174-B and is built around an ESP32-S3-WROOM-1. It already contains most of the hardware needed for this job: Wi-Fi, USB-C for programming, an RS-485 transceiver for talking to the spa controller, and a status RGB LED.

More importantly, it already sits between the outside world and the Balboa spa bus.

That made it an interesting target for ESPHome.

Rather than designing and installing another ESP32 board, power supply and RS-485 interface, I wanted to see whether the existing hardware could simply be repurposed.

It could.

Reverse-engineering the board

The first part of the project was figuring out how the ESP32 was connected to the rest of the board.

The spa communication goes through an Analog Devices ADM3483 half-duplex RS-485 transceiver. By tracing the board and testing the GPIOs on the actual hardware, I ended up with the following pinout:

FunctionESP32 GPIO
Spa UART RXGPIO18
Spa UART TXGPIO17
RS-485 directionGPIO6
RGB LED redGPIO1
RGB LED greenGPIO2
RGB LED blueGPIO42

GPIO18 and GPIO17 also happen to be connected to the red and green activity LEDs on the board, so they automatically blink with RX and TX traffic. The RGB status LED is separate and can be controlled directly from Home Assistant.

The spa connection itself is a 115200 baud, half-duplex RS-485 bus. ESPHome’s UART support can handle the direction pin, making the hardware a good match for this use case.

Talking to the Balboa spa

I didn’t need to implement the Balboa protocol from scratch.

The actual spa protocol support comes from Brian Feucht’s excellent esphome-balboa-spa external component.

My project provides the Zavepower-specific hardware configuration, GPIO assignments, setup documentation and a useful default set of Home Assistant entities.

Once ESPHome is running and communication with the spa is established, the board can expose things such as:

  • water temperature and thermostat control
  • heating status
  • Ready/Rest heating mode
  • high/low temperature range
  • jets and spa lights
  • circulation pump status
  • filter cycle state and scheduling
  • fault history
  • maintenance reminders
  • spa clock synchronization
  • connection status

All of those appear in Home Assistant as entities belonging to a single ESPHome device.

That opens up considerably more flexibility than simply having the spa available through a dedicated vendor application.

Why Home Assistant integration is interesting

Getting a hot tub into Home Assistant isn’t only about being able to turn the jets on from a dashboard.

Once the spa becomes part of the rest of the home automation system, it can participate in automations.

For example, I’ve added Home Assistant blueprints for synchronizing the spa’s internal clock and for controlling heating based on electricity prices.

The price-based automation can put the spa into aggressive heating when electricity is inexpensive and drop it back into a more economical configuration when electricity becomes expensive.

For a device with a relatively large heater and plenty of thermal inertia, that becomes much more interesting than simple remote control.

You could also build automations around heating state, faults, filter cycles, energy prices, presence, or pretty much anything else Home Assistant knows about.

Installing it as an ESPHome project

I wanted the configuration to behave like a reusable ESPHome project rather than just being a YAML file somebody copies once and forgets.

The repository can therefore be imported as an ESPHome package:

substitutions:  name: zavepower-spapackages:  osro.zavepower-spa: github://osro/esphome-zavepower/zavepower_energy_optimizer.yaml@v1esphome:  name: "${name}"

The floating v1 tag means installations can receive update notifications in the ESPHome dashboard when a new compatible 1.x release is published.

After the initial USB installation, later firmware updates can be installed over Wi-Fi.

The configuration also uses ESPHome API encryption, with the Wi-Fi credentials and device-specific API key kept in ESPHome’s secrets.yaml.

A very important flashing warning

Installing ESPHome permanently overwrites the original Zavepower firmware.

There is currently no factory image or backup available that can be used to restore the board to its original state.

Once reflashed, it will no longer work with the original Zavepower / Pool Sweden cloud service or application.

So this isn’t something I would recommend doing experimentally to a board that you might want to return to its original configuration later.

There is also mains-powered equipment, water and a spa controller involved, so normal electrical safety considerations obviously apply.

Powering the board while developing

One slightly unusual detail is that USB-C does not power the ESP32 side of this board.

The board expects approximately 14 V through its power input, which is then converted down internally.

During development it can either be powered from an external 14 V supply or from the spa harness itself while USB-C is connected for programming and logging.

Do not connect the external 14 V supply and the spa harness power at the same time.

Once installed in the spa, the normal four-pin spa harness provides both power and RS-485 communication.

Hardware I’ve tested

So far I’ve tested the project with my Novitek Luosto S.

That’s the only physical spa I currently have available for testing, so although other Balboa-based spas may work, I can’t claim compatibility with models I haven’t actually tested.

I’d be particularly interested in reports from people with other spas using the same Zavepower / Pool Sweden SmartBox hardware.

Different revisions of the Zavepower board are another possibility. The GPIO mappings in this project were confirmed directly on an EB00174 board, so anyone with a different revision should verify the connections before flashing it.

Where the project is going

The project has already grown beyond the original goal of simply getting packets between the spa and Home Assistant.

It now includes the confirmed board pinout, encrypted ESPHome API communication, thermostat and spa controls, diagnostics, fault information, filter scheduling, update notifications and reusable Home Assistant automation blueprints.

There are still plenty of interesting directions to explore.

I’d like to hear from people running the same SmartBox hardware, particularly on different Balboa-based spas. Testing on additional hardware will make it much easier to understand which parts of the configuration are universal and which are specific to my setup.

If you have one of these discontinued Zavepower / Pool Sweden boxes sitting around, it might still have a useful second life.

The project is called esphome-zavepower. The source, ESPHome configuration, wiring information and installation instructions are available on GitHub:

github.com/osro/esphome-zavepower


This is an unofficial community project and is not affiliated with or endorsed by Zavepower, elysics, Pool Sweden, Balboa, or any spa manufacturer. Flashing third-party firmware is done entirely at your own risk.

Comments

Leave a Reply

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