esphome minor additions and HA pool controls
This commit is contained in:
@@ -5,4 +5,5 @@
|
||||
api:
|
||||
encryption:
|
||||
key: ${local_api_key}
|
||||
reboot_timeout: 0s # disables watchdog reboot on API failure
|
||||
|
||||
|
@@ -20,3 +20,4 @@ mqtt:
|
||||
discovery: False # enable entity discovery (true is default)
|
||||
discover_ip: False # enable device discovery (true is default)
|
||||
id: mqtt_client
|
||||
reboot_timeout: 0s # same for MQTT
|
||||
|
@@ -497,8 +497,18 @@ binary_sensor:
|
||||
# https://esphome.io/components/text_sensor/index.html
|
||||
##########################################################################################
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "Boost Duration"
|
||||
id: boost_duration_time
|
||||
unit_of_measurement: "mins"
|
||||
accuracy_decimals: "0"
|
||||
update_interval: "${update_interval}"
|
||||
lambda: |-
|
||||
return id(boost_duration);
|
||||
|
||||
- platform: template
|
||||
name: "Mins from Midnight"
|
||||
id: mins_from_midnight
|
||||
unit_of_measurement: "mins"
|
||||
accuracy_decimals: "0"
|
||||
update_interval: "${update_interval}"
|
||||
|
@@ -506,11 +506,21 @@ binary_sensor:
|
||||
##########################################################################################
|
||||
sensor:
|
||||
- platform: template
|
||||
name: "Mins from Midnight"
|
||||
name: "Boost Duration"
|
||||
id: boost_duration_time
|
||||
unit_of_measurement: "mins"
|
||||
accuracy_decimals: 0
|
||||
accuracy_decimals: "0"
|
||||
update_interval: "${update_interval}"
|
||||
internal: True # No need to show this in Home Assistanti
|
||||
lambda: |-
|
||||
return id(boost_duration);
|
||||
|
||||
- platform: template
|
||||
name: "Mins from Midnight"
|
||||
id: mins_from_midnight
|
||||
unit_of_measurement: "mins"
|
||||
accuracy_decimals: "0"
|
||||
update_interval: "${update_interval}"
|
||||
internal: True # No need to show this in Home Assistant
|
||||
lambda: |-
|
||||
return id(current_mins);
|
||||
|
||||
|
@@ -1,11 +1,3 @@
|
||||
sensor:
|
||||
- platform: integration
|
||||
unique_id: pool_pump_power_total
|
||||
name: "Pool pump power total"
|
||||
source: sensor.tasmo_athplug_5853_3_poolpump_energy_power
|
||||
unit_prefix: k
|
||||
#round: 2
|
||||
|
||||
input_select:
|
||||
pool_light_colour_select:
|
||||
icon: mdi:swimming-pool
|
||||
|
95
packages/pool_light_boost_switch.yaml
Normal file
95
packages/pool_light_boost_switch.yaml
Normal 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
|
95
packages/pool_pump_boost_switch.yaml
Normal file
95
packages/pool_pump_boost_switch.yaml
Normal file
@@ -0,0 +1,95 @@
|
||||
# packages/poolpump_operation.yaml
|
||||
|
||||
homeassistant:
|
||||
customize:
|
||||
input_boolean.poolpump_mode_switch:
|
||||
icon: mdi:pump
|
||||
|
||||
input_boolean:
|
||||
poolpump_mode_switch:
|
||||
name: "Pool Pump Operation"
|
||||
initial: false
|
||||
|
||||
timer_midnight_pending:
|
||||
name: "Send TIMER at Midnight"
|
||||
initial: false
|
||||
|
||||
automation:
|
||||
- alias: "Pool Pump → send BOOST when user turns UI switch ON"
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.poolpump_mode_switch
|
||||
to: "on"
|
||||
condition:
|
||||
condition: state
|
||||
entity_id: switch.esp_poolpumppower_power_output
|
||||
state: "off"
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "viewroad-commands/poolpump-timer/operation"
|
||||
payload: "BOOST"
|
||||
|
||||
- alias: "Pool Pump → send OFF & schedule TIMER when user turns UI switch OFF"
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.poolpump_mode_switch
|
||||
to: "off"
|
||||
condition:
|
||||
condition: state
|
||||
entity_id: switch.esp_poolpumppower_power_output
|
||||
state: "on"
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "viewroad-commands/poolpump-timer/operation"
|
||||
payload: "OFF"
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id: input_boolean.timer_midnight_pending
|
||||
|
||||
- alias: "Pool Pump → send TIMER at midnight"
|
||||
trigger:
|
||||
platform: time
|
||||
at: "00:00:00"
|
||||
condition:
|
||||
condition: state
|
||||
entity_id: input_boolean.timer_midnight_pending
|
||||
state: "on"
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data:
|
||||
topic: "viewroad-commands/poolpump-timer/operation"
|
||||
payload: "TIMER"
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.timer_midnight_pending
|
||||
|
||||
- alias: "Pool Pump → sync UI switch with real output (no MQTT)"
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: switch.esp_poolpumppower_power_output
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.esp_poolpumppower_power_output
|
||||
state: "on"
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id: input_boolean.poolpump_mode_switch
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.timer_midnight_pending
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.esp_poolpumppower_power_output
|
||||
state: "off"
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.poolpump_mode_switch
|
||||
- service: input_boolean.turn_on
|
||||
data:
|
||||
entity_id: input_boolean.timer_midnight_pending
|
Reference in New Issue
Block a user