No text is displayed / nextion_return_data Invalid Variable name or attribute
I had a very old HASPone sitting around that I finally installed, my guess these issues relate to older hardware but I'm not sure. Hopefully someone can point me toward additional debug steps or a firmware update I missed. Thank you in advance for any assistance!
The device does not display any text and no blueprints other than core appear to work.
I've updated to the latest firmware 1.06 and applied the LCD update for LCD model NX3224F024_011R
I am able to switch between the pages using home assistant and it does change the layout, but no text appears on the bottom row as it should. Adding blueprints appears to work, but they have no effect and do not display.
Using telnet debug, I see the below errors displayed (I named the device kitchen_switch):
'hasp/kitchen_switch/state/json' : '{"event":"nextion_return_data","return_code":"0x1a","return_code_description":"Invalid Variable name or attribute"}'
The webpage shows this debug info:
MQTT Status: Connected
MQTT ClientID: kitchen_switch-4c75251ad8b
HASPone FW Version: 1.06
LCD Model: NX3224F024_011R
LCD FW Version: 3
LCD Active Page: 1
LCD Serial Speed: 115200
CPU Frequency: 160MHz
Sketch Size: 672144 bytes
Free Sketch Space: 2469888 bytes
Heap Free: 17432
Heap Fragmentation: 11
ESP core version: 3.1.2
IP Address: 192.168.1.52
Signal Strength: -64
The screen appears like:
Oh and I forgot to mention that the firmware update url site haswitchplate.com seems to be down, I downloaded firmware from https://github.com/HASwitchPlate/HASPone/raw/b2c263eee772071df3abd3b464ad38737e848bfa/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin and https://github.com/HASwitchPlate/HASPone/tree/main/Nextion_HMI and uploaded them to the device page
I ran into the same issue and, after a little bit of debugging, discovered that it was because my HA instance had, for some reason, reset the states of the four light.hasplate1_{un,}selected_{back,fore}ground_color entities, such that https://github.com/HASwitchPlate/HASPone/blob/7cca66b8f552cc0d369d486e84e2a31b8c720840/Home_Assistant/blueprints/hasp_Core_Functionality.yaml#L608-L610 was throwing an attribute error during template expansion. Using the developer console to reset those got the thing working again.
Probably that hunk (and the ones like it throughout the source tree) should instead be something like
{%- set rgb=(state_attr(color.source, "rgb_color")|default([0,0,0]) -%}
{%- set red=(rgb[0] * brightness)|int -%}
{%- set green=(rgb[1] * brightness)|int -%}
{%- set blue=(rgb[2] * brightness)|int -%}
for whatever it's worth, the option "First-time HASP setup or reset" in the Core Functionality blueprint will re-create these devices for you in the event they wind up missing.
Details: https://github.com/HASwitchPlate/HASPone/wiki/Fix-common-HASPone-issues#re-run-core-functionality-first-time-hasp-setup-or-reset