[SOLVED] Change text on lcd display

Hello everyone
I am asking for support for a project of mine at home, I want to change the text on the LCD display when a button is pressed or the relay status changes.
I have already written part of the program and everything is ok but I can’t successfully integrate the text change on the display
I attach part of the script I use
Thanks for the help

binary_sensor:

  • platform: gpio

    name: “ON/OFF Caldaia”

    id: ON_OFF

    pin:
    number: GPIO0
    mode:
    input: true
    pullup: true
    inverted: true
    name: “ON/OFF Caldaia”
    on_press:
    • switch.toggle: relay_caldaia

switch:

  • platform: gpio
    name: “Start Stop”
    pin: GPIO2
    id: relay_caldaia

display:

  • platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x38
    lambda: |-
    it.strftime(0, 0,“%H:%M - %d.%m.%y”, id(my_time).now());
    it.printf(0, 1,“%.1fC”, id(temperatura).state);
    it.printf(6, 1,“%.1f%%”, id(umid).state);
    update_interval: 10s

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

solved this way

display:

  • platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x38
    update_interval: 1s
    lambda: |-
    it.strftime(0, 0,“%H:%M - %d.%m.%y”, id(my_time).now());
    it.printf(0, 1,“%.1fC”, id(temperatura).state);
    it.printf(6, 1,“%.1f%%”, id(umid).state);
    if (id(relay_caldaia).state) {it.print(12, 1, "ON ");}
    else {it.print(12, 1, “OFF”);}