Hello Everyone, I have Shelly Uni flashed with ESPHome. It has two outputs. I have created condition, that if alarm is armed, the outputs will not turn on. These outputs just opens garage door, and I want to block operation while alarm is armed.
My code basically works, but I have one problem. State of outputs are not shown in Home Assistant. So if I click on Output 1 entity in Home Assistant, it pops up History of values, but no changes are recorded there. Here is my code:
switch:
- platform: template
name: “Output 1”
id: relay_1
device_class: “switch”
turn_on_action:- if:
condition:
binary_sensor.is_off: blokada_otwarcia_bramy
then:
- output.turn_on: out_1
- delay: 500ms
- output.turn_off: out_1
else:
- logger.log: “Output 1 jest zablokowany.”
icon: “mdi:garage-variant”
restore_mode: restore_default_off
- if:
- platform: template
name: “Output 2”
id: relay_2
device_class: “switch”
turn_on_action:- if:
condition:
binary_sensor.is_off: blokada_otwarcia_bramy
then:
- output.turn_on: out_2
- delay: 500ms
- output.turn_off: out_2
else:
- logger.log: “Output 2 jest zablokowany.”
icon: “mdi:garage-variant”
restore_mode: restore_default_off
- if: