You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## User Guide: Integrating a Pool Heater with EMHASS for Home Assistant
210
+
211
+
This guide explains how to connect your pool heater to Home Assistant and optimize its energy usage using the EMHASS add-on. Learn to schedule heating during low-cost periods, align operation with solar surplus, and automate temperature control.
212
+
213
+
---
214
+
215
+
### **1. Prerequisites**
216
+
217
+
- **Pool Heater**:
218
+
- Must support on/off control via a relay (e.g., via a smart switch like Shelly, Sonoff, or Tuya).
219
+
- (Optional) Temperature sensor for pool water (e.g., Zigbee/Z-Wave sensor or DIY ESPHome device).
- Integration for controlling the heater (e.g., [Shelly](https://www.home-assistant.io/integrations/shelly/), [localTuya](https://github.com/rospogrigio/localtuya)).
223
+
224
+
---
225
+
226
+
### **2. Home Assistant Integration**
227
+
228
+
#### **A. Connect the Pool Heater**
229
+
230
+
1. **Smart Switch Setup**:
231
+
- Wire the pool heater's power control to a smart relay (e.g., Shelly 1).
232
+
- Integrate the relay with Home Assistant (e.g., via Shelly's official integration or MQTT).
233
+
- Entity example: `switch.pool_heater`.
234
+
2. **Temperature Monitoring**:
235
+
- Add a temperature sensor (e.g., `sensor.pool_temperature`).
236
+
- For DIY solutions, use an ESP32 with a waterproof DS18B20 probe and ESPHome.
237
+
238
+
#### **B. Verify Entities**
239
+
240
+
- Confirm these entities exist in Home Assistant:
241
+
- Heater control: `switch.pool_heater`
242
+
- Power consumption: `sensor.pool_heater_power`(via smart plug or energy monitor).
243
+
- Pool temperature: `sensor.pool_temperature`
244
+
245
+
---
246
+
247
+
### **3. EMHASS Configuration**
248
+
249
+
#### **A. Define Pool Heater as a Deferrable Load**
250
+
251
+
In EMHASS's `config.json` or web UI:
252
+
253
+
```json
254
+
{
255
+
"deferrable_loads": {
256
+
"pool_heater": {
257
+
"entity_id": "switch.pool_heater",
258
+
"max_power": 4000, // Heater power in Watts (e.g., 4kW)
259
+
"def_start_time": "06:00", // Earliest allowed start time
260
+
"def_end_time": "22:00", // Latest allowed end time
261
+
"def_hours": [3, 12] // Min/max daily runtime in hours
262
+
}
263
+
}
264
+
}
265
+
```
266
+
267
+
- Adjust `def_hours` seasonally (e.g., `[^3][^9]` in summer, `[^6]` in winter).
268
+
269
+
270
+
#### **B. EMHASS Sensor Generation**
271
+
272
+
Once configured, EMHASS will generate optimization sensors for your deferrable loads[^3][^4]:
273
+
274
+
- `sensor.p_deferrable0`- Power allocation for first deferrable load
275
+
- `sensor.p_deferrable1`- Power allocation for second deferrable load (pool heater)
276
+
- Values represent power in watts allocated to each load at the current time step
277
+
278
+
---
279
+
280
+
### **4. Pool Heat Pump Automation**
281
+
282
+
This automation controls your pool heat pump based on EMHASS optimization results. It uses the `sensor.p_deferrable1` entity to determine when the heat pump should operate.
283
+
284
+
#### **A. Complete Automation Code**
285
+
286
+
```yaml
287
+
alias: p_deferrable1 automation (Pool Heat Pump)
288
+
description: Pool Heat Pump
289
+
triggers:
290
+
- entity_id:
291
+
- sensor.p_deferrable1
292
+
below: 100
293
+
for:
294
+
hours: 0
295
+
minutes: 0
296
+
seconds: 0
297
+
trigger: numeric_state
298
+
- entity_id:
299
+
- sensor.p_deferrable1
300
+
for:
301
+
hours: 0
302
+
minutes: 5
303
+
seconds: 0
304
+
above: 100
305
+
id: above
306
+
trigger: numeric_state
307
+
enabled: true
308
+
conditions: []
309
+
actions:
310
+
- choose:
311
+
- conditions:
312
+
- condition: trigger
313
+
id:
314
+
- above
315
+
sequence:
316
+
- type: turn_on
317
+
device_id: 03a766ec3275e2c80020c5f5a3d8e603
318
+
entity_id: b7f0627d5ad30682167f4f358843c8d3
319
+
domain: switch
320
+
default:
321
+
- type: turn_off
322
+
device_id: b3b025341171b91f30d49135315dad53
323
+
entity_id: 90ee5ad67de0cda2edac93b903064b13
324
+
domain: switch
325
+
mode: single
326
+
```
327
+
328
+
329
+
#### **B. Automation Step-by-Step Breakdown**
330
+
331
+
**Triggers:**
332
+
333
+
1. **Low Power Trigger**: Activates immediately when `sensor.p_deferrable1` drops below 100 watts
334
+
2. **High Power Trigger**: Activates when `sensor.p_deferrable1` stays above 100 watts for 5 minutes (prevents short cycling)
335
+
336
+
**Actions:**
337
+
338
+
1. **Conditional Choice**: Uses the `choose` action to determine which device to control
339
+
2. **Heat Pump ON**: If triggered by the "above" condition, turns on the Pool Heater Pump
340
+
3. **Socket OFF**: If triggered by any other condition (below 100W), turns off Socket 1 as the default action
341
+
342
+
**Key Features:**
343
+
344
+
- **Hysteresis**: 5-minute delay prevents rapid on/off cycling when power allocation fluctuates around 100W
- [Pool Automation Community Examples](https://community.home-assistant.io/t/using-excess-solar-power-to-heat-swimming-pool/471158)
523
+
524
+
By implementing this EMHASS-based automation, your pool heat pump will automatically operate during optimal times based on energy costs, solar production, and grid conditions, maximizing efficiency while minimizing operating costs.
0 commit comments