How to set MHZ19B CO2 sensor sensitivity

According to the manufacturer you can change the sensitivity of the sensor with the following code

The manufacturers product manual gives the relevant commands:

  • set 0~2000ppm detection range, send command: FF 01 99 00 00 00 07 D0 8F
  • set 0~10000ppm detection range, send command: FF 01 99 00 00 00 27 10 2F

I have been picking my brain on how I can send such a signal, but cannot figure it out. Is there anyone who can point me in the right direction?

Needles to say: MHZ19 is connected to an esp32 running esphome

Sample uart.write in the docs here → UART Bus — ESPHome

Add your array values in std::vector sample and you are set.