Template for Yale doorman V2N lock (Verisure integration through Vbox-Mini), how do i use it?

Tags: #<Tag:0x00007f73ae2fa778> #<Tag:0x00007f73ae2fa660> #<Tag:0x00007f73ae2fa598>

I got this sendt to me, to help me set up my Yale doorman V2N (verisure integration)

This is controled  by an entity button by tap-action = toggle 
 

  - platform: template
    switches:
      **entitet-name-on-the-switch:**
        friendly_name: 'Maindoor'
        value_template: "{{'off' if is_state('lock.**maindoor**', 'locked') else 'on' }}"
        turn_on:
          service: lock.unlock
          data:
            entity_id: lock.**maindoor**
            code: !secret verisure_lock_code
        turn_off:
          service: lock.lock
          data:
            entity_id: lock.**maindoor**
            code: !secret verisure_lock_code

I have the setup for Yale doorman working through verisure in home assistant, this template code is to not be forced to type in the Security pin each time i want to remote-open the door.

A few questions:
1: Where do i actually put the template code? Directly in my card?
2: What do i do with the first highlight? I dont understand what to put here? I.e Row 3 in the code
3: Do i need to change anything else then the entity-IDs highlighted?