ESPHome UART & Pylontech RS232 and displaying as sensor

Take a look at this post. To extract values from the sample INFO output you provided, the code would look something like this:

int intValue=0;
if (sscanf(str.c_str(), "\rCell Number         :%d", &intValue) == 1 ) {
  id(sensor_id_cells).publish_state(intValue); 
}