Esp + czytnik wegand rfid kart automatyzacja zamka drzwi

hello i am trying to grasp automation with esp with wiegand reader. I want it to work without HA access.
please help how the code should look like.

at the moment it sends the card number to the HA and it is possible to do some automation in node-RED but I want it to work regardless of HA access.

# Text sensor to return code or card ID
text_sensor:
- platform: custom
  lambda: |-
    auto wiegand = new WiegandReader(D2, D1);
    App.register_component(wiegand);
    return {wiegand};
 
 
 
  text_sensors:
    name: "Card ID"
    on_value:
      then:
        - homeassistant.tag_scanned: !lambda |-
            return x;   
            

I only have in mind how to enter a condition that will compare with the uploaded card number and activate the relay. then it will erase from memory to do the same next time reading the same card.

   if wiegadd = 123234
       then:
         - output.turn_on: "relay_1"
         - delay: 1 min
         - output.turn_off: "relay_1
        Wiegand == 0

This will allow the reader to be used as an independent access to the supervised room.
I’m not strong in programming, please help.

I used the code below.
https://github.com/AlexandreUSA/esphome-wiegand-reader/blob/f3bc228d8eb90444ae9d14ae6d8abd198b7ca8fa/garagedoors.yaml

i did something like this but there is a mistake

  text_sensors:
    name: "Card ID"
    on_value:
      then:
        - homeassistant.tag_scanned: !lambda |-
            return x;

      then:
        - if:
          condition:
            
          WiegandReader.state:
          #    tag_scanned.state:
           #   id: my_text_sensor22
          state: '2800215'      
            then:
              - switch.turn_on: relay_1
              - delay: 10s
              - switch.turn_off: relay_1