Hello,
i am trying to send the temperature from a HA sensor via ESP to my NEXTION display.
The problem is that it shown in the Text label NAN.
Sending static text works fine.
Do you have any idea what I can do?
I´m using the following ESP:
And here my Homeassistant ESP Yaml File
esphome:
name: nextion_32
platform: ESP32
board: esp32dev
wifi:
ssid: !secret wlan_esp_ssid
password: !secret wlan_esp_password
fast_connect: true
# Enable logging
logger:
baud_rate: 0 # Disable UART logging (pins GPIO1/3 are used for Nextion communication)
# Enable Home Assistant API
api:
password: !secret ota_pw
ota:
password: !secret ota_pw
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
time:
- platform: sntp
id: sntp_time
sensor:
- platform: homeassistant # outside temperature
id: temp_outside
entity_id: sensor.netatmo_stonenetti_draussen_temperature
display:
- platform: nextion
id: myTempNexition
update_interval: 5s
lambda: |-
// Do not wait for ack (this delays the whole procedure a lot, and has no use)
it.set_wait_for_ack(false);
it.set_component_text_printf("tempoutside","%.0f",id(temp_outside).state);
it.set_component_text_printf("tempinside","test");
Screenshot form the NEXTION Editor config:
Screenshot form the NEXTION display:
The log of my ESP looks following:
INFO Successfully connected to nextion_32.local
[22:08:03][I][app:105]: ESPHome version 1.15.3 compiled on Dec 16 2020, 21:56:10
[22:08:03][C][wifi:443]: WiFi:
[22:08:03][C][wifi:303]: SSID: 'XXXX[redacted]
[22:08:03][C][wifi:304]: IP Address: XXXXX
[22:08:03][C][wifi:306]: BSSID: XXXXX[redacted]
[22:08:03][C][wifi:307]: Hostname: 'nextion_32'
[22:08:03][C][wifi:311]: Signal strength: -60 dB ▂▄▆█
[22:08:03][C][wifi:315]: Channel: X
[22:08:03][C][wifi:316]: Subnet: XXX
[22:08:03][C][wifi:317]: Gateway: XXX
[22:08:03][C][wifi:318]: DNS1: XXX
[22:08:03][C][wifi:319]: DNS2: XXX
[22:08:03][C][uart_esp32:088]: UART Bus:
[22:08:03][C][uart_esp32:090]: TX Pin: GPIO1
[22:08:03][C][uart_esp32:093]: RX Pin: GPIO3
[22:08:03][C][uart_esp32:094]: RX Buffer Size: 256
[22:08:03][C][uart_esp32:096]: Baud Rate: 9600 baud
[22:08:03][C][uart_esp32:097]: Data Bits: 8
[22:08:03][C][uart_esp32:098]: Parity: NONE
[22:08:03][C][uart_esp32:099]: Stop bits: 1
[22:08:03][C][logger:185]: Logger:
[22:08:03][C][logger:186]: Level: DEBUG
[22:08:03][C][logger:187]: Log Baud Rate: 0
[22:08:03][C][logger:188]: Hardware UART: UART0
[22:08:03][C][ota:029]: Over-The-Air Updates:
[22:08:03][C][ota:030]: Address: nextion_32.local:3232
[22:08:03][C][ota:032]: Using Password.
[22:08:03][C][api:095]: API Server:
[22:08:03][C][api:096]: Address: nextion_32.local:6053
[22:08:03][C][sntp:039]: SNTP Time:
[22:08:03][C][sntp:040]: Server 1: '0.pool.ntp.org'
[22:08:03][C][sntp:041]: Server 2: '1.pool.ntp.org'
[22:08:03][C][sntp:042]: Server 3: '2.pool.ntp.org'
[22:08:03][C][sntp:043]: Timezone: 'CET-1CEST-2,M3.4.0/2,M10.5.0/3'
[22:08:03][C][homeassistant.sensor:024]: Homeassistant Sensor 'temp_outside'
[22:08:03][C][homeassistant.sensor:024]: Unit of Measurement: ''
[22:08:03][C][homeassistant.sensor:024]: Accuracy Decimals: 1
[22:08:03][C][homeassistant.sensor:025]: Entity ID: 'sensor.netatmo_stonenetti_draussen_temperature'