more esphome devices and fixes

This commit is contained in:
root
2026-04-03 21:37:58 +13:00
parent f7bfa78835
commit 4806807e75
+26 -20
View File
@@ -1,30 +1,39 @@
#:########################################################################################:# #:########################################################################################:#
# TITLE: MAIN HALLWAY LIGHTSWITCH 1 (BK7231N) # TITLE: MAIN HALLWAY LIGHTSWITCH 1 (BK7231N)
# zorruno.com layout # zorruno.com layout v1.1 2026
#:########################################################################################:# #:########################################################################################:#
# REPO: # REPO:
# # https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-mainhallwaylights1.yaml
#:########################################################################################:# #:########################################################################################:#
# VERSIONS: # VERSIONS:
# V1.1 2026-04-03 Updated yaml to zorruno layout V1.1; corrected KS-811 single naming and operation notes; updated BK7231N single-switch pin mapping
# V1.0 2026-04-03 Initial # V1.0 2026-04-03 Initial
#:########################################################################################:# #:########################################################################################:#
# HARDWARE: # HARDWARE:
# - Zemismart KS-811 Single push button # - Zemismart KS-811 Single push button
# - BK7231N based switch # - BK7231N based switch
# - BK72XX board: generic-bk7231n-qfn32-tuya # - BK72XX board: generic-bk7231n-qfn32-tuya
# - pinout/schematic: # - BK7231N single-switch pin mapping checked against KS-811 BK references
# https://community.home-assistant.io/t/zemismart-ks-811-working-with-esphome/
#:########################################################################################:# #:########################################################################################:#
# OPERATION NOTES: # OPERATION NOTES:
# - Main bathroom switch with 1 output: # - Main hallway switch with 1 output:
# 1) Main Hallway Lights # 1) Main Hallway Lights
# # - A single press of the physical button toggles Relay 1 ON/OFF
# - Status LED uses P22
#:########################################################################################:# #:########################################################################################:#
# MQTT COMMANDS: # MQTT COMMANDS:
# - # - None
#:########################################################################################:# #:########################################################################################:#
# OFFLINE NOTES: # OFFLINE NOTES:
# # - a) Home Assistant offline (network and MQTT online):
# - Device remains on WiFi and MQTT
# - Physical button still toggles relay locally
# - b) MQTT offline (or Home Assistant and MQTT offline):
# - Physical button still toggles relay locally
# - Remote control/state sync is unavailable until MQTT returns
# - c) Entire WiFi/network offline:
# - Physical button still toggles relay locally
# - Accurate time is not needed; SNTP is not used
#:########################################################################################:# #:########################################################################################:#
#:########################################################################################:# #:########################################################################################:#
@@ -35,12 +44,12 @@ substitutions:
# Device Naming # Device Naming
device_name: "esp-mainhallwaylights1" device_name: "esp-mainhallwaylights1"
friendly_name: "Main Hallway Lightswitch (1)" friendly_name: "Main Hallway Lightswitch (1)"
description_comment: "BK7231N - Main Hallway Lightswitch using a Zemismart KS-811 Single Push Button. Main Hallway Lights (1)" description_comment: "BK7231N - Main Hallway Lightswitch using a Zemismart KS-811 Single Push Button. Main Hallway Lights (1) (Layout V1.1)"
device_area: "Main Hallway" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant. device_area: "Main Hallway" # Allows ESP device to be automatically linked to an 'Area' in Home Assistant.
# Project Naming # Project Naming
project_name: "Zemismart Technologies.KS-811 Triple BK7231N" # Project Details project_name: "Zemismart Technologies.KS-811 Single BK7231N" # Project Details
project_version: "v1.0" # Project V denotes release of yaml file, allowing checking of deployed vs latest version project_version: "v1.1" # Project V denotes release of yaml file, allowing checking of deployed vs latest version
# Passwords # Passwords
api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names api_key: !secret esp-api_key # unfortunately you can't use substitutions inside secrets names
@@ -126,10 +135,6 @@ esphome:
project: project:
name: "${project_name}" name: "${project_name}"
version: "${project_version}" version: "${project_version}"
# on_boot:
# priority: 200
# then:
# - switch.turn_on: Relay_3
#:########################################################################################:# #:########################################################################################:#
# BUILD FOR BK CHIPSET: # BUILD FOR BK CHIPSET:
@@ -163,18 +168,19 @@ status_led:
#:########################################################################################:# #:########################################################################################:#
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
id: button_1
internal: true
pin: pin:
number: P17 number: P24 # GPIO24
mode: mode:
input: true input: true
pullup: true pullup: true
inverted: true inverted: true
name: "Button 1: ${switch_1_name}" filters:
- delayed_on: 20ms
on_press: on_press:
- delay: 50ms
- switch.toggle: Relay_1 - switch.toggle: Relay_1
#:########################################################################################:# #:########################################################################################:#
# SWITCH COMPONENT: # SWITCH COMPONENT:
# https://esphome.io/components/switch/ # https://esphome.io/components/switch/
@@ -182,6 +188,6 @@ binary_sensor:
switch: switch:
- platform: gpio - platform: gpio
name: "Relay 1: ${switch_1_name}" name: "Relay 1: ${switch_1_name}"
pin: P14 #GPIO14 pin: P16 # GPIO16
id: Relay_1 id: Relay_1
restore_mode: ${relay_restore_mode} restore_mode: ${relay_restore_mode}