Copy switch state (i.e. use magnetic sensor)

How did you add this switch to configure.yaml?