Displaying Heap size and cpu frequency on esphome

I’m working on a project where I’d like to monitor the heap size and CPU frequency of my ESP32/ESP8266 device and display these metrics.

Is there a sensor for the heap size and the cpu frequency?

And the CPU frequency?? @Masterzz

Unfortunatly no specific sensor for CPU frequency,
You can extract it from Text Sensor device.

Can you explain me how or post an example