From 1ec5490df6171c3cba2aa78ae4c8fb2606729f3b Mon Sep 17 00:00:00 2001 From: Didgeridrew <19187320+Didgeridrew@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:09:36 -0500 Subject: [PATCH] Replace broken "Copy Switch" example (#36627) --- source/_integrations/switch.template.markdown | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/_integrations/switch.template.markdown b/source/_integrations/switch.template.markdown index e007966275a..a986dbde679 100644 --- a/source/_integrations/switch.template.markdown +++ b/source/_integrations/switch.template.markdown @@ -116,9 +116,9 @@ If you are using the state of a platform that takes extra time to load, the Temp In this section you find some real-life examples of how to use this switch. -### Copy Switch +### Invert a Switch -This example shows a switch that copies another switch. +This example shows a switch that is the inverse of another switch. {% raw %} @@ -126,14 +126,15 @@ This example shows a switch that copies another switch. switch: - platform: template switches: - copy: - value_template: "{{ is_state('switch.source', 'on') }}" + invert: + value_template: "{{ not is_state('switch.target', 'on') }}" + availability_template: "{{ has_value('switch.target') }}" turn_on: - action: switch.turn_on + action: switch.turn_off target: entity_id: switch.target turn_off: - action: switch.turn_off + action: switch.turn_on target: entity_id: switch.target ```