various tidyups
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
# packages/16a_ev_charging_controls.yaml
|
||||
#
|
||||
# VERSION:
|
||||
# V1.3 2026-07-24
|
||||
# - Added startup catch-up to offpeak_end: when HA starts outside the
|
||||
# offpeak window in Normal mode, the relay is turned off immediately.
|
||||
#
|
||||
# V1.2 2026-07-20
|
||||
# - Added structured mode, timing, and restart behavior documentation.
|
||||
#
|
||||
@@ -56,7 +60,8 @@
|
||||
#
|
||||
# OPERATION NOTES:
|
||||
# - Normal offpeak start and end use exact-time triggers.
|
||||
# - There is no startup catch-up if Home Assistant is offline at either time.
|
||||
# - The offpeak_end automation includes a startup trigger: if HA restarts
|
||||
# outside the offpeak window in Normal mode, the relay turns off immediately.
|
||||
#
|
||||
# PACKAGE SETTINGS:
|
||||
# Car display name:
|
||||
@@ -168,12 +173,27 @@ automation:
|
||||
triggers:
|
||||
- trigger: time
|
||||
at: input_datetime.ev_16a_offpeak_end
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.ev_16a_charge_mode
|
||||
state: "Normal (Offpeak)"
|
||||
|
||||
- condition: template
|
||||
value_template: >
|
||||
{% set start = states('input_datetime.ev_16a_offpeak_start') %}
|
||||
{% set end = states('input_datetime.ev_16a_offpeak_end') %}
|
||||
{% set now_time = now().strftime('%H:%M:%S') %}
|
||||
{% if start == end %}
|
||||
{{ false }}
|
||||
{% elif start < end %}
|
||||
{{ not (start <= now_time < end) }}
|
||||
{% else %}
|
||||
{{ not (now_time >= start or now_time < end) }}
|
||||
{% endif %}
|
||||
|
||||
actions:
|
||||
- action: switch.turn_off
|
||||
target:
|
||||
|
||||
Reference in New Issue
Block a user