Skip to content

Commit fce43bb

Browse files
authored
Update pool_heater.md
1 parent 5efa74d commit fce43bb

File tree

1 file changed

+354
-1
lines changed

1 file changed

+354
-1
lines changed

docs/Software_and_control/Appliances/pool_heater/pool_heater.md

Lines changed: 354 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ automation:
118118
1. **Daily Schedule**:
119119
- EMHASS optimizes heater runtime based on tariffs and solar forecasts.
120120
2. **Publish Schedule**:
121-
122121
```yaml
123122
rest_command:
124123
emhass_optimize:
@@ -196,3 +195,357 @@ By integrating your pool heater with EMHASS, you can reduce energy costs, extend
196195

197196
[^10]: https://github.com/siku2/hass-emhass
198197

198+
199+
---
200+
title: Pool Heater
201+
parent: Appliances
202+
layout: minimal
203+
---
204+
205+
# Pool Heater
206+
207+
<img src="https://r2cdn.perplexity.ai/pplx-full-logo-primary-dark%402x.png" class="logo" width="120"/>
208+
209+
## 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).
220+
- **Home Assistant**:
221+
- EMHASS add-on installed ([setup guide](https://emhass.readthedocs.io)).
222+
- 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
345+
- **Single Mode**: Prevents multiple instances running simultaneously
346+
- **Immediate Response**: Turns off devices immediately when power drops below threshold
347+
348+
349+
#### **C. Customizing for Your Setup**
350+
351+
Replace the device and entity IDs with your actual devices:
352+
353+
```yaml
354+
# Replace these with your actual entity IDs
355+
entity_id: switch.pool_heat_pump # Your heat pump switch
356+
entity_id: switch.pool_auxiliary # Your auxiliary device (if any)
357+
```
358+
359+
360+
#### **D. Setting the Power Threshold**
361+
362+
The 100-watt threshold can be adjusted based on your setup:
363+
364+
- **Higher threshold (200-500W)**: More conservative, ensures adequate power before turning on
365+
- **Lower threshold (50-100W)**: More aggressive, utilizes smaller power allocations
366+
- **Consider your heat pump's minimum power requirements**
367+
368+
---
369+
370+
### **5. Advanced Configuration Options**
371+
372+
#### **A. Multiple Device Control**
373+
374+
For complex pool systems with multiple components:
375+
376+
```yaml
377+
actions:
378+
- choose:
379+
- conditions:
380+
- condition: trigger
381+
id: above
382+
- condition: numeric_state
383+
entity_id: sensor.p_deferrable1
384+
above: 500 # Additional power check
385+
sequence:
386+
- service: switch.turn_on
387+
target:
388+
entity_id:
389+
- switch.pool_heat_pump
390+
- switch.pool_circulation_pump
391+
- conditions:
392+
- condition: trigger
393+
id: above
394+
- condition: numeric_state
395+
entity_id: sensor.p_deferrable1
396+
above: 100
397+
below: 500
398+
sequence:
399+
- service: switch.turn_on
400+
target:
401+
entity_id: switch.pool_heat_pump
402+
default:
403+
- service: switch.turn_off
404+
target:
405+
entity_id:
406+
- switch.pool_heat_pump
407+
- switch.pool_circulation_pump
408+
```
409+
410+
411+
#### **B. Temperature-Based Override**
412+
413+
Add temperature conditions to prevent unnecessary heating:
414+
415+
```yaml
416+
conditions:
417+
- condition: numeric_state
418+
entity_id: sensor.pool_temperature
419+
below: 26 # Don't heat if already at target temperature
420+
```
421+
422+
423+
#### **C. Time-Based Restrictions**
424+
425+
Limit operation to specific hours:
426+
427+
```yaml
428+
conditions:
429+
- condition: time
430+
after: "06:00:00"
431+
before: "22:00:00"
432+
```
433+
434+
435+
---
436+
437+
### **6. Monitoring and Troubleshooting**
438+
439+
#### **A. Key Entities to Monitor**
440+
441+
- `sensor.p_deferrable1` - Current power allocation from EMHASS
442+
- `switch.pool_heat_pump` - Heat pump status
443+
- `sensor.pool_heat_pump_power` - Actual power consumption
444+
- `automation.p_deferrable1_automation` - Automation status
445+
446+
447+
#### **B. Common Issues**
448+
449+
**Heat Pump Not Turning On:**
450+
451+
- Check if `sensor.p_deferrable1` is above 100 for the required duration
452+
- Verify EMHASS optimization is running and updating the sensor
453+
- Ensure device IDs and entity IDs are correct
454+
455+
**Frequent On/Off Cycling:**
456+
457+
- Increase the 5-minute delay in the trigger
458+
- Adjust the power threshold to create more hysteresis
459+
- Check EMHASS time step configuration (should be 30+ minutes)[^3]
460+
461+
**EMHASS Sensor Not Updating:**
462+
463+
- Verify EMHASS add-on is running and configured correctly
464+
- Check that the deferrable load is properly defined in EMHASS config
465+
- Ensure optimization is being published to Home Assistant sensors
466+
467+
468+
#### **C. Performance Monitoring**
469+
470+
Track automation performance with template sensors:
471+
472+
```yaml
473+
template:
474+
- sensor:
475+
- name: "Pool Heat Pump Daily Runtime"
476+
state: >
477+
{% set start = now().replace(hour=0, minute=0, second=0, microsecond=0) %}
478+
{{ ((as_timestamp(now()) - as_timestamp(start)) / 3600) | round(1) if is_state('switch.pool_heat_pump', 'on') else 0 }}
479+
unit_of_measurement: "hours"
480+
```
481+
482+
483+
---
484+
485+
### **7. Integration with Other Systems**
486+
487+
#### **A. Weather-Based Adjustments**
488+
489+
Modify power thresholds based on weather conditions:
490+
491+
```yaml
492+
# In automation conditions
493+
- condition: template
494+
value_template: >
495+
{% if states('weather.home') == 'sunny' %}
496+
{{ states('sensor.p_deferrable1') | float > 50 }}
497+
{% else %}
498+
{{ states('sensor.p_deferrable1') | float > 150 }}
499+
{% endif %}
500+
```
501+
502+
503+
#### **B. Pool Pump Dependency**
504+
505+
Ensure the heat pump only runs when the circulation pump is active[^2][^6]:
506+
507+
```yaml
508+
conditions:
509+
- condition: state
510+
entity_id: switch.pool_circulation_pump
511+
state: 'on'
512+
```
513+
514+
515+
---
516+
517+
### **8. Resources**
518+
519+
- [EMHASS Documentation](https://emhass.readthedocs.io)
520+
- [EMHASS GitHub Repository](https://github.com/davidusb-geek/emhass)
521+
- [Home Assistant Automation Documentation](https://www.home-assistant.io/docs/automation/)
522+
- [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.
525+
526+
<div style="text-align: center">⁂</div>
527+
528+
<div style="text-align: center">⁂</div>
529+
530+
[^1]: image.jpg
531+
532+
[^2]: https://community.home-assistant.io/t/using-excess-solar-power-to-heat-swimming-pool/471158
533+
534+
[^3]: https://github.com/davidusb-geek/emhass
535+
536+
[^4]: https://emhass.readthedocs.io/en/stable/intro.html
537+
538+
[^5]: https://www.reddit.com/r/pools/comments/ukkdd9/pool_automation_with_home_assistant/
539+
540+
[^6]: https://community.home-assistant.io/t/running-devices-when-energy-is-cheaper-and-greener/380011?page=2
541+
542+
[^7]: https://community.home-assistant.io/t/poolsync-pool-heat-pump-integration/682888
543+
544+
[^8]: https://www.youtube.com/watch?v=D1jqYmTeVRg
545+
546+
[^9]: https://github.com/haufes/home-assistant-pool
547+
548+
[^10]: https://www.youtube.com/watch?v=fRtfh1v-T6M
549+
550+
[^11]: https://community.home-assistant.io/t/fully-automated-pump-management-for-water-pool/729960
551+

0 commit comments

Comments
 (0)