esphome minor additions and HA pool controls

This commit is contained in:
root
2025-06-14 23:17:56 +12:00
parent 5ef9d0df7d
commit 4e0986a73f
7 changed files with 215 additions and 11 deletions

View File

@@ -0,0 +1,95 @@
# packages/poollight_operation.yaml
homeassistant:
customize:
input_boolean.poollight_mode_switch:
icon: mdi:spotlight
input_boolean:
poollight_mode_switch:
name: "Pool Light Operation"
initial: false
timer_light_midnight_pending:
name: "Send TIMER at Midnight"
initial: false
automation:
- alias: "Pool Light → send BOOST when user turns UI switch ON"
trigger:
platform: state
entity_id: input_boolean.poollight_mode_switch
to: "on"
condition:
condition: state
entity_id: switch.esp_poollightpower_power_output
state: "off"
action:
- service: mqtt.publish
data:
topic: "viewroad-commands/poollight-timer/operation"
payload: "BOOST"
- alias: "Pool Light → send OFF & schedule TIMER when user turns UI switch OFF"
trigger:
platform: state
entity_id: input_boolean.poollight_mode_switch
to: "off"
condition:
condition: state
entity_id: switch.esp_poollightpower_power_output
state: "on"
action:
- service: mqtt.publish
data:
topic: "viewroad-commands/poollight-timer/operation"
payload: "OFF"
- service: input_boolean.turn_on
data:
entity_id: input_boolean.timer_light_midnight_pending
- alias: "Pool Light → send TIMER at midnight"
trigger:
platform: time
at: "00:00:00"
condition:
condition: state
entity_id: input_boolean.timer_light_midnight_pending
state: "on"
action:
- service: mqtt.publish
data:
topic: "viewroad-commands/poollight-timer/operation"
payload: "TIMER"
- service: input_boolean.turn_off
data:
entity_id: input_boolean.timer_light_midnight_pending
- alias: "Pool Light → sync UI switch with real output (no MQTT)"
trigger:
platform: state
entity_id: switch.esp_poollightpower_power_output
action:
- choose:
- conditions:
- condition: state
entity_id: switch.esp_poollightpower_power_output
state: "on"
sequence:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.poollight_mode_switch
- service: input_boolean.turn_off
data:
entity_id: input_boolean.timer_light_midnight_pending
- conditions:
- condition: state
entity_id: switch.esp_poollightpower_power_output
state: "off"
sequence:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.poollight_mode_switch
- service: input_boolean.turn_on
data:
entity_id: input_boolean.timer_light_midnight_pending