Åkei, her er min config.
 
	Pass på indents, de kan bli litt fucked ved copy/paste - det er deres ansvar å få rett 
 
	 
 
	EDIT: Som dere vil se i kallene, så har jeg kalt min device for "ID Lock 150", dere må evt erstatte disse i koden. Jeg har også lagt med en YAML vil med all koden samlet, i håp om at samtlige indents skal være korrekt.
 
	 
 
	Her er hva som må være installert fra HACS for å få min kode til å virke:
 
	- browser_mod 
	- card-mod 
	- card-tools 
	- template-entity-row 
	- button-card
 
	 
 
	 
 
	 
 
	input_select:
 
    idlock_lockmode:
      name: Sett ID Lock låsmodus
      icon: mdi:creation
      options:
        - auto_off_away_off
        - auto_on_away_off
        - auto_off_away_on
        - auto_on_away_on
      initial: auto_off_away_off
	 
 
	 
 
	input_boolean:
 
    idlock:
      name: idlock
      initial: off
      icon: mdi:lock
	 
 
	 
 
	input_text:
 
    idlock_action:
      name: Et navn
	 
 
	 
 
	sensors:
 
  - platform: mqtt
    name: ID Lock 150 MQTT
    state_topic: "zigbee2mqtt/ID Lock 150/action"
    availability_topic: "zigbee2mqtt/bridge/state"
  - platform: template
    sensors:
      idlock_150_how:
        friendly_name: ID Lock 150 Siste Action
        value_template: "{{ states.input_text.idlock_action.state }}"
      idlock150_lock_status:
        friendly_name: ID Lock 150 Låsestatus
        value_template: >-
          {% set lock_status = state_attr('lock.id_lock_150','lock_state') %}
          {% if lock_status == 'unlocked' %}
            Åpen
          {% else %}
            Låst
          {% endif %}
      idlock150_door_status:
        friendly_name: ID Lock 150 Dørstatus
        value_template: >-
          {% set door_status = state_attr('lock.id_lock_150','door_state') %}
          {% if door_status == 'open' %}
            Åpen
          {% else %}
            Lukket
          {% endif %}
      idlock150_service_status:
        friendly_name: ID Lock 150 Servicemode
        value_template: >-
          {% if is_state("sensor.id_lock_150_service_mode", "deactivated") %}
            Deaktivert
          {% elif is_state("sensor.id_lock_150_service_mode", "random_pin_1x_use") %}
            For bruk 1 gang
          {% else %}
            Gyldig i 24 timer
          {% endif %}
      idlock150_service_pin:
        friendly_name: ID Lock 150 Service Mode PIN
        value_template: "{{ state_attr('lock.id_lock_150','users')['108']['pin_code'] }}"
      id_lock_150_lock:
        friendly_name: ID LOCK 150 Oversatt
        value_template: >-
          {% if is_state("sensor.id_lock_150_mqtt", "lock") %}
            Låst
          {% elif is_state("sensor.id_lock_150_mqtt", "unlock") %}
            Åpnet med PIN eller RFID
          {% elif is_state("sensor.id_lock_150_mqtt", "lock_failure_invalid_pin_or_id") %}
            Låsing feilet - Ukjent PIN eller RFID
          {% elif is_state("sensor.id_lock_150_mqtt", "lock_failure_invalid_schedule") %}
            Låsing feilet - invalid_schedule
          {% elif is_state("sensor.id_lock_150_mqtt", "unlock_failure_invalid_pin_or_id") %}
            Opplåsing feilet - Feil PIN eller RFID
          {% elif is_state("sensor.id_lock_150_mqtt", "one_touch_lock") %}
            Låst fra tastatur
          {% elif is_state("sensor.id_lock_150_mqtt", "key_lock") %}
            Låst med nøkkel
          {% elif is_state("sensor.id_lock_150_mqtt", "key_unlock") %}
            Åpnet med nøkkel
          {% elif is_state("sensor.id_lock_150_mqtt", "auto_lock") %}
            Automatisk låst
          {% elif is_state("sensor.id_lock_150_mqtt", "manual_lock") %}
            Manuelt låst
          {% elif is_state("sensor.id_lock_150_mqtt", "manual_unlock") %}
            Manuelt åpnet
          {% else %}
            Ukjent status
          {% endif %}
	 
 
	 
 
	scripts:
 
    mqtt_idlock_soundvolume:
      alias: 'MQTT ID Lock SoundVolume'
      sequence:
        - service: input_select.select_option
          entity_id: input_select.idlock_volume
          data_template:
            option: >
              {{ option }}
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload: >-
             {
               "sound_volume":"{{states('input_select.idlock_volume')}}"
               }
    mqtt_idlock_master_pin:
      alias: 'MQTT ID Lock Master PIN'
      sequence:
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload_template: >-
                {% if is_state('switch.id_lock_150_master_pin_mode', 'on') %}
                  {"master_pin_mode":false}
                {% else %}
                  {"master_pin_mode":true}
                {% endif %}
    mqtt_idlock_rfid:
      alias: 'MQTT ID Lock RFID'
      sequence:
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload_template: >-
                {% if is_state('switch.id_lock_150_rfid_enable', 'on') %}
                  {"rfid_enable":false}
                {% else %}
                  {"rfid_enable":true}
                {% endif %}
    mqtt_idlock_relock:
      alias: 'MQTT ID Lock Relock'
      sequence:
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload_template: >-
                {% if is_state('switch.id_lock_150_relock_enabled', 'on') %}
                  {"relock_enabled":false}
                {% else %}
                  {"relock_enabled":true}
                {% endif %}
    mqtt_idlock_lock_mode:
      alias: 'MQTT ID Lock Lock Mode'
      sequence:
        - service: input_select.select_option
          entity_id: input_select.idlock_lockmode
          data_template:
            option: >
              {{ option }}
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload: >-
             {
               "lock_mode":"{{states('input_select.idlock_lockmode')}}"
               }
    mqtt_idlock_service_mode:
      alias: 'MQTT ID Lock Service Mode'
      sequence:
        - service: input_select.select_option
          entity_id: input_select.idlock_servicemode
          data_template:
            option: >
              {{ option }}
        - service: mqtt.publish
          data:
            topic: "zigbee2mqtt/ID Lock 150/set"
            payload: >-
             {
               "service_mode":"{{states('input_select.idlock_servicemode')}}"
               }
	 
 
	 
 
	automations:
 
  - alias: ID LOCK 150
    mode: single
    trigger:
      - platform: mqtt
        topic: "zigbee2mqtt/ID Lock 150"
    condition:
      - condition: template
        value_template: "{{ trigger.payload_json.action_source_name in ['keypad', 'rf', 'rfid','manual'] }}"
    action:
      - choose:
          - conditions: "{{ trigger.payload_json.action_source_name == 'keypad' }}"
            sequence:
              - service: input_text.set_value
                data:
                  value: Tastatur
                target:
                  entity_id: input_text.idlock_action
          - conditions: "{{ trigger.payload_json.action_source_name == 'rf' }}"
            sequence:
              - service: input_text.set_value
                data:
                  value: Home Assistant
                target:
                  entity_id: input_text.idlock_action
          - conditions: "{{ trigger.payload_json.action_source_name == 'rfid' }}"
            sequence:
              - service: input_text.set_value
                data:
                  value: RFID
                target:
                  entity_id: input_text.idlock_action
          - conditions: "{{ trigger.payload_json.action_source_name == 'manual' }}"
            sequence:
              - service: input_text.set_value
                data:
                  value: Manuelt
                target:
                  entity_id: input_text.idlock_action
	 
 
	 
 
	lovelace:
 
	Jeg benytter anchors for shortcuts til kode. Her er koden for delene som jeg benytter for ID LOCK
 
