I am having a similar issue where I cannot get to display a simple text.
I created this in the editor, a simple text box.
The settings for it are:
In my code, I have the following:
display:
- platform: nextion
id: HASwitchPlateNextion
uart_id: uart_nextion
update_interval: 3s
lambda: |-
it.set_wait_for_ack(false);
it.set_component_text("time", "12:22");
I am expecting the 12:22 to be displayed in the text box, but nothing happens.
I am using the HASwitchPlate hardware, so the TX and RX are fine. the display communicates.
The hardware has a power switch for the display, and I turn it on at boot.
#Include the platform used for the hardware
esphome:
name: $id
platform: ESP8266
board: esp01_1m
on_boot:
priority: 200
then:
- output.turn_on: nextion_power
I tried a bunch of priorities.
I am not sure if this is a setup issue I have in the code, or if it is a timing issue with when the display connects and gets the message. I have the update running every 3s, so I assume that if it does not get the update at startup, it should run through it again?
I suspect a timing issue because I get the following:
[23:19:40][C][gpio.output:011]: Pin: GPIO12 (Mode: OUTPUT)
[23:19:40][C][logger:189]: Logger:
[23:19:40][C][logger:190]: Level: DEBUG
[23:19:40][C][logger:191]: Log Baud Rate: 115200
[23:19:40][C][logger:192]: Hardware UART: UART0
[23:19:40][C][nextion:117]: Nextion:
[23:19:40][C][nextion:118]: Device Model: NX3224T024_011R
[23:19:40][C][nextion:119]: Firmware Version: 163
[23:19:40][C][nextion:120]: Serial Number: DE605031C33E3E33
[23:19:40][C][nextion:121]: Flash Size: 4194304
[23:19:40][C][nextion:122]: Wake On Touch: True
[23:19:40][C][captive_portal:148]: Captive Portal:
[23:19:40][C][ota:029]: Over-The-Air Updates:
[23:19:40][C][ota:030]: Address: wall-switch-01.local:8266
[23:19:40][C][ota:032]: Using Password.
[23:19:40][C][api:095]: API Server:
[23:19:40][C][api:096]: Address: wall-switch-01.local:6053
[23:19:40][C][sntp:039]: SNTP Time:
[23:19:40][C][sntp:040]: Server 1: '0.pool.ntp.org'
[23:19:40][C][sntp:041]: Server 2: '1.pool.ntp.org'
[23:19:40][C][sntp:042]: Server 3: '2.pool.ntp.org'
[23:19:40][C][sntp:043]: Timezone: 'CST6CDT5,M3.2.0/2,M11.1.0/2'
[23:19:40][C][homeassistant.sensor:030]: Homeassistant Sensor 'temperature_downstairs'
[23:19:40][C][homeassistant.sensor:030]: State Class: ''
[23:19:40][C][homeassistant.sensor:030]: Unit of Measurement: ''
[23:19:40][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[23:19:40][C][homeassistant.sensor:031]: Entity ID: 'sensor.downstairs_temperature'
[23:19:40][C][homeassistant.sensor:030]: Homeassistant Sensor 'temperature_upstairs'
[23:19:40][C][homeassistant.sensor:030]: State Class: ''
[23:19:40][C][homeassistant.sensor:030]: Unit of Measurement: ''
[23:19:40][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[23:19:40][C][homeassistant.sensor:031]: Entity ID: 'sensor.upstairs_temperature'
[23:19:42][D][nextion:247]: Manually set nextion report ready
[23:19:42][W][nextion:725]: Received unknown event from nextion: 0x40
You can see above that the display is working and is on given the nextion logs. But I am not sure what the last 2 logs are.
If it is a timing issue, is there a way to turn on the display from the display lambda? Meaning turn it on, wait, then run the lambda. I can create a global to keep track of the display being on, so I don’t wait each loop. Thinking traditional MCU and trying to get into ESPHome. Need help!
I went through all of the projects online, but I cannot find a simple one to debug with, so I created one. Doesn’t help if I don’t know if this simple project is a known good one…
Thanks,
H-