This commit is contained in:
2026-01-12 20:08:59 +01:00
parent 6af7f65591
commit f26ddc0bb9
3 changed files with 159 additions and 4 deletions

View File

@@ -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}

View File

@@ -1,10 +1,10 @@
substitutions: substitutions:
device_name: mini-r4-8 device_name: schalter-gaeste-wc
friendly_name: mini-r4-8 friendly_name: Schalter Gäste WC
ota_password: !secret ota_password ota_password: !secret ota_password
fallback_wifi_pwd: !secret fallback_wifi_pwd fallback_wifi_pwd: !secret fallback_wifi_pwd
light_entity: light.deckenlampe_treppenhaus light_entity: light.deckenlampe_treppenhaus
bt_proxy: "true" bt_proxy: false
packages: packages:
minir4: !include common/minir4.yaml minir4: !include common/minir4-local-schalter.yaml

View File

@@ -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