From fee919fd085fea5dc3bd419fb21bee613c659575 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 5 Sep 2023 21:48:17 +0100 Subject: [PATCH] Add mains relay switches Move the 1wire power relay to GPIO12 because that doesn't offend the strapping, while the mains relay seems to pull it up? --- pool.yaml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/pool.yaml b/pool.yaml index 8963e4f..07c4677 100644 --- a/pool.yaml +++ b/pool.yaml @@ -1,9 +1,13 @@ # # Olimex ESP32-Gateway. # -# GPIO13: 1Wire sensors for solar in/out temperatures -# GPIO14: 12v relay for bypass valve: high to close (pump via roof) -# GPIO16: 5v relay for 1Wire sensors' power (to reset them) +# GPIO4 (green): mains relay for pool light +# GPIO12 (orange): 5v relay for 1Wire sensors' power (to reset them) +# GPIO13 (yellow): 1Wire sensors for solar in/out temperatures +# GPIO14 (green): 12v relay for bypass valve: high to close (pump via roof) +# GPIO15 (white): mains relay for patio light +# GPIO16 (yellow): mains relay for pool pump +# GPIO32 (blue): mains relay for shed fan esphome: name: pool @@ -172,6 +176,35 @@ mqtt: id(valve_output).turn_on(); else id(valve_output).turn_off(); + break; + + case 515: /* Pool light switch */ + if (nvalue) + id(pool_light).turn_on(); + else + id(pool_light).turn_off(); + break; + + case 516: /* Patio light switch */ + if (nvalue) + id(patio_light).turn_on(); + else + id(patio_light).turn_off(); + break; + + case 517: /* Shed fan switch */ + if (nvalue) + id(shed_fan).turn_on(); + else + id(shed_fan).turn_off(); + break; + + case 518: /* Pool pump switch */ + if (nvalue) + id(pool_pump).turn_on(); + else + id(pool_pump).turn_off(); + break; } - topic: glow/BCDDC2C24DB0/SENSOR/electricitymeter @@ -545,10 +578,38 @@ switch: #### To switch on and off the communication with the BLE device #### id: power_1w name: "Power 1Wire" pin: - number: GPIO16 + number: GPIO12 inverted: true restore_mode: ALWAYS_ON on_turn_on: - lambda: |- id(solar_in_fails) = 0; id(solar_out_fails) = 0; + + - platform: gpio + id: patio_light + name: "Patio Light" + pin: + number: GPIO15 + inverted: true + + - platform: gpio + id: pool_pump + name: "Pool Pump" + pin: + number: GPIO16 + inverted: true + + - platform: gpio + id: pool_light + name: "Pool Light" + pin: + number: GPIO4 + inverted: true + + - platform: gpio + id: shed_fan + name: "Shed Fan" + pin: + number: GPIO32 + inverted: true -- 2.49.0