Last active
April 2, 2025 10:44
-
-
Save haade-administrator/8897d84e11d5e505b729d24a535a89e4 to your computer and use it in GitHub Desktop.
création d'un va et vient dans homeassistant avec 4 interrupteurs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Synchronize Four States | |
description: > | |
## Bind four entities together to act in unison (selected entites must all support the same state values) | |
🔥**Version**: v1.2 | |
source_url: https://gist.github.com/haade-administrator/8897d84e11d5e505b729d24a535a89e4 | |
domain: automation | |
input: | |
switch_1: | |
name: Entity 1 | |
selector: | |
entity: | |
domain: switch | |
switch_2: | |
name: Entity 2 | |
selector: | |
entity: | |
domain: switch | |
switch_3: | |
name: Entity 3 | |
selector: | |
entity: | |
domain: switch | |
switch_4: | |
name: Entity 4 | |
selector: | |
entity: | |
domain: switch | |
variables: | |
switch_1: !input switch_1 | |
switch_2: !input switch_2 | |
switch_3: !input switch_3 | |
switch_4: !input switch_4 | |
trigger: | |
- platform: state | |
entity_id: | |
- !input switch_1 | |
- !input switch_2 | |
- !input switch_3 | |
- !input switch_4 | |
to: | |
- 'on' | |
- 'off' | |
mode: single | |
condition: | |
'{{ trigger.to_state.state != trigger.from_state.state }}' | |
action: | |
# Set to target value | |
- choose: | |
- conditions: | |
- '{{ trigger.entity_id != switch_1 }}' | |
- '{{ trigger.to_state.state != states(switch_1) }}' | |
sequence: | |
- service: 'switch.turn_{{ trigger.to_state.state }}' | |
entity_id: !input switch_1 | |
- choose: | |
- conditions: | |
- '{{ trigger.entity_id != switch_2 }}' | |
- '{{ trigger.to_state.state != states(switch_2) }}' | |
sequence: | |
- service: 'switch.turn_{{ trigger.to_state.state }}' | |
entity_id: !input switch_2 | |
- choose: | |
- conditions: | |
- '{{ trigger.entity_id != switch_3 }}' | |
- '{{ trigger.to_state.state != states(switch_3) }}' | |
sequence: | |
- service: 'switch.turn_{{ trigger.to_state.state }}' | |
entity_id: !input switch_3 | |
- choose: | |
- conditions: | |
- '{{ trigger.entity_id != switch_4 }}' | |
- '{{ trigger.to_state.state != states(switch_4) }}' | |
sequence: | |
- service: 'switch.turn_{{ trigger.to_state.state }}' | |
entity_id: !input switch_4 |
la version 2way est modifié inspire toi c'est assez simple
j'ai modifié le script tu peux désormais utiliser la version 4way
j'ai modifié le script tu peux désormais utiliser la version 4way
Merci beaucoup :)
Désolé il y avait une erreur d'intentation, tu peux l'importer maintenant: https://gist.github.com/haade-administrator/8897d84e11d5e505b729d24a535a89e4
Désolé il y avait une erreur d'intentation, tu peux l'importer maintenant: https://gist.github.com/haade-administrator/8897d84e11d5e505b729d24a535a89e4
C'est parfait merci beaucoup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quand j'essaie le blueprint j'ai un message d'erreur
