Automation ideas: energy management¶
Si tu tarifa es flat-rate y no tenés solar/EV, esta página es opcional. Si tenés CUALQUIERA de tarifa horaria, solar, batería, o EV: es donde el smart home paga su propia hardware. Patrón general: scheduling de loads heavy según señal externa (precio / generación / batería).
Triggers para que aplique¶
- ✅ Tarifa horaria (peak/off-peak o spot pricing).
- ✅ Solar panels con monitoring (Fronius, SolarEdge, Enphase, etc.).
- ✅ Batería casera (Powerwall, Sonnen, etc.).
- ✅ EV charger smart.
Si nada de esto aplica, salté esta página.
Patterns por categoría¶
Carga de EV inteligente ★★★¶
Use case: EV en garage, cargás de noche. Tarifa horaria = off-peak entre 23-7.
automation:
- alias: "EV smart charge"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_price_per_kwh
below: 0.10 # off-peak threshold
- platform: state
entity_id: binary_sensor.ev_plugged_in
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.ev_battery_level
below: 80
action:
- service: switch.turn_on
entity_id: switch.ev_charger_active
- alias: "EV stop charging at peak"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_price_per_kwh
above: 0.20
action:
- service: switch.turn_off
entity_id: switch.ev_charger_active
Más sofisticado: integration ev_smart_charging (HACS) toma price feed Nord Pool / similar + battery target + departure time + optimiza schedule completo.
Ahorro real: $300-500/año por car en UK con smart tariff vs flat.
Solar surplus diversion ★★★ (si tenés solar)¶
Use case: solar generando excedente que se vende al grid a $0.05/kWh. Mejor "consumir" ese excedente para evitar gastar grid power a $0.25/kWh.
automation:
- alias: "Use solar surplus for water heater"
trigger:
- platform: numeric_state
entity_id: sensor.solar_surplus_watts
above: 1500 # tanque calienta a ~1500W
for: '00:05:00' # sostenido, no spike momentáneo
action:
- service: switch.turn_on
entity_id: switch.water_heater
- alias: "Stop surplus diversion"
trigger:
- platform: numeric_state
entity_id: sensor.solar_surplus_watts
below: 1000
for: '00:03:00'
action:
- service: switch.turn_off
entity_id: switch.water_heater
Cascada de prioridades (cuando hay surplus, qué se prende primero): 1. EV charging (mayor capacity sink). 2. Water heater. 3. Pool pump. 4. HVAC pre-cooling / pre-heating. 5. Battery charging.
Battery cycling inteligente ★★ (si tenés batería)¶
automation:
# Cargar batería con solar exclusivamente, no con grid
- alias: "Battery: solar-only charging"
trigger:
- platform: state
entity_id: sensor.battery_charge_source
to: 'grid'
action:
- service: select.select_option
target: { entity_id: select.battery_mode }
data: { option: 'solar_only' }
# En peak hours: descargar al máximo (alimentar la casa)
- alias: "Battery: discharge during peak"
trigger:
- platform: numeric_state
entity_id: sensor.electricity_price_per_kwh
above: 0.20
action:
- service: select.select_option
target: { entity_id: select.battery_mode }
data: { option: 'discharge_max' }
Smart appliance scheduling ★★¶
Heavy appliances (lavarropas, secadora, dishwasher) se corren cuando hay price bajo o solar surplus.
input_boolean:
laundry_pending: # vos lo prendés cuando ponés ropa
name: "Lavarropas con carga pendiente"
automation:
- alias: "Start laundry when price low"
trigger:
- platform: time_pattern
minutes: '/15'
condition:
- condition: state
entity_id: input_boolean.laundry_pending
state: 'on'
- condition: numeric_state
entity_id: sensor.electricity_price_per_kwh
below: 0.10
- condition: time
after: '22:00:00'
before: '07:00:00' # no a las 6am que despierta a todos
action:
- service: notify.mobile_app_paulo
data:
title: "🧺 Buen momento para lavar"
message: "Precio: ${{ states('sensor.electricity_price_per_kwh') }}/kWh. ¿Iniciar lavarropas?"
data:
actions:
- action: START_LAUNDRY
title: "Iniciar"
Patrón AI suggester, humano decide (variante de ai-as-operator).
HVAC pre-conditioning ★★¶
Use case: en lugar de calefaccionar reactivamente, anticipar el peak y pre-calentar la casa con energía barata.
automation:
- alias: "Pre-heat before peak"
trigger:
- platform: time
at: '06:00:00' # 1h antes del peak típico
condition:
- condition: numeric_state
entity_id: sensor.outside_temp
below: 10
- condition: numeric_state
entity_id: sensor.peak_starts_in_minutes
below: 60
action:
- service: climate.set_temperature
target: { entity_id: climate.thermostat }
data: { temperature: 22 } # boost ahora que es barato
Notificación de high consumption ★★¶
automation:
- alias: "High power consumption alert"
trigger:
- platform: numeric_state
entity_id: sensor.total_power_consumption_w
above: 5000 # threshold dependiente de tu setup
for: '00:05:00' # sostenido
action:
- service: notify.telegram
data:
title: "⚡ Consumo alto sostenido"
message: "{{ states('sensor.total_power_consumption_w') }}W por >5 min. Top devices: {{ ... }}"
Esto evita facturazos sorpresa. Especialmente útil con water heater stuck on, AC con puerta abierta, etc.
Daily / weekly energy digest ★¶
Tier 3 notification (no urgente):
automation:
- alias: "Daily energy summary"
trigger:
- platform: time
at: '21:00:00'
action:
- service: notify.telegram
data:
title: "📊 Resumen energético hoy"
message: >
Consumo: {{ states('sensor.daily_kwh') }} kWh
Generación solar: {{ states('sensor.daily_solar_kwh') }} kWh
Net: {{ states('sensor.daily_kwh') | float - states('sensor.daily_solar_kwh') | float }} kWh
Costo: ${{ states('sensor.daily_cost') }}
VS ayer: {{ ... }}
Bonus: AI Task (Q7) recibe esta data + comparativa vs últimos 7 días → identifica anomalies (lavarropa corrió a las 3 AM sin explicación).
EMHASS — la opción avanzada¶
EMHASS (Energy Management for Home Assistant) es un add-on que usa Linear Programming para optimizar: - Schedule de loads (lavarropas, EV, water heater). - Battery charge/discharge cycles. - Solar surplus diversion.
Input: forecast solar + forecast tarifa + battery state + loads disponibles. Output: schedule óptimo de 24-48h.
Cuándo usarlo: si tu setup ya tiene solar + batería + EV. Es over-engineering si solo tenés tarifa horaria simple.
Plan de implementación gradual¶
| Fase | Tarifa flat | Tarifa horaria | + Solar | + Batería | + EV |
|---|---|---|---|---|---|
| Mes 1 | High consumption alert | + EV smart charge basic | + Surplus → water heater | + Battery solar-only mode | + EV smart charge optimized |
| Mes 3 | — | + Smart appliance schedule | + Cascada de prioridades | + Battery discharge peak | + Departure-time aware |
| Mes 6 | — | + Daily energy digest | + AI Task anomaly detection | + Predictive cycling | + EMHASS integration |
Anti-patterns¶
- ❌ Decisiones aggressivas sin manual override: si la automation apaga la lavadora a mitad de ciclo, vas a tener problemas.
- ❌ AI runtime per minuto para decidir: cost-prohibitivo y latencia mata UX. Usar AI a granularidad horaria, no per-event.
- ❌ Asumir que el price feed siempre disponible: ISP/data feed falla → fallback a schedule fijo conservador.
- ❌ HVAC overshoots por pre-conditioning agresivo: pre-heat a 24°C cuando el cuarto está cómodo a 20° genera waste contrario al objetivo.
Relaciones¶
- Extensión de: automation-patterns-curated (tier A: energy peak avoidance).
- Use case canónico de: q7-llm-runtime-strategy-v1 (HVAC reasoning, anomaly detection en consumption).
- Conecta con: notification-strategy (tier 2 high-consumption alerts).
Citas / evidencia¶
- Smart EV charging: £300-500/año savings — búsqueda 2026.
- EMHASS uso Linear Programming — referenciado.
Abierto / gaps¶
- Tarifa específica del usuario (no documentada) — sin esto, los thresholds son genéricos.
- Inverter / battery brand del usuario — affects integration choices.
- ¿El usuario tiene EV? — no documentado.