IR Component (Transmit , Receive)

I’ve connected the TSOP38238 IR Receiver in my d1 mini and i can receive the IR codes in the log.
Im trying to make an on_raw trigger to asign the IR raw value in a text sensor template but can’t find how to asign the IR value…

remote_receiver:
  pin: 
    number: D1
    inverted: True
  dump: raw
  on_raw:
    then:
      - text_sensor.template.publish:
          id: ir_receiver
          state: {{remote.raw}}

Obviously remote.raw doesnt work… but what’s the correct location of the ir code?

This thread may help Request: will any user successfully using ESPhome as a remote IR transmitter please post their yaml

im afraid its not helpful