Home Assistant Deep Dive: Automating the Hot Tub

2024-12-28

How I used Home Assistant, ESPHome, and probably too many hours to automate hot tub frost protection.

Written by: Sparky

Smart home automation dashboard on a tablet

home-assistant

automation

smart-home

hot-tub

esphome

When you live in Scotland and own a hot tub, winter frost protection isn’t optional - it’s essential. But checking temperatures manually at 2 AM? That’s what computers are for. Here’s how I over-engineered a solution using Home Assistant.

The Problem

The hot tub sits outside (obviously) and needs to maintain minimum temperatures even when not in use. The manufacturer’s solution: check it yourself. My solution: let Home Assistant handle it with the elegance of a Rube Goldberg machine.

The Hardware Stack

The Setup

First, I waterproofed the DS18B20 sensors in heat-shrink tubing and silicone. Over-engineered? Perhaps. But water and electronics have opinions about mixing.

The ESPHome configuration was surprisingly straightforward:

sensor:
  - platform: dallas
    address: 0x1234567890abcdef
    name: "Hot Tub Water Temperature"
    
  - platform: dallas  
    address: 0xfedcba0987654321
    name: "Hot Tub Ambient Temperature"

The Automation Logic

Home Assistant automation triggers when:

  1. Water temp drops below 10°C
  2. OR ambient temp drops below 0°C
  3. AND it’s been below threshold for 5+ minutes (prevents false triggers)

Action: Turn on circulation pump for 30 minutes, then re-evaluate.

The Complications (Naturally)

Week 1: The sensor gave wildly varying readings. Turns out, it was reading the voltage drop from the ESP32’s power supply. Fixed with a proper 5V adapter.

Week 2: Automation triggered constantly because I’d mounted the ambient sensor directly in the hot tub’s steam exhaust. Moved it 2 meters away. Problem solved.

Week 3: Discovered the smart plug didn’t handle the pump’s inductive load well. Replaced with a proper contactor relay. Much better.

The Dashboard

Created a Lovelace dashboard card showing:

Power Consumption Tracking

Bonus feature: integrated my Zappi EV charger API to calculate heating costs. Because if you’re going to over-engineer something, track everything.

Average winter power consumption: ~2.3 kWh/day for frost protection
Cost at current rates: About £0.70/day
Smug satisfaction of automation: Priceless

Lessons Learned

  1. Waterproofing matters - More than you think
  2. Test in summer - Debugging in January at midnight is suboptimal
  3. Always include manual overrides - For when the automation gains sentience
  4. Documentation is future-you’s friend - I spent 30 minutes figuring out my own YAML

Future Improvements

Who am I kidding? That last one’s not happening.

The complete ESPHome and Home Assistant YAML configs are too long for this post, but the source of my overthinking is available for those who want to replicate this particular brand of madness.