84 lines
1.5 KiB
YAML
84 lines
1.5 KiB
YAML
esphome:
|
|
name: a3pool
|
|
board: nodemcuv2
|
|
platform: ESP8266
|
|
|
|
ota:
|
|
password: !secret a3poolpasswd
|
|
|
|
api:
|
|
password: !secret a3poolpasswd
|
|
encryption:
|
|
key: !secret a3poolkey
|
|
|
|
logger:
|
|
|
|
wifi:
|
|
ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
fast_connect: true
|
|
|
|
mqtt:
|
|
broker: !secret mqtt_broker_2
|
|
client_id: "A3 Pool"
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: 12
|
|
inverted: true
|
|
mode:
|
|
input: true
|
|
pullup: true
|
|
id: pump_state
|
|
|
|
switch:
|
|
- platform: gpio
|
|
pin: 5
|
|
id: relay
|
|
on_turn_on:
|
|
- delay: 500ms
|
|
- switch.turn_off: relay
|
|
- platform: template
|
|
name: "Automate Control"
|
|
optimistic: true
|
|
restore_state: true
|
|
|
|
- platform: template
|
|
optimistic: false
|
|
name: pump
|
|
lambda: |-
|
|
if (id(pump_state).state) {
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
turn_on_action:
|
|
- if:
|
|
condition:
|
|
lambda: 'return id(pump_state).state == false;'
|
|
then:
|
|
- switch.turn_on: relay
|
|
- delay: 500ms
|
|
- switch.turn_off: relay
|
|
turn_off_action:
|
|
- if:
|
|
condition:
|
|
lambda: 'return id(pump_state).state;'
|
|
then:
|
|
- switch.turn_on: relay
|
|
- delay: 500ms
|
|
- switch.turn_off: relay
|
|
|
|
dallas:
|
|
- pin: D4
|
|
update_interval: 10s
|
|
sensor:
|
|
- platform: dallas
|
|
address: 0xd1000007494b3628
|
|
name: "Pool Temperature"
|
|
- platform: dallas
|
|
address: 0x440000073de2e728
|
|
name: "Solar Temperature"
|
|
|