Emulate a three way switch

Thats not really a 3 way switch. A 3 way switch is 2 switches controlling a set of lights with the following logic:

switch 1 on, switch 2 off -> lights on
switch 1 off, switch 2 on -> lights on
switch 1 off, switch 2 off -> lights off
switch 1 on, switch 2 on -> lights off

You just want to pair the switches together.

A dynamic automation that does that would look like this:

trigger:
- platform: state
  entity_id: switch.a
- platform: state
  entity_id: switch.b
condition:
- condition: template
  value_template: >
    {% set switches = ['switch.a', 'switch.b'] %}
    {% set target = trigger.to_state.state %}
    {{ states | selectattr('entity_id', 'in', switches) | selectattr('state','eq', target) | list | length != switches | length }}
action:
- service_template: switch.turn_{{ trigger.to_state.state }}
  data_template:
    entity_id: >
      {% set switches = ['switch.a', 'switch.b'] %}
      {% set target = trigger.to_state.state %}
      {{ states | selectattr('entity_id', 'in', switches) | selectattr('state','!=',target) | map(attribute='entity_id') | list | join(', ') }}

So what this does is it triggers off a or b. Then the condition checks if all the lights are already the target state. If they all are already the target state, the automation does not fire. If they are not, it builds a list of entities to set to the target state.

This will work with any size list. So if you add more lights or switches in the future, all you need to do is add them to the list.

Now, I did notice that we may have to make a map because these switches may not coorelate to your light group.

I can adjust this automation to account for that but I need to see your entity_id’s for all switches & light groups.