Arek Swistak war so nett ein Beispiel für eine ESPHome Automatisierung mit uns zu teilen, die nur ausgeführt wird, wenn der hinterlegte MQTT-Broker nicht erreichbar ist.
Danke dafür!
configuration.yaml
1binary_sensor:
2 - platform: gpio
3 pin:
4 number: GPIO5
5 name: "Schalter"
6 on_state:
7 if:
8 condition:
9 mqtt.connected:
10 then:
11 - logger.log: Mqtt is connected!
12 else:
13 - light.toggle: schalter_id
14 internal: true
15
16output:
17 - platform: gpio
18 pin: GPIO4
19 id: lampe
20
21mqtt:
22 broker: broker ip
23 username: "user"
24 password: "passwordmqtt"