###############################################
anchors:
  card_mod_transparent: &card_mod_transparent
    style: |
      ha-card {
        background-color: transparent; border: none; box-shadow: none;
      }
  # BUTTON CB HEADER
  ##################
  cb_header: &cb_header
    type: "custom:button-card"
    color_type: label-card
    color: rgb(44, 109, 214)
    styles:
      card:
        - background: none
        - height: 5px
        - border: "solid 1px rgba(57,128,228)"
  # BUTTON SPACER FOR LEFT/RIGHT OF BUTTONS IN H-STACK
  ####################################################
  cb_vertical_spacer: &cb_vertical_spacer
    type: custom:button-card
    color_type: blank-card
    styles:
      card:
        - background: none
        - height: 10px
  # 6px SPACER FOR LEFT/RIGHT OF BUTTONS IN H-STACK
  #################################################
  cb_spacer_6px: &cb_spacer_6px
    type: custom:button-card
    color_type: blank-card
    styles:
      card:
        - width: 6px
  ###############################
  cb_standard_button: &cb_standard_button
    type: custom:button-card
    layout: icon_label
    show_state: true
    show_name: true
    show_label: false
    styles:
      grid:
        - grid-template-rows: 42px auto 42px
        - grid-template-columns: 42px auto
      card:
        - background-color: transparent ### Denne har jeg lagt til selv
        - border: "solid 1px rgba(57,128,228)" ### Virker denne?
        - border-radius: 15px
        - margin: 5px 5px 0px 0px
        - padding: 0px 0px
        - height: 90px
      icon:
        - height: 20px
        - width: 20px
        - color: "#2F7EFD"
      name:
        - justify-self: start
        - padding: 0px 10px
        - font-size: 13px
        - color: "#2F7EFD"
      state:
        - font-size: 11px
        - font-family: Helvetica
        - text-transform: capitalize
        - font-weight: bold
        - align-self: end
        - justify-self: start
        - padding: 9px 10px
        - color: "#2F7EFD"
      lock:
        - align-items: flex-end
    state:
      - value: "on"
        styles:
          card:
            - box-shadow: 0px 0px 15px 5px rgba(57,128,228)
          icon:
            - color: "#fed281"
          name:
            - color: white
          state:
            - color: white
          label:
            - color: white
    tap_action:
      action: toggle
    hold_action:
      action: more-info
  ####################################
  cb_idlock: &cb_idlock
    type: custom:button-card
    show_state: false
    show_icon: false
    styles:
      card:
        - background-color: transparent
        - border: "solid 1px rgba(57,128,228)"
        - border-radius: 15px
        - font-size: 14px
        - text-shadow: 0px 0px 5px black
        - padding: 15px 5px
      grid:
        - grid-template-areas: ' "i." "n n" "line1 line1" "line2 line2" "line3 line3" '
        - grid-template-columns: 1fr 1fr
        - grid-template-rows: 1fr min-content min-content min-content min-content min-content
      name:
        - font-weight: bold
        - font-size: 20px
        - color: "#2F7EFD"
        - align-self: middle
        - justify-self: start
        - padding-bottom: 5px
        - margin-left: "4%"
      img_cell:
        - justify-content: start
        - align-items: start
        - margin: none
      icon:
        - width: 10%
        - margin-top: "-1%"
      custom_fields:
        line1:
          - padding-bottom: 8px
          - align-self: left
          - justify-self: start
          - margin-left: "4%"
        line2:
          - padding-bottom: 8px
          - align-self: left
          - justify-self: start
          - margin-left: "4%"
        line3:
          - padding-bottom: 8px
          - align-self: left
          - justify-self: start
          - margin-left: "4%"
  ####################################
	 
 
	 
 
	... så til slutt selve kortet: 
	 
 
      - type: vertical-stack
        cards:
          - <<: *cb_header
            name: ID LOCK 150
          - <<: *cb_spacer_6px
          - type: custom:button-card
            entity: lock.id_lock_150
            triggers_update: all
            show_entity_picture: true
            entity_picture: >
              [[[
                if (entity.attributes.door_state == "open")
                  return "/local/idlock_open.png";
                else
                  return "/local/idlock_closed_unlocked.png";
              ]]]
            show_name: false
            styles:
              card:
                - background-color: transparent
              state:
                - font-size: 11px
                - font-family: Helvetica
                - text-transform: capitalize
                - font-weight: bold
                - align-self: end
                - justify-self: start
                - padding: 9px 10px
                - color: "#2F7EFD"
              lock:
                - align-items: flex-end
            state:
              - value: "locked"
                entity_picture: "/local/idlock_closed_locked.png"
            tap_action:
              action: call-service
              service: |
                [[[
                  return (entity.state === 'locked') ? 'lock.unlock' : 'lock.lock';
                ]]]
              service_data:
                entity_id: lock.id_lock_150
            hold_action:
              action: fire-dom-event
              browser_mod:
                command: popup
                hide_header: true
                large: false
                card:
                  type: vertical-stack
                  cards:
                    - type: horizontal-stack
                      cards:
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          name: Ingen lyd
                          entity: sensor.id_lock_150_sound_volume
                          show_state: false
                          icon: mdi:volume-off
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_soundvolume
                            service_data:
                              option: silent_mode
                          state:
                            - value: "silent_mode"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          name: Lav lyd
                          entity: sensor.id_lock_150_sound_volume
                          show_state: false
                          icon: mdi:volume-medium
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_soundvolume
                            service_data:
                              option: low_volume
                          state:
                            - value: "low_volume"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          name: Høy Lyd
                          entity: sensor.id_lock_150_sound_volume
                          show_state: false
                          icon: mdi:volume-high
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_soundvolume
                            service_data:
                              option: high_volume
                          state:
                            - value: "high_volume"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                    - <<: *cb_vertical_spacer
                    - type: horizontal-stack
                      cards:
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          entity: switch.id_lock_150_master_pin_mode
                          name: Bruk Master PIN
                          show_state: false
                          icon: mdi:dialpad
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_master_pin
                          state:
                            - value: "on"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          entity: switch.id_lock_150_rfid_enable
                          name: Aksepter RFID
                          show_state: false
                          icon: mdi:access-point
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_rfid
                          state:
                            - value: "on"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - type: custom:button-card
                          <<: *cb_standard_button
                          entity: switch.id_lock_150_relock_enabled
                          name: Relock
                          show_state: false
                          icon: mdi:lock-reset
                          triggers_update: all
                          tap_action:
                            action: toggle
                          state:
                            - value: "on"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                    - <<: *cb_vertical_spacer
                    - type: horizontal-stack
                      cards:
                        - <<: *cb_spacer_6px
                        - type: custom:button-card
                          <<: *cb_standard_button
                          entity: sensor.idlock150_service_status
                          name: Service AV
                          show_state: false
                          icon: mdi:face-agent
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_service_mode
                            service_data:
                              option: deactivated
                          state:
                            - value: "Deaktivert"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - <<: *cb_standard_button
                          entity: sensor.idlock150_service_status
                          name: Service 1 gang
                          show_state: false
                          icon: mdi:face-agent
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_service_mode
                            service_data:
                              option: random_pin_1x_use
                          state:
                            - value: "For bruk 1 gang"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                        - type: custom:button-card
                          <<: *cb_standard_button
                          entity: sensor.idlock150_service_status
                          name: Service 24 timer
                          show_state: false
                          icon: mdi:face-agent
                          triggers_update: all
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_service_mode
                            service_data:
                              option: random_pin_24_hours
                          state:
                            - value: "Gyldig i 24 timer"
                              styles:
                                card:
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                        - <<: *cb_spacer_6px
                    - type: vertical-stack
                      cards:
                        - <<: *cb_vertical_spacer
                        - <<: *cb_idlock
                          entity: sensor.id_lock_150_lock_mode
                          name: "Hjemmemodus med manuell låsing"
                          show_icon: false
                          icon: >
                            [[[
                              if (entity.state == "auto_off_away_off")
                                return "mdi:radiobox-marked";
                              else
                                return "mdi:checkbox-blank-circle-outline";
                            ]]]
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_lock_mode
                            service_data:
                              option: auto_off_away_off
                          state:
                            - value: "auto_off_away_off"
                              styles:
                                card:
                                  - background-color: transparent
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                          custom_fields:
                            line1: >
                              [[[
                                return `<span>Vanlig modus med manuell låsing døren for å låse den.</span>`
                              ]]]
                            line2: |
                              [[[
                                return `<span> </span>`
                              ]]]
                            line3: |
                              [[[
                                return `<span></span>`
                              ]]]
                        - <<: *cb_vertical_spacer
                        - <<: *cb_idlock
                          entity: sensor.id_lock_150_lock_mode
                          name: "Hjemmemodus med automatisk låsing"
                          icon: >
                            [[[
                              if (entity.state == "auto_on_away_off")
                                return "mdi:radiobox-marked";
                              else
                                return "mdi:checkbox-blank-circle-outline";
                            ]]]
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_lock_mode
                            service_data:
                              option: auto_on_away_off
                          state:
                            - value: "auto_on_away_off"
                              styles:
                                card:
                                  - background-color: transparent
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                          custom_fields:
                            line1: >
                              [[[
                                return `<span>Vanlig modus med automatisk låsing av dør når lukkes</span>`
                              ]]]
                            line2: |
                              [[[
                                return `<span>fra åpen posisjon.</span>`
                              ]]]
                            line3: |
                              [[[
                                return `<span></span>`
                              ]]]
                        - <<: *cb_vertical_spacer
                        - <<: *cb_idlock
                          entity: sensor.id_lock_150_lock_mode
                          name: "Bortemodus med manuell låsing"
                          icon: >
                            [[[
                              if (entity.state == "auto_off_away_on")
                                return "mdi:radiobox-marked";
                              else
                                return "mdi:checkbox-blank-circle-outline";
                            ]]]
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_lock_mode
                            service_data:
                              option: auto_off_away_on
                          state:
                            - value: "auto_off_away_on"
                              styles:
                                card:
                                  - background-color: transparent
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                state:
                                icon:
                                  - color: "#fed281"
                          custom_fields:
                            line1: >
                              [[[
                                return `<span>Nøkkelknapp på innsiden deaktiveres. Må bruke manuell</span>`
                              ]]]
                            line2: |
                              [[[
                                return `<span>låsing av døren for å låse den.</span>`
                              ]]]
                            line3: |
                              [[[
                                return `<span></span>`
                              ]]]
                        - <<: *cb_vertical_spacer
                        - <<: *cb_idlock
                          entity: sensor.id_lock_150_lock_mode
                          name: "Bortemodus med autolås"
                          icon: >
                            [[[
                              if (entity.state == "auto_on_away_on")
                                return "mdi:radiobox-marked";
                              else
                                return "mdi:checkbox-blank-circle-outline";
                            ]]]
                          tap_action:
                            action: call-service
                            service: script.mqtt_idlock_lock_mode
                            service_data:
                              option: auto_on_away_on
                          state:
                            - value: "auto_on_away_on"
                              styles:
                                card:
                                  - background-color: transparent
                                  - box-shadow: "0px 0px 15px 5px rgba(57,128,228)"
                                name:
                                  - color: "#fed281"
                                icon:
                                  - color: "#fed281"
                          custom_fields:
                            line1: >
                              [[[
                                return `<span>Nøkkelknapp på innsiden deaktiveres. Automatisk</span>`
                              ]]]
                            line2: |
                              [[[
                                return `<span>låsing av dør når lukkes fra åpen posisjon.</span>`
                              ]]]
                            line3: |
                              [[[
                                return `<span></span>`
                              ]]]
                style:
                  $: |
                    .mdc-dialog {
                      backdrop-filter: blur(17px) !important;
                      -webkit-backdrop-filter: blur(17px);
                      background: rgba(0,0,0,0.2);
                    }
                    .mdc-dialog .mdc-dialog__container .mdc-dialog__surface {
                      background: rgba(0,0,0,0.2);
                      box-shadow: none;
                      border-radius: 5px;
                    }
          - type: entities
            <<: *card_mod_transparent
            entities:
              - entity: sensor.id_lock_150_battery
                name: Batteri
              - entity: sensor.idlock150_door_status
                name: Døren er nå
                icon: mdi:lock-smart
              - entity: sensor.idlock150_lock_status
                name: Låsen er nå
                icon: mdi:lock-question
              - entity: sensor.idlock_150_how
                name: Siste handling utført via
                icon: mdi:account-search-outline
              - entity: sensor.idlock150_service_status
                name: Midlertidig PIN modus
                icon: mdi:face-agent
              - type: custom:template-entity-row
                icon: mdi:dialpad
                name: Midlertidig PIN
                condition: "{{ states('sensor.idlock150_service_status') != 'Deaktivert' }}"
                entity: sensor.idlock150_service_pin
	 
 
	
 
	
 
	
 
id lock 150 kode for å få layout.yaml