From f26ddc0bb92b247d54f1ebaf3d92067110e2426f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Kl=C3=BCter?= Date: Mon, 12 Jan 2026 20:08:59 +0100 Subject: [PATCH] Update --- .../config/common/minir4-local-schalter.yaml | 108 ++++++++++++++++++ ...{minir4-8.yaml => schalter-gaeste-wc.yaml} | 8 +- blueprints/sonoff/zbminir2-detached.yaml | 47 ++++++++ 3 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 ESPHome/config/common/minir4-local-schalter.yaml rename ESPHome/config/{minir4-8.yaml => schalter-gaeste-wc.yaml} (52%) create mode 100644 blueprints/sonoff/zbminir2-detached.yaml diff --git a/ESPHome/config/common/minir4-local-schalter.yaml b/ESPHome/config/common/minir4-local-schalter.yaml new file mode 100644 index 0000000..5d97564 --- /dev/null +++ b/ESPHome/config/common/minir4-local-schalter.yaml @@ -0,0 +1,108 @@ +esphome: + name: ${device_name} + friendly_name: ${friendly_name} + comment: "Sonoff MiniR4 Extreme" + +esp32: + board: esp32dev + framework: + type: esp-idf +# Enable logging +logger: + +# Enable Home Assistant API +api: + encryption: + key: "SHWdMNPDac9CCz0UTRCwvPrc20nzCa/xjDanSw8LVWc=" + +# Over-the-air Update +ota: + - platform: esphome + id: myota + password: ${ota_password} + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "${device_name}" + password: ${fallback_wifi_pwd} + +captive_portal: + +web_server: + port: 80 + +sensor: + - platform: wifi_signal + name: ${friendly_name} Wifi Signal Strength + update_interval: 90s + entity_category: "diagnostic" + + - platform: uptime + name: ${friendly_name} Uptime + update_interval: 300s + entity_category: "diagnostic" + +text_sensor: + - platform: wifi_info + ssid: + name: Connected SSID + ip_address: + name: IP Address + dns_address: + name: DNS Address + +status_led: + pin: + number: GPIO19 + inverted: true + +####################################### +# Device specific Config Begins Below # +####################################### + +switch: + - platform: restart + name: ${friendly_name} Restart + +output: + # Physical relay on GPIO + - platform: gpio + pin: GPIO26 + id: relay_1 + +light: + - platform: binary + id: light_1 + name: ${friendly_name} + icon: mdi:ceiling-light-multiple-outline + restore_mode: restore_default_off + output: relay_1 + +binary_sensor: + - platform: gpio + pin: GPIO00 + id: button + filters: + - invert: + - delayed_off: 50ms + on_press: + - light.toggle: + id: light_1 + + - platform: gpio + name: s1 + pin: GPIO27 + id: s1 + filters: + - invert: + - delayed_off: 50ms + on_state: + - light.toggle: + id: light_1 + +bluetooth_proxy: + active: ${bt_proxy} diff --git a/ESPHome/config/minir4-8.yaml b/ESPHome/config/schalter-gaeste-wc.yaml similarity index 52% rename from ESPHome/config/minir4-8.yaml rename to ESPHome/config/schalter-gaeste-wc.yaml index 421393a..216f94a 100644 --- a/ESPHome/config/minir4-8.yaml +++ b/ESPHome/config/schalter-gaeste-wc.yaml @@ -1,10 +1,10 @@ substitutions: - device_name: mini-r4-8 - friendly_name: mini-r4-8 + device_name: schalter-gaeste-wc + friendly_name: Schalter Gäste WC ota_password: !secret ota_password fallback_wifi_pwd: !secret fallback_wifi_pwd light_entity: light.deckenlampe_treppenhaus - bt_proxy: "true" + bt_proxy: false packages: - minir4: !include common/minir4.yaml + minir4: !include common/minir4-local-schalter.yaml diff --git a/blueprints/sonoff/zbminir2-detached.yaml b/blueprints/sonoff/zbminir2-detached.yaml new file mode 100644 index 0000000..1631888 --- /dev/null +++ b/blueprints/sonoff/zbminir2-detached.yaml @@ -0,0 +1,47 @@ +blueprint: + name: ZBMINIR2 detached relay mode + description: Configure ZBMINIR2 to toggle light without turn off the switch. + domain: automation + author: Philipp Klüter + homeassistant: + min_version: 25.12.0 + + input: + zbminir2_device: + name: ZBMINIR2 device + description: ZBMINIR2 device, ensure to activate "Detach relay mode" + selector: + device: + filter: + manufacturer: SONOFF + model: Zigbee smart switch + multiple: false + + controlled_light: + name: Toggle target lights + description: The switch will toggle these lights. + selector: + entity: + filter: + domain: light + multiple: true + +triggers: + - domain: binary_sensor + device_id: !input "zbminir2_device" + type: opened + trigger: device + +variables: + zbminir2_device: !input "zbminir2_device" + zbminir2_switch: "{{ device_entities(zbminir2_device)[0] }}" + +actions: + sequence: + - action: light.toggle + metadata: {} + data: {} + target: + entity_id: !input "controlled_light" + +mode: single