Different type custom sensors

I wanted to build an rf433 receiver. After lot of hours playing the integrated rcswitch library, i figured ot all of my problems are caused by the bad code. The rcswitch of esphome often reads false values, and unable to repeat the code. so its really unreliable so i wanted to integrate the rcswitch library. (i’m a hobbyst so beginner in C coding)

Its my first try, i’m at the code reading procedure, everything went flawless, it reads the sensor values, and put into esphome, but i wanted to create a text sensor for the binary format… It can be seen in log, but dont give id and name of the text sensor, so i dont see in HA, and i cant imagine why.

code of library:

class MyRCSwitchComponent : public Component {
 public:
  RCSwitch mySwitch = RCSwitch();
  TextSensor *ReceivedBinary = new TextSensor();
  Sensor *ReceivedDecimal   = new Sensor();
  Sensor *ReceivedProtocol  = new Sensor();
  Sensor *ReceivedBitlength = new Sensor();

  void setup() override {
    // This is called once, to init. 
   
    mySwitch.enableReceive(RECEIVERPIN);  // receiver pin 
    ESP_LOGD("custom", "RECEIVER PIN ON !");
  }
  void loop() override {
    // its a loop 

    if (mySwitch.available()) {
       ESP_LOGD("custom", "Custom RCSwitch Code decoded !");
       //output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
       const char* b = dec2binWzerofill(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength());

       ReceivedProtocol  -> publish_state (mySwitch.getReceivedProtocol());
       ReceivedBitlength -> publish_state (mySwitch.getReceivedBitlength());
       ReceivedDecimal   -> publish_state (mySwitch.getReceivedValue());
       ReceivedBinary    -> publish_state (b);
       mySwitch.resetAvailable();
    }
  }

yaml part:

sensor: 
  - platform: custom
    lambda: |-
      auto my_sensor = new MyRCSwitchComponent();
      App.register_component(my_sensor);
      return {my_sensor-> ReceivedProtocol,my_sensor-> ReceivedBitlength, my_sensor-> ReceivedDecimal };

    sensors:
    - name: "Received Protocol"
      accuracy_decimals: 0
    - name: "Received Bit Length"
      accuracy_decimals: 0
    - name: "Received Decimal Value"
      accuracy_decimals: 0


text_sensor: 
  - platform: custom
    lambda: |-
      auto my_sensor = new MyRCSwitchComponent();
      App.register_component(my_sensor);
      return {my_sensor-> ReceivedBinary};

    text_sensors: 
      - id: "Receivedbinary"
        name: "Binary"

Here is problematic the text sensor part.
It can be seen in the log, but without NAME

10:38:12][D][custom:025]: Custom RCSwitch Code decoded !
[10:38:12][D][sensor:127]: 'Received Protocol': Sending state 11.00000  with 0 decimals of accuracy
[10:38:12][D][sensor:127]: 'Received Bit Length': Sending state 12.00000  with 0 decimals of accuracy
[10:38:12][D][sensor:127]: 'Received Decimal Value': Sending state 3905.00000  with 0 decimals of accuracy
[10:38:12][D][text_sensor:067]: '': Sending state '111101000001'

What is the problem ?