Hab gerade die LED auf grün und rot gehabt. Dann habe ich noch den letzten Abschnitt (gelb) bearbeitet und nun bleibt die LED gelb. Flackert nur ein wenig. Im Trace steht es wäre rot ausgelöst.
Ach ja, restart hatte ich nur kurz ausprobiert, half auch nicht
Ach ja, restart hatte ich nur kurz ausprobiert, half auch nicht
YAML:
alias: Küche Fenster 1 oder/und 2 auf/zu
description: Fenster auf/zu - Display
trigger:
- platform: state
entity_id:
- binary_sensor.kuche_fenster_1_kontakt
to: "on"
id: Fenster1 auf
alias: Fenster1 auf
from: "off"
- platform: state
entity_id:
- binary_sensor.kuche_fenster_2_kontakt
to: "on"
id: Fenster2 auf
alias: Fenster2 auf
from: "off"
- platform: state
entity_id:
- binary_sensor.kuche_fenster_1_kontakt
to: "off"
id: Fenster1 zu
alias: Fenster1 zu
from: "on"
- platform: state
entity_id:
- binary_sensor.kuche_fenster_2_kontakt
to: "off"
id: Fenster2 zu
alias: Fenster2 zu
from: "on"
condition: []
action:
- if:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.kuche_fenster_1_kontakt
state: "on"
- condition: state
entity_id: binary_sensor.kuche_fenster_2_kontakt
state: "on"
then:
- service: mqtt.publish
data:
topic: cmnd/node1/led4
payload: "010000"
alias: LED rot
- if:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.kuche_fenster_1_kontakt
state: "off"
- condition: state
entity_id: binary_sensor.kuche_fenster_2_kontakt
state: "off"
then:
- service: mqtt.publish
data:
topic: cmnd/node1/led4
payload: "000100"
alias: LED grün
- if:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kuche_fenster_1_kontakt
state: "on"
- condition: state
entity_id: binary_sensor.kuche_fenster_2_kontakt
state: "off"
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.kuche_fenster_1_kontakt
state: "off"
- condition: state
entity_id: binary_sensor.kuche_fenster_2_kontakt
state: "on"
then:
- service: mqtt.publish
data:
topic: cmnd/node1/led4
payload: "010100"
alias: LED gelb
mode: restart