From c3cb5cb54a229fdf90cb6ad8420c4f5310537621 Mon Sep 17 00:00:00 2001 From: Artem Sheremet Date: Sun, 3 May 2026 10:33:00 +0000 Subject: [PATCH] Power cycle button for myStrom relays This can be used to power cycle critical infrastructure, which may render the switch unavailable if turned off. --- templates/mystrom.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/templates/mystrom.yaml b/templates/mystrom.yaml index 83b3970..028a542 100644 --- a/templates/mystrom.yaml +++ b/templates/mystrom.yaml @@ -63,6 +63,25 @@ binary_sensor: then: - switch.toggle: mystrom_relay +script: +- id: power_cycle_relay + mode: single + then: + - if: + condition: + switch.is_on: mystrom_relay + then: + - switch.turn_off: mystrom_relay + - delay: 7s + - switch.turn_on: mystrom_relay + +button: + - platform: template + name: "Power cycle relay" + icon: "mdi:restart" + on_press: + - script.execute: power_cycle_relay + sensor: - platform: pulse_counter pin: 4