esphome: name: esphome-8zone-v1 friendly_name: ESPHome 8-Zone Controller V1 comment: "V1 8-zone roof-space controller pinout with per-zone relay inversion options. Do not use on V2 boards." compile_process_limit: 1 project: name: tekonline.8zone_controller_v1 version: "2026.05.17-v1-relay-invert-options" on_boot: priority: 100 then: - switch.turn_on: switch1 - switch.turn_on: switch2 - switch.turn_on: switch3 - switch.turn_on: switch4 - switch.turn_on: switch5 - switch.turn_on: switch6 - switch.turn_on: switch7 - switch.turn_on: switch8 esp32: board: esp32dev framework: type: arduino logger: api: ota: - platform: esphome web_server: port: 80 wifi: ssid: !secret wifi_ssid password: !secret wifi_password output_power: 20.0 fast_connect: true power_save_mode: none ap: ssid: "TekOnline 8 Zone V1" password: "REPLACE_WITH_YOUR_OWN_PASSWORD" captive_portal: # V1 relay pinout: # Zone 1 -> GPIO27, Zone 2 -> GPIO32, Zone 3 -> GPIO25, Zone 4 -> GPIO33, # Zone 5 -> GPIO26, Zone 6 -> GPIO19, Zone 7 -> GPIO18, Zone 8 -> GPIO17. output: - platform: gpio id: relay1_output pin: GPIO27 - platform: gpio id: relay2_output pin: GPIO32 - platform: gpio id: relay3_output pin: GPIO25 - platform: gpio id: relay4_output pin: GPIO33 - platform: gpio id: relay5_output pin: GPIO26 - platform: gpio id: relay6_output pin: GPIO19 - platform: gpio id: relay7_output pin: GPIO18 - platform: gpio id: relay8_output pin: GPIO17 script: - id: sync_relays mode: restart then: - lambda: |- auto apply_relay = [](bool requested_on, bool inverted, auto &relay_output) { const bool physical_on = inverted ? !requested_on : requested_on; if (physical_on) { relay_output.turn_on(); } else { relay_output.turn_off(); } }; apply_relay(id(switch1).state, id(zone_1_relay_inverted).state, id(relay1_output)); apply_relay(id(switch2).state, id(zone_2_relay_inverted).state, id(relay2_output)); apply_relay(id(switch3).state, id(zone_3_relay_inverted).state, id(relay3_output)); apply_relay(id(switch4).state, id(zone_4_relay_inverted).state, id(relay4_output)); apply_relay(id(switch5).state, id(zone_5_relay_inverted).state, id(relay5_output)); apply_relay(id(switch6).state, id(zone_6_relay_inverted).state, id(relay6_output)); apply_relay(id(switch7).state, id(zone_7_relay_inverted).state, id(relay7_output)); apply_relay(id(switch8).state, id(zone_8_relay_inverted).state, id(relay8_output)); switch: - platform: template name: "Zone 1" id: switch1 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 2" id: switch2 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 3" id: switch3 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 4" id: switch4 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 5" id: switch5 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 6" id: switch6 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 7" id: switch7 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 8" id: switch8 optimistic: true restore_mode: ALWAYS_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 1 Relay Inverted" id: zone_1_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_OFF turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 2 Relay Inverted" id: zone_2_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 3 Relay Inverted" id: zone_3_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 4 Relay Inverted" id: zone_4_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_OFF turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 5 Relay Inverted" id: zone_5_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 6 Relay Inverted" id: zone_6_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 7 Relay Inverted" id: zone_7_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays - platform: template name: "Zone 8 Relay Inverted" id: zone_8_relay_inverted entity_category: config optimistic: true restore_mode: RESTORE_DEFAULT_ON turn_on_action: - script.execute: sync_relays turn_off_action: - script.execute: sync_relays sensor: - platform: internal_temperature name: "Internal Temperature" - platform: wifi_signal name: "8-Zone V1 WiFi Signal" update_interval: 600s - platform: uptime name: "8-Zone V1 Uptime Seconds" update_interval: 60s text_sensor: - platform: version name: "8-Zone V1 ESPHome Version" - platform: wifi_info ip_address: name: "8-Zone V1 IP" bssid: name: "8-Zone V1 BSSID" - platform: uptime name: "8-Zone V1 Uptime"