diff --git a/a3pool.yaml b/a3pool.yaml new file mode 100644 index 0000000..209a6dc --- /dev/null +++ b/a3pool.yaml @@ -0,0 +1,83 @@ +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" + diff --git a/secrets.yaml.template b/secrets.yaml.template new file mode 100644 index 0000000..037f408 --- /dev/null +++ b/secrets.yaml.template @@ -0,0 +1,10 @@ +# Global +wifi_ssid: "WIFI SSID" +wifi_password: "WIFI PASSWORD" + +# Papa Broker +mqtt_broker_2: # Just put your broker in here... + +# A3Pool +a3poolpasswd: # A3Pool OTA and native API password +a3poolkey: # Native API encryption KEY \ No newline at end of file