Error rendering data template - Solved! #89
michelcmorel
started this conversation in
General
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Update: this error is solved just so you know at the bottom of this page are my findings.
Hi there,
After I run the core functionality blueprint the first time, save and run action. Each time i get:
Error rendering data template: UndefinedError: None has no element 0
In the home assistant logs I get the following:
2021-04-28 00:48:41 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality] HASP Core functionality: Choose at step 1: choice 1: Error executing script. Error for call_service at pos 8: Error rendering data template: UndefinedError: None has no element 0
2021-04-28 00:48:41 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality] HASP Core functionality: Error executing script. Error for choose at pos 1: Error rendering data template: UndefinedError: None has no element 0
2021-04-28 00:48:41 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality] Error while executing automation automation.hasp_core_functionality: Error rendering data template: UndefinedError: None has no element 0
Would anyone know if this is an issue with my setup or any pointers would be appreciated please?
Thanks!
28.4.21 update
I noticed also that when I click on run action, I did not get any notification of the yaml code. But MQTT has discovered the device. The arrow buttons to change the page are not visible meaning they do not appear (I guess since I can't see those initial page setup on the screen that makes sense), and the nextion page has the wifi connected & MQTT connected text.
I tried to roll back and ran a snapshot and did all the steps again to get to the same bottle neck issue.
In the trace timeline it looks like the script did not have a chance to start.
Update:
I think I have found the source of the error, anyone would know this error code?
Update:
So I solved this issue and might as well share my findings in case this can help someone else.
To start with I needed to get more debug information so to troubleshoot the issue better. I'm on a mac so I tried to "telnet" in my arduino IP, that did not work. I tried nc (netcat) in terminal that did not work for me even though I could connect successfully I could not get any debug info to appear. I ended up using esphomeflasher to read the debug log information, since my arduino is connected to my mac using usb connection the esphomeflasher will display the debug log info if you click on view logs.
I found that there was some error between my nextion and arduino so I figured out to start again with flashing nextion using an old pc latpop that i used initially to format the micro sd card. So I did that again, flash it. (Just use the red and black wires to flash it, do not connnect the communication wires (yellow, blue) to arduino yet. Then once the flash is done I connected the yellow to D4 & blue wire to D7 on the arduino. Then I rebooted everything, HA, arduino and the nextion screen.
This time in esphomeflasher logs I could see that the communication was established correctly without any errors. I then went on the import core functionality blueprint on haspone repo and then save, ran the blueprint, the logs show that the nextion was receiving the information without any errors, but when looking at my home assistant config logs (/config/home-assistant.log) I was still getting the same error "2021-04-28 20:57:26 ERROR (MainThread) [homeassistant.components.automation.hasp_core_functionality_4] Error while executing automation automation.hasp_core_functionality_4: Error rendering data template: UndefinedError: None has no element 0".
So I went on haspone github page and this time imported the black template (HASP Theme Light on Dark) located at https://github.com/HASwitchPlate/HASPone/tree/main/Home_Assistant/blueprints. then ran the blueprint, but still nothing appeared, at that point I started tapping on the nextion screen and the page just appeared.
And now it appears to be working, I ran a lights on/off and working well :)
Beta Was this translation helpful? Give feedback.
All reactions