esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Can't update color on Nextion button #915

Closed carlos-sarmiento closed 4 years ago

carlos-sarmiento commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.): Latest Docker

ESP (ESP32/ESP8266, Board/Sonoff): ESP32, but I don't think it is related to the Board

Affected component: Nextion Display.

Description of problem: I'm trying to change the foreground color of a button using the nextion lambda. When running the code the color doesn't change. Everything else with the nextion works correctly (updating text and touch inputs)

Problem-relevant YAML-configuration entries:


display:
  - platform: nextion
    update_interval: 1s
    lambda: |-
      it.set_component_text_printf("currentTemp", "%.1f", id(dry_age_temp).state);
      it.set_component_text_printf("daysAged", "%.0f", id(dry_age_60d).state);

      if (id(dry_age_fan).state == "on") {
        it.set_component_text("fanToggle", "ON");
        it.set_component_font_color("fanToggle", "63305");
      } else {
        it.set_component_text("fanToggle", "OFF");
        it.set_component_font_color("fanToggle", "44373");
      }

      if (id(dry_age_light).state == "on") {
        it.set_component_text("lightToggle", "ON");
        it.set_component_font_color("lightToggle", "63305");
      } else {
        it.set_component_text("lightToggle", "OFF");
        it.set_component_font_color("lightToggle", "44373");
      }

Logs (if applicable):

[08:00:50][W][nextion:182]: Nextion reported failed to assign variable!
[08:00:50][W][nextion:036]: Waiting for ACK timed out!
[08:00:50][W][nextion:083]: Sending command 'fanToggle.pco="63305"' failed because no ACK was received

Additional information and things you've tried:

carlos-sarmiento commented 4 years ago

Found the problem... Submitted a PR