Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.43k stars 259 forks source link

`BUG` Custom buttons not showing on screen #1660

Closed philbart closed 9 months ago

philbart commented 9 months ago

TFT Version

4.2.1

ESPHome Version

4.2.1

Blueprint Version

4.2.1

Panel Model

NSPanel EU Model

What is the bug?

Icons for custom buttons from blueprint not displayed on screen

Steps to Reproduce

Set custom button entities in blueprint. I have tried both arduino and esp-idf frameworks flashed over serial. I have tried media player and light entities with default and custom icons but nothing allows them to display. I have tried on 2 different panels and this was previously working in an older version

image image image image

Your panel's YAML

See screenshot above

ESPHome logs

INFO ESPHome 2023.12.6
INFO Reading configuration /config/esphome/nspanelkitchen.yaml...
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@main
INFO Updating https://github.com/esphome/esphome.git@pull/6051/head
INFO Detected timezone 'Europe/London'
INFO Starting log output from 192.168.0.201 using esphome API
INFO Successfully connected to nspanelkitchen @ 192.168.0.201 in 0.015s
INFO Successful handshake with nspanelkitchen @ 192.168.0.201 in 0.046s
[00:26:05][I][app:102]: ESPHome version 2023.12.5 compiled on Jan 15 2024, 15:10:04
[00:26:05][C][wifi:573]: WiFi:
[00:26:05][C][wifi:405]:   Local MAC: B8:D6:1A:68:7F:74
[00:26:05][C][wifi:410]:   SSID: [redacted]
[00:26:05][C][wifi:411]:   IP Address: 192.168.0.201
[00:26:05][C][wifi:413]:   BSSID: [redacted]
[00:26:05][C][wifi:414]:   Hostname: 'nspanelkitchen'
[00:26:05][C][wifi:416]:   Signal strength: -64 dB ▂▄▆█
[00:26:05][C][wifi:420]:   Channel: 1
[00:26:05][C][wifi:421]:   Subnet: 255.255.255.0
[00:26:05][C][wifi:422]:   Gateway: 192.168.0.1
[00:26:05][C][wifi:423]:   DNS1: 194.168.4.100
[00:26:05][C][wifi:424]:   DNS2: 194.168.8.100
[00:26:06][C][logger:443]: Logger:
[00:26:06][C][logger:444]:   Level: DEBUG
[00:26:06][C][logger:445]:   Log Baud Rate: 0
[00:26:06][C][logger:447]:   Hardware UART: UART0
[00:26:06][C][uart.arduino_esp32:137]: UART Bus 0:
[00:26:06][C][uart.arduino_esp32:138]:   TX Pin: GPIO16
[00:26:06][C][uart.arduino_esp32:139]:   RX Pin: GPIO17
[00:26:06][C][uart.arduino_esp32:141]:   RX Buffer Size: 256
[00:26:06][C][uart.arduino_esp32:143]:   Baud Rate: 115200 baud
[00:26:06][C][uart.arduino_esp32:144]:   Data Bits: 8
[00:26:06][C][uart.arduino_esp32:145]:   Parity: NONE
[00:26:06][C][uart.arduino_esp32:146]:   Stop bits: 1
[00:26:06][C][ledc.output:164]: LEDC Output:
[00:26:06][C][ledc.output:165]:   Pin GPIO21
[00:26:06][C][ledc.output:166]:   LEDC Channel: 0
[00:26:06][C][ledc.output:167]:   PWM Frequency: 1000.0 Hz
[00:26:06][C][ledc.output:168]:   Bit depth: 16
[00:26:06][C][template.binary_sensor:028]: Template Binary Sensor 'nspanelkitchen Nextion display'
[00:26:06][C][template.binary_sensor:028]:   Device Class: 'connectivity'
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Display Brightness'
[00:26:06][C][template.number:050]:   Unit of Measurement: '%'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Display Brightness Dimdown'
[00:26:06][C][template.number:050]:   Unit of Measurement: '%'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Display Brightness Sleep'
[00:26:06][C][template.number:050]:   Unit of Measurement: '%'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Temperature Correction'
[00:26:06][C][template.number:050]:   Unit of Measurement: '°C'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Timeout Page'
[00:26:06][C][template.number:050]:   Icon: 'mdi:timer'
[00:26:06][C][template.number:050]:   Unit of Measurement: 's'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Timeout Dimming'
[00:26:06][C][template.number:050]:   Icon: 'mdi:timer'
[00:26:06][C][template.number:050]:   Unit of Measurement: 's'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.number:050]: Template Number 'nspanelkitchen Timeout Sleep'
[00:26:06][C][template.number:050]:   Icon: 'mdi:timer'
[00:26:06][C][template.number:050]:   Unit of Measurement: 's'
[00:26:06][C][template.number:051]:   Optimistic: YES
[00:26:06][C][template.number:052]:   Update Interval: 60.0s
[00:26:06][C][template.select:065]: Template Select 'nspanelkitchen Baud rate'
[00:26:06][C][template.select:065]:   Icon: 'mdi:swap-horizontal'
[00:26:06][C][template.select:066]:   Update Interval: 60.0s
[00:26:06][C][template.select:069]:   Optimistic: YES
[00:26:06][C][template.select:070]:   Initial Option: 115200
[00:26:06][C][template.select:071]:   Restore Value: YES
[00:26:06][C][template.select:065]: Template Select 'nspanelkitchen Wake-up page'
[00:26:06][C][template.select:065]:   Icon: 'mdi:page-next-outline'
[00:26:06][C][template.select:066]:   Update Interval: 60.0s
[00:26:06][C][template.select:069]:   Optimistic: YES
[00:26:06][C][template.select:070]:   Initial Option: home
[00:26:06][C][template.select:071]:   Restore Value: YES
[00:26:06][C][template.select:065]: Template Select 'nspanelkitchen Update TFT display - Branch'
[00:26:06][C][template.select:065]:   Icon: 'mdi:file-sync'
[00:26:06][C][template.select:066]:   Update Interval: 60.0s
[00:26:06][C][template.select:069]:   Optimistic: YES
[00:26:06][C][template.select:070]:   Initial Option: main
[00:26:06][C][template.select:071]:   Restore Value: YES
[00:26:06][C][template.select:065]: Template Select 'nspanelkitchen Update TFT display - Model'
[00:26:06][C][template.select:065]:   Icon: 'mdi:file-sync'
[00:26:06][C][template.select:066]:   Update Interval: 60.0s
[00:26:06][C][template.select:069]:   Optimistic: YES
[00:26:06][C][template.select:070]:   Initial Option: Use nextion_update_url
[00:26:06][C][template.select:071]:   Restore Value: YES
[00:26:06][C][template.text_sensor:020]: Template Sensor 'nspanelkitchen Detailed Entity'
[00:26:06][C][template.text_sensor:020]:   Icon: 'mdi:tablet-dashboard'
[00:26:06][C][template.text_sensor:020]: Template Sensor 'nspanelkitchen Current page'
[00:26:06][C][template.text_sensor:020]:   Icon: 'mdi:tablet-dashboard'
[00:26:06][C][template.text_sensor:020]: Template Sensor 'nspanelkitchen Notification Label'
[00:26:06][C][template.text_sensor:020]: Template Sensor 'nspanelkitchen Notification Text'
[00:26:06][C][switch.gpio:068]: GPIO Switch 'nspanelkitchen Relay 1'
[00:26:06][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[00:26:06][C][switch.gpio:031]:   Pin: GPIO22
[00:26:06][C][switch.gpio:068]: GPIO Switch 'nspanelkitchen Relay 2'
[00:26:06][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[00:26:06][C][switch.gpio:031]:   Pin: GPIO19
[00:26:07][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'nspanelkitchen Left Button'
[00:26:07][C][gpio.binary_sensor:016]:   Pin: GPIO14
[00:26:07][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'nspanelkitchen Right Button'
[00:26:07][C][gpio.binary_sensor:016]:   Pin: GPIO27
[00:26:07][C][switch.gpio:068]: GPIO Switch 'nspanelkitchen Nextion display - Power'
[00:26:07][C][switch.gpio:091]:   Restore Mode: always ON
[00:26:07][C][switch.gpio:031]:   Pin: GPIO4
[00:26:07][C][template.switch:068]: Template Switch 'nspanelkitchen Notification sound'
[00:26:07][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[00:26:07][C][template.switch:057]:   Optimistic: YES
[00:26:07][C][template.switch:068]: Template Switch 'nspanelkitchen Relay 1 Local'
[00:26:07][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[00:26:07][C][template.switch:057]:   Optimistic: YES
[00:26:07][C][template.switch:068]: Template Switch 'nspanelkitchen Relay 2 Local'
[00:26:07][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[00:26:07][C][template.switch:057]:   Optimistic: YES
[00:26:07][C][template.switch:068]: Template Switch 'nspanelkitchen Notification unread'
[00:26:07][C][template.switch:091]:   Restore Mode: always OFF
[00:26:07][C][template.switch:057]:   Optimistic: YES
[00:26:07][C][rtttl:029]: Rtttl
[00:26:08][C][nextion:128]: Nextion:
[00:26:08][C][nextion:129]:   Device Model:     NX4832F035_011C
[00:26:08][C][nextion:130]:   Firmware Version: 72
[00:26:08][C][nextion:131]:   Serial Number:    51B0340104BA764F
[00:26:08][C][nextion:132]:   Flash Size:       16777216
[00:26:08][C][nextion:133]:   Wake On Touch:    YES
[00:26:08][C][nextion:134]:   Exit reparse:     YES
[00:26:08][C][restart.button:017]: Restart Button 'nspanelkitchen Restart'
[00:26:08][C][adc:097]: ADC Sensor 'ntc_source'
[00:26:08][C][adc:097]:   Device Class: 'voltage'
[00:26:08][C][adc:097]:   State Class: 'measurement'
[00:26:08][C][adc:097]:   Unit of Measurement: 'V'
[00:26:08][C][adc:097]:   Accuracy Decimals: 2
[00:26:08][C][adc:107]:   Pin: GPIO38
[00:26:08][C][adc:122]:  Attenuation: 11db
[00:26:08][C][adc:142]:   Update Interval: 60.0s
[00:26:08][C][resistance:010]: Resistance Sensor 'resistance_sensor'
[00:26:08][C][resistance:010]:   State Class: 'measurement'
[00:26:08][C][resistance:010]:   Unit of Measurement: 'Ω'
[00:26:08][C][resistance:010]:   Accuracy Decimals: 1
[00:26:08][C][resistance:010]:   Icon: 'mdi:flash'
[00:26:08][C][resistance:011]:   Configuration: DOWNSTREAM
[00:26:08][C][resistance:012]:   Resistor: 11200.00Ω
[00:26:08][C][resistance:013]:   Reference Voltage: 3.3V
[00:26:08][C][ntc:014]: NTC Sensor 'nspanelkitchen Temperature'
[00:26:08][C][ntc:014]:   Device Class: 'temperature'
[00:26:08][C][ntc:014]:   State Class: 'measurement'
[00:26:08][C][ntc:014]:   Unit of Measurement: '°C'
[00:26:08][C][ntc:014]:   Accuracy Decimals: 1
[00:26:08][C][homeassistant.time:010]: Home Assistant Time:
[00:26:08][C][homeassistant.time:011]:   Timezone: 'GMT0BST,M3.5.0/1,M10.5.0'
[00:26:08][C][status:034]: Status Binary Sensor 'nspanelkitchen Status'
[00:26:08][C][status:034]:   Device Class: 'connectivity'
[00:26:09][C][mdns:115]: mDNS:
[00:26:09][C][mdns:116]:   Hostname: nspanelkitchen
[00:26:10][C][ota:097]: Over-The-Air Updates:
[00:26:10][C][ota:098]:   Address: nspanelkitchen.local:3232
[00:26:10][C][ota:101]:   Using Password.
[00:26:10][C][api:139]: API Server:
[00:26:10][C][api:140]:   Address: nspanelkitchen.local:6053
[00:26:10][C][api:144]:   Using noise encryption: NO
[00:26:10][C][wifi_signal.sensor:009]: WiFi Signal 'nspanelkitchen RSSI'
[00:26:10][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[00:26:10][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[00:26:10][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[00:26:10][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[00:26:10][D][sensor:094]: 'nspanelkitchen RSSI': Sending state -64.00000 dBm with 0 decimals of accuracy
[00:26:19][D][sensor:094]: 'ntc_source': Sending state 2.12600 V with 2 decimals of accuracy
[00:26:19][D][resistance:039]: 'resistance_sensor' - Resistance 20282.1Ω
[00:26:19][D][sensor:094]: 'resistance_sensor': Sending state 20282.11133 Ω with 1 decimals of accuracy
[00:26:19][D][ntc:026]: 'nspanelkitchen Temperature' - Temperature: 9.9°C
[00:26:19][D][sensor:094]: 'nspanelkitchen Temperature': Sending state 9.89214 °C with 1 decimals of accuracy
[00:26:20][I][addon_upload_tft.script.report_settings:189]: TFT URL: https://192.168.0.153/local/-nspaneleu.tft
[00:26:20][I][addon_upload_tft.script.report_settings:190]: Substitutions:
[00:26:20][I][addon_upload_tft.script.report_settings:191]:   nextion_update_url:        https://192.168.0.153/local/-nspaneleu.tft
[00:26:20][I][addon_upload_tft.script.report_settings:192]:   nextion_update_base_url:   https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/
[00:26:20][I][addon_upload_tft.script.report_settings:193]:   upload_tft_chunk_size_max: 32768
[00:26:20][I][addon_upload_tft.script.report_settings:194]:   upload_tft_baud_rate:      921600
[00:26:30][I][script.watchdog:3103]: Wi-Fi:         Fair (-64 dBm)
[00:26:30][I][script.watchdog:3123]: API:           Connected
[00:26:30][I][script.watchdog:3141]: Blueprint:     4.2.1
[00:26:30][I][script.watchdog:3154]: ESPHome:
[00:26:30][I][script.watchdog:3155]:   Version:     4.2.1
[00:26:30][I][script.watchdog:3158]:   Framework:   arduino
[00:26:30][I][script.watchdog:3164]: UART:
[00:26:30][I][script.watchdog:3165]:   Baud rate:   115200 bps
[00:26:30][I][script.watchdog:3166]:   Queue size:  8
[00:26:30][I][script.watchdog:3170]: Nextion:
[00:26:30][I][script.watchdog:3171]:   Queue size:  2
[00:26:30][I][script.watchdog:3173]:   Is setup:    True
[00:26:30][I][script.watchdog:3180]:   Init:        True
[00:26:30][I][script.watchdog:3188]:   TFT:         4.2.1
[00:26:30][W][component:214]: Component time took a long time for an operation (0.05 s).
[00:26:30][W][component:215]: Components should block for at most 20-30ms.

Home Assistant logs

See screenshot above
edwardtfn commented 9 months ago

I have some changes already on dev that probably will solve this, but it requires some testing. Please let me know if you have a chance to try that.

smarthomefamilyverrips commented 9 months ago

@edwardtfn I assume is related but just to report at me "chips" are not showing on the "home screen", I have all components updated to 4.2.2 and am on ESPHome 2023.12.7

also have following errors in logs:

Logger: homeassistant.components.automation.nsbathroom_configuration_new Source: components/automation/init.py:690 Integration: Automation (documentation, issues) First occurred: 13:20:06 (27 occurrences) Last logged: 14:20:06

Error while executing automation automation.nsbathroom_configuration_new: TypeError: argument of type 'NoneType' is not iterable

AND:

Logger: homeassistant.components.automation.nsbathroom_configuration_new Source: helpers/script.py:1792 Integration: Automation (documentation, issues) First occurred: 13:20:06 (110 occurrences) Last logged: 14:20:06

NSBathroom Configuration New: Main choices: NSPanel event: Choose at step 2: Page changed: Error executing script. Error rendering template for choose at pos 1: TypeError: argument of type 'NoneType' is not iterable NSBathroom Configuration New: Main choices: NSPanel event: Error executing script. Error rendering template for choose at pos 2: TypeError: argument of type 'NoneType' is not iterable NSBathroom Configuration New: Error executing script. Error rendering template for choose at pos 2: TypeError: argument of type 'NoneType' is not iterable NSBathroom Configuration New: Main choices: Climate - Sync: If at step 1: Error executing script. Error rendering template for variables at pos 2: TypeError: argument of type 'NoneType' is not iterable NSBathroom Configuration New: Main choices: Climate - Sync: Error executing script. Error rendering template for if at pos 1: TypeError: argument of type 'NoneType' is not iterable

philbart commented 9 months ago

I can confirm expected behaviour returns on the following versions on arduino and esp-idf:

TFT: 4.2.3dev ESPHome: 4.2.2 Blueprint: 4.2.3dev

I don’t usually use chips so didn’t notice the issue however, a quick check with the with a light entity seems to show them working correctly on this version also in answer to smarthomefamilyverrips comment.

thanks

edwardtfn commented 9 months ago

Anything in your Home Assistant logs (Settings > System > Logs)?

edwardtfn commented 9 months ago

I can confirm expected behaviour returns on the following versions on arduino and esp-idf

I'm unsure if I got your message here... Is the system working as expected? No bugs anymore?

smarthomefamilyverrips commented 9 months ago

I can confirm expected behaviour returns on the following versions on arduino and esp-idf

I'm unsure if I got your message here... Is the system working as expected? No bugs anymore?

@edwardtfn I can not say for sure of course, but that is the way I read it yes.... with your fixes in dev all works as expected again and no more bugs present.... to be sure we will need to wait for answer of @philbart 😉

philbart commented 9 months ago

Yes correct dev fixed this thank you

edwardtfn commented 9 months ago

v4.2.3 was released. Please let me know if that was fixed, otherwise we can reopen this.

smarthomefamilyverrips commented 9 months ago

v4.2.3 was released. Please let me know if that was fixed, otherwise we can reopen this.

@edwardtfn unfortunately I will not be able to try before tomorrow end of afternoon at the soonest, but when I did I will drop a message here with the outcome. Thanks for your efforts!

philbart commented 9 months ago

I can confirm I have tested with 4.2.4 and the custom buttons and chips appear as expected thank you. I have however now lost the weather icons and details but I’ll log another bug for that if it occurs on my other panels. Thanks for fixing this bug

smarthomefamilyverrips commented 9 months ago

@edwardtfn I did update all components to 4.2.4 and all works again, so this patch did fix the issues for me! Thanks again! 👍