Automation to Mirror two Smart Switches

Ok so I just added it to automations with and the only result was I can not turn off my kitchen light now

- id: st_kitchen_light_to_ha_kitchen_light
  alias: st kitchen light switch controlling ha kitchen light switch
  description: ''
  trigger:
  - platform: state
    entity_id: switch.kitchen_light_st
  condition:
  - condition: template
    value_template: "{{ states('switch.kitchen_light') != trigger.to_state }}"
  action:
  - service: switch.turn_{{ trigger.to_state }}
    target:
      entity_id: switch.kitchen_light
  mode: single
- id: ha_kitchen_light_to_st_kitchen_light
  alias: ha kitchen light switch controlling st kitchen light switch
  description: ''
  trigger:
  - platform: state
    entity_id: switch.kitchen_light
  condition:
    condition: template
    value_template: "{{ states('switch.kitchen_light_st') != trigger.to_state }}"
  action:
  - service: switch.turn_{{ trigger.to_state }}
    target:
      entity_id: switch.kitchen_light_st
  mode: single

My original templates contain errors. Wherever this appears trigger.to_state replace it with trigger.to_state.state

I have now corrected the original post.

Well the switch was having some weird problem too, it would not respond to switch on and off commands and then said that zwave.js was no longer providing this entity. After excluding and reincluding it (which could not be done with s2 security for some reason) and making your correction it is working great!