Link Multiple Switches

Link multiple switches together v1.0.1

Import blueprint Link multiple switches together v1.0.0. View source code

Select multiple switch entities to link their on/off state. If any selected switch entity is turned on or off, the other selected entities will be sent a matching on or off command.

v1.01 Changelog

  • Add condition to skip “unknown” state

New blueprint!

I’ve generalized this blueprint to allow the selection of any entities that can be turned on or off via the homeassistant service. Head over here to grab the new blueprint that now supports multiple entities of mixed domains!

6 Likes

I need a script like yours, but sadly this works only with switches, I need to sync lights and switches, the previous one you used as base should to this, sadly it didn’t work for me.

We’d need the ability to specify multiple domains in the entity selector, which currently isn’t supported.

edit: nevermind, made this work in a new blueprint over here!

Try this one. This is what I use

1 Like

The last condition for me causes a 30% of failures in the sync of the entities.
I think is not usefull and when removed everything works fine becasue the save exist if on the state

Also I was getting a lot of errors for devices going into unavailable state so I added this:

  - condition: template
    value_template: '{{ trigger.to_state.state != "unavailable" }}'

as third condition

2 Likes

This gives me an error:

The automation “Link Center Hallway E W Switches” (automation.link_center_hallway_e_w_switches ) has an unknown action: homeassistant.turn_unavailable

same here with HA stating that this prevents it from running automation correctly

This means your switch is unavailable because it’s dropping off the network.

You have 3 options:

  • Edit the blueprint and add another condition as shown 2 posts above.
  • Edit the blueprint and modify the condition from this:
- condition: template
  value_template: '{{ trigger.to_state.state != "unknown" }}'

to this:

conditions:
- condition: template
  value_template: "{{ trigger.from_state.state not in ['unknown', 'unavailable'] }}"
  • Edit the blueprint and modify the trigger (you have to do this in yaml mode) from this:
trigger:
- platform: state
  entity_id: !input 'switches'

to this:

trigger: state
entity_id: !input 'switches'
not_from:
  - unknown
  - unavailable
1 Like