Need additional white space in MAX7219 Display

I suspect (hope) this is a really simple thing but I cant work out how to do it. I’m creating a scrolling display of sensor values on a MAX7219 Digit Display. Everything works, but I want a bit of space between them. I thought I could just add some additional space characters into the string being passed, but it ignores any more than one space.

I’ve tried ways around this - defining a char variable and adding it to the string. I’ve used the space ascii code. Ive tried horizontal tab. None of it works it just sticks to one white space. I can put alternative characteres in i.e. ‘_’ but I don’t want to do that ideally.

These additional spaces disappear when shown as a text sensor value, as well as on the display itself.

Is there an easy way of just adding these in that I’m missing?

we’re certainly missing your code :slight_smile:

Good point.

Breaking it down to the most simplest terms if I define two template text sensors:

text_sensor:
  - platform: template
    name: "Test Text Sensor"
    id: test_text_sensor 

  - platform: template
    name: "Test Text Sensor 2"
    id: test_text_sensor2

And then I publish a state to them:

esphome:
  name: test
  on_boot:
    priority: 600
    then: 
      - lambda: |- 
          id(test_text_sensor).publish_state("Hello World");
          id(test_text_sensor2).publish_state("Hello          World");

Both sensors end up with the value ‘Hello World’ - the additional white space in the second sensor is lost.

And what I want is a way of forcing that text sensor to contain the additional white space.

Try to use this code, the space can be changed between the “%s %s”

      it.printf(5, 0, id(digit_font), "%s         %s", id(test_text_sensor).state.c_str(), id(test_text_sensor2).state.c_str());     
      it.scroll(true, max7219digit::CONTINUOUS, 100, 100, 100);