Esphome Lambda condition (text on MAX7219 from a ESP8266)

I have tried multiple variants without succeeding.

I want to display different text on the MAX7219 depending on alarmcountnr state.
What I want to to do is basically:

If alarmcountnr > 1
then
it.printf(5, 0, id(digit_font), “%s %.0f”, id(alarmtext).state.c_str(), id(alarmcountnr).state);
it.scroll(false, max7219digit::CONTINUOUS, 100, 100, 100);
it.intensity(atoi(id(alarmbri).state.c_str()));
else
it.printf(5, 0, id(digit_font), id(alarmtext).state.c_str());
it.scroll(true, max7219digit::CONTINUOUS, 100, 100, 100);
it.intensity(atoi(id(alarmbri).state.c_str()));

Can someone please write the if… else… in the correct syntax ?!?
(the print state is correct)

BR // Fredrik

Please post your code properly.

This is my original code I want to change:

display:
  - platform: max7219digit
    cs_pin: D8 
    num_chips: 8
    
    lambda: |-
      if(id(power_on_off).state) {
      it.printf(5, 0, id(digit_font), "%s  %.0f", id(alarmtext).state.c_str(), id(alarmcountnr).state);     
      it.scroll(false, max7219digit::CONTINUOUS, 100, 100, 100);
      it.intensity(atoi(id(alarmbri).state.c_str()));
      }

binary_sensor:
  - platform: template
    name: "Alarm Power State"
    id: power_on_off
    internal: true

switch:
  - platform: template
    name: "Alarm LED Power Switch"
    icon: mdi:dots-grid
    optimistic: true
    restore_state: yes
    turn_on_action:
      - binary_sensor.template.publish:
          id: power_on_off
          state: ON
    turn_off_action:
      - binary_sensor.template.publish:
          id: power_on_off
          state: OFF
sensor:
  - platform: homeassistant
    name: "Alarm Countdown Nr"
    id: alarmcountnr
    entity_id: input_number.countdown 

text_sensor:                                 
  - platform: homeassistant
    name: "Alarm Text"
    id: alarmtext
    entity_id: input_text.alarm_text
  - platform: homeassistant
    name: "Alarm Brightness"
    id: alarmbri
    entity_id: input_number.alarm_led_bri 
  - platform: homeassistant
    name: "Alarm Countdown"
    id: alarmcount
    entity_id: input_number.countdown