LCD PCF8574 no backlight on power on desired

Hello everybody,
I have a 1602 LCD with PCF8574 connected to a nodemcu v3 (lolin).
When the device is powered up the backlight is on by default.
I managed to implement some switches for the backlight() and no_backlight() but i want the backlight to stay off when the device powers up.
Is there anything that can be done?

Use the on_boot trigger to turn the backlight off at start up.

esphome:
  # ...
  on_boot:
    priority: -10
    # ...
    then:
      lambda: !lambda |-
        id(my_lcd).backlight();
  on_shutdown:
    then:
      lambda: !lambda |-
        id(my_lcd).no_backlight();

Iā€™m pretty new / late to esphome but just got this working for me on my d1mini.

1 Like