home-assistant/automations/ac_peak_ends.yaml
jm 7a0d75d9db Add TOU winter peak-shaving; parameterize by season (v3)
Pepco MD TOU-P has different on-peak windows by season: summer (Jun-Sep)
14:00-19:00, winter (Oct-May) 06:00-09:00 and 17:00-21:00. Heat is gas, so
winter electric peak logic is cooling-only.

* pre-cool: bounded to summer (Jun-Sep); winter has no pre-cool.
* peak-setback (hold) and peak-ends (return): unified across seasons via a
  season self-select (month -> season; triggers carry id: summer/winter and act
  only when trigger.id == season) plus a params map for setpoints. Summer forces
  cool + 82 / returns 74 daily; winter sets 82 / returns 74 ONLY when already in
  cool mode, so it never disturbs the gas furnace.
* new ac_winter_morning_kill: 06:00 winter work days, if in cool mode set
  hvac_mode off to dodge the 6-9am winter peak. No auto-resume yet (planned).

Decision logic verified as a truth table via the template engine across
summer/winter x cooling x workday before commit. Deployed in place (existing
ids unchanged); new id ac_winter_morning_kill added.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 22:04:16 -04:00

46 lines
1.8 KiB
YAML

# ac_peak_ends — end of the on-peak window, return the house to comfort (both seasons)
#
# id / entity : ac_peak_ends -> automation.ac_peak_ends_return_to_74
# triggers : 19:00 (id: summer) and 21:00 (id: winter), local time
# purpose : Return the AC to 74F after the on-peak window ends.
#
# Self-selecting by season (peak *ends* at 19:00 summer, 21:00 winter). A trigger
# only acts when trigger.id == the current season.
#
# Summer returns to 74 every day (comfort), matching the original behavior.
# Winter is COOLING-ONLY: it only returns to 74 when the thermostat is already in
# `cool`, so it never disturbs the gas furnace.
#
# Setpoints come from the `params` map (shared shape with ac_peak_setback).
#
# v3 (2026-07-09): unified summer+winter, season params map, winter cooling-only.
id: ac_peak_ends
alias: AC - Peak ends, return to 74
description: >-
v3 (2026-07-09). Returns the AC to 74F after the on-peak window: summer 7pm,
winter 9pm. Summer returns daily; winter is cooling-only (never touches gas
heat). Managed in git; see AUTOMATIONS.md.
mode: single
triggers:
- trigger: time
at: "19:00:00"
id: summer
- trigger: time
at: "21:00:00"
id: winter
conditions: []
actions:
- variables:
season: "{{ 'summer' if now().month in [6,7,8,9] else 'winter' }}"
cooling: "{{ is_state('climate.t6_pro_z_wave_programmable_thermostat_with_smartstart','cool') }}"
params: "{{ {'summer': {'hold': 82, 'ret': 74}, 'winter': {'hold': 82, 'ret': 74}} }}"
applies: "{{ trigger.id == season }}"
- if:
- condition: template
value_template: "{{ applies and (season == 'summer' or cooling) }}"
then:
- action: climate.set_temperature
target:
entity_id: climate.t6_pro_z_wave_programmable_thermostat_with_smartstart
data:
temperature: "{{ params[season]['ret'] }}"