Eshome - combine strings

hello,

how can i combine 2 strings / values for my display?

i ve

it.printf(205, 100, id(consolaMono_bold_30), TextAlign::BASELINE_RIGHT, "%s, ", id(dayoftheweek).state.c_str()); 

and

it.strftime(205, 100, id(consolaMono_bold_30), TextAlign::BASELINE_LEFT, "%d. %B", id(homeassistant_time).now());

first my the day of week in german language, second the date.
first had every day a different lenght

i need something like

it.printf(***** id(dayoftheweek).state.c_str()) +  ***** "%d. %B", id(homeassistant_time).now());

The code here is for your reference.

globals:
  - id: g_month_now
    type: int
    initial_value: '12'
    restore_value: yes  
  - id: g_day_now
    type: int
    initial_value: '1'
    restore_value: yes 

time:
  ### INTERNET TIME
  - platform: sntp
    id: sntp_time
    servers: 
      - ntp1.aliyun.com
    timezone: "Asia/Shanghai"
    on_time_sync:
      then:
        - lambda: |-
            id(g_month_now) = id(sntp_time).now().month;
            id(g_day_now) = id(sntp_time).now().day_of_month;


it.printf(205, 100, id(consolaMono_bold_30), TextAlign::BASELINE_RIGHT, "%s, %d. %d", id(dayoftheweek).state.c_str(), id(g_day_now), id(g_month_now));
1 Like