HA SwitchPlate HASPone: DIY In-Wall Touchscreen Home Assistant Controller

Outstanding…thank you Luma! As I am new to HA SwitchPlate, riddle me this: is it normal for the install process to automatically create a number of automations (134 in total) that are not editable and most that have never been triggered? (see pic 1 as example). Additionally, in the MQTT broker configuration, even though I have assigned a number of automations to my SwitchPlate instance name “desktop” via Blueprints (and they are working fine), it doesn’t show any. (see pic 2)


That is normal if you run the old process. The setup instructions you’ll want to follow are here. Given that you’ve run the old process, you’ll also want to run step 1 of this page here to clear out the pre-1.0 HASPone components that were deployed when you ran deployhasp.sh.

edit: just added a warning to deployhasp.sh to add the information above in case anyone else runs into this.

Step 1 did the trick, however, when opening the webpage (step 2), there is no indication of a “HASP Update available” on the screen. I still see
the regular menus.

Yup, you just needed step 1 as you were already running the new firmware.

Thanks again!

Got 4 of those wt32-sc01’s as well. Got as far as a hello world button via their drag&drop “code editor”.
Definitely think these have some potential for HA community…

Have you done anything cool with them yet, @xHirscHx?

1 Like

New process / new software has made this so much easier. And set up with blueprints has made this very accessible even to a noob like me. Thanks @luma, this is great!

Also truly enjoyed seeing/listening on Dr Zzz’s show - you’ve got some on-screen charisma there. More please!

1 Like

Hi - I’m also getting this in my log. Did you find an solution?

Go back to the blueprint, hit the dropdown on the menu, and make sure your HASP is selected there. Hit Save and then Run Actions and see if the error persists.

Hi luma - thanks for your reply. I tried but decided to delete all HASP blutprints and automations and start all over again. I think I mess it up.
Again great job on the HASP I had a great (custom) setup on my nextion 3,5" display and will now try to set it up again in HA.

Hi

I tried disabling USB serial debug output enabled feature from web UI as luma instructed in Dr. Zzz’s video but I ended up in an error loop (see below). LCD screen is stuck on “HASP Initializing”. This happened already for both D1 mini and D1 mini Pro. Also tried re-flashing them but it didn’t help. I had to take a new Wemos to get things working again. What could be causing this? A bug in the web UI or something else? I’m running HASP 1.01. I’m now too scared to try disabling that third time…

serial output
12:37:40.440 -> ================================================================================
12:37:40.440 -> [+0.069s] SYSTEM: Starting HASwitchPlate v1.01
12:37:40.440 -> [+0.075s] SYSTEM: Last reset reason: Fatal exception:0 flag:2 (Exception) epc1:0x4000e25d epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
12:37:40.474 -> [+0.089s] SYSTEM: heapFree: 29016 heapMaxFreeBlockSize: 28856
12:37:40.474 -> Crash information recovered from EEPROM
12:37:40.474 -> Crash # 1 at 387 ms
12:37:40.474 -> Restart reason: 2
12:37:40.474 -> Exception cause: 0
12:37:40.474 -> epc1=0x4000e25d epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
12:37:40.474 -> >>>stack>>>
12:37:40.508 -> 3ffffea0: 3fff5a8c 3fffff20 402388b8 00000000 
12:37:40.508 -> 3ffffeb0: 4022f352 40101227 3fff245c 4022f459 
12:37:40.508 -> 3ffffec0: 0000001c 00000000 00000000 00000000 
12:37:40.508 -> 3ffffed0: 00000003 4022f7f1 ffffffff 00000001 
12:37:40.508 -> 3ffffee0: 3ffe8510 00000001 3fff0bb0 3f8147ae 
12:37:40.508 -> 3ffffef0: 00000000 00000001 3fff0bb0 4022a19c 
12:37:40.508 -> 3fffff00: 00000000 3fff2400 000d000f 3f8147ae 
12:37:40.508 -> 3fffff10: 00000000 0000001c 00000000 4023c91c 
12:37:40.544 -> 3fffff20: 3fffdad0 3ffe8510 3fff0bb0 402027b8 
12:37:40.544 -> 3fffff30: 3fffdad0 3fffff60 3fff0b90 402150a6 
12:37:40.544 -> 3fffff40: 3fff2400 0052005f 80efeffe feefeffe 
12:37:40.544 -> 3fffff50: 3fff2400 0017001f 80efeffe feefeffe 
12:37:40.544 -> 3fffff60: 3fff4f00 0033003f 80efeffe feefeffe 
12:37:40.544 -> 3fffff70: 31303900 feef0036 80efeffe 3fff2400 
12:37:40.544 -> 3fffff80: 0012001f 80efeffe feefeffe feefeffe 
12:37:40.544 -> 3fffff90: feefeffe feefeffe feefeffe 3fff0d0c 
12:37:40.582 -> 3fffffa0: 3fffdad0 00000000 3fff0ccc 4022d00c 
12:37:40.582 -> 3fffffb0: feefeffe feefeffe 3ffe8588 40100701 
12:37:40.582 -> <<<stack<<<
12:37:40.582 -> EEPROM space available: 0x00bb bytes
12:37:40.621 -> ================================================================================
12:37:40.621 -> 
12:37:40.621 -> [+0.250s] SPIFFS: mounting SPIFFS
12:37:40.654 -> [+0.268s] SPIFFS: reading /config.json
12:37:40.654 -> 
12:37:40.654 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
12:37:40.654 -> 
12:37:40.654 -> Exception (0):
12:37:40.654 -> epc1=0x4000e25d epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
12:37:40.687 -> 
12:37:40.687 -> >>>stack>>>
12:37:40.687 -> 
12:37:40.687 -> ctx: cont
12:37:40.687 -> sp: 3ffffd10 end: 3fffffc0 offset: 0190
12:37:40.687 -> 3ffffea0:  3fff5a8c 3fffff20 402388b8 00000000  
12:37:40.687 -> 3ffffeb0:  4022f352 40101227 3fff245c 4022f459  
12:37:40.687 -> 3ffffec0:  0000001c 00000000 00000000 00000000  
12:37:40.687 -> 3ffffed0:  00000003 4022f7f1 ffffffff 00000001  
12:37:40.687 -> 3ffffee0:  3ffe8510 00000001 3fff0bb0 3f8147ae  
12:37:40.687 -> 3ffffef0:  00000000 00000001 3fff0bb0 4022a19c  
12:37:40.720 -> 3fffff00:  00000000 3fff2400 000d000f 3f8147ae  
12:37:40.720 -> 3fffff10:  00000000 0000001c 00000000 4023c91c  
12:37:40.720 -> 3fffff20:  3fffdad0 3ffe8510 3fff0bb0 402027b8  
12:37:40.720 -> 3fffff30:  3fffdad0 3fffff60 3fff0b90 402150a6  
12:37:40.720 -> 3fffff40:  3fff2400 0052005f 80efeffe feefeffe  
12:37:40.720 -> 3fffff50:  3fff2400 0017001f 80efeffe feefeffe  
12:37:40.720 -> 3fffff60:  3fff4f00 0033003f 80efeffe feefeffe  
12:37:40.720 -> 3fffff70:  31303900 feef0036 80efeffe 3fff2400  
12:37:40.755 -> 3fffff80:  0012001f 80efeffe feefeffe feefeffe  
12:37:40.755 -> 3fffff90:  feefeffe feefeffe feefeffe 3fff0d0c  
12:37:40.755 -> 3fffffa0:  3fffdad0 00000000 3fff0ccc 4022d00c  
12:37:40.755 -> 3fffffb0:  feefeffe feefeffe 3ffe8588 40100701  
12:37:40.755 -> <<<stack<<<
12:37:40.755 -> 
12:37:40.755 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
12:37:40.823 -> 
12:37:40.823 ->  ets Jan  8 2013,rst cause:2, boot mode:(3,7)
12:37:40.823 -> 
12:37:40.823 -> load 0x4010f000, len 3584, room 16 
12:37:40.823 -> tail 0
12:37:40.823 -> chksum 0xb0
12:37:40.823 -> csum 0xb0
12:37:40.823 -> v2843a5ac
12:37:40.860 -> ~ld
12:37:40.860 -> ⸮cl {⸮o$
12:37:40.896 -> 

Perhaps you need to completely wipe the flash HA SwitchPlate HASPone: DIY In-Wall Touchscreen Home Assistant Controller

Oh yes, that did the trick. I was wondering there must be a way to completely wipe the flash.

Well I’ve made a dumb error.

You might notice that nearly all of the HASPone blueprints now fire off a warning. I was using some additional extensions while developing this and never caught the fact that the break statements I was using in a for loop aren’t actually supported by Home Assistant. With the latest release, we get much better debugging capabilities (seriously, the automation tracing is just bananas) and as part of that, warnings are now issued when dumb template mistakes are made. And… well I made a few.

All impacted blueprints have been updated in the repo. Not updating won’t impact functionality for the moment, there will just be some warnings in your log. It appears that the current plan is to turn those warnings into errors around October, so you’ll need to update the blueprints sometime before then.

To my knowledge, there isn’t a particularly good way to update blueprints in bulk. The process will be to delete the existing blueprint, then re-import the updated blueprint. Your automations made from the blueprints should stay intact after you complete the re-import.

Just starting on this project and excited to get it deployed. Will be making custom panels as in UK. I’ve got the software loaded to the Nextion and the D1. I can connect to the D1 and get to the screen to enter WiFi and MQTT server settings but the Nextion is just showing “HASP initializing”. I’ve read all the comments relating to poor connection but I’ve checked with a multi meter and all good. Am I being stupid here? Or maybe got a faulty D1?
![20210409_154652|666x500]
(upload://A3VulJ3CveiExJa2tk6Mx09TKgg.jpeg)

Any help appreciated. Thanks

Is anyone else facing these issues? Just set everything up like described. Mqtt successfully connected. But the blueprints do not run through. You talked about a warning before. I receive an error where the automation does not complete. Thanks :pray:

1 Like

After applying the latest HA April version I’m getting errors running the core functionality blueprint. I pulled the latest blueprint off GH and not able to full initialize a new HASPOne node. Here is the error I’m getting.

2021-04-09 23:37:48 INFO (MainThread) [homeassistant.components.automation.hasp_plate_03_core_functionality] HASP Plate 03 Core functionality: Choose at step 1: choice 2: Executing step call service

2021-04-09 23:37:48 INFO (MainThread) [homeassistant.components.automation.hasp_plate_03_core_functionality] HASP Plate 03 Core functionality: Running automation actions

2021-04-09 23:37:48 INFO (MainThread) [homeassistant.components.automation.hasp_plate_03_core_functionality] HASP Plate 03 Core functionality: Choose at step 1: choice 3: Running automation actions

2021-04-09 23:37:48 INFO (MainThread) [homeassistant.components.automation.hasp_plate_03_core_functionality] HASP Plate 03 Core functionality: Choose at step 1: choice 2: Executing step call service

2021-04-09 23:37:48 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'jinja2.utils.Namespace object' has no attribute 'source' when rendering '{%- set color = namespace() -%} {%- for entity in device_entities(haspdevice) -%}

{%- if entity|regex_search("^light\..*_selected_foreground_color(?:_\d+|)$") -%}

{%- set color.source=entity -%}

{%- endif -%}

{%- endfor -%} {%- set brightness = state_attr(color.source, "brightness")|int / 255 -%} {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int -%} {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int -%} {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int -%} {%- set colorcode = (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int -%} [{%- if not page_scroll -%}{%- for p in range(1,12) %}{%- if p == page1page|int %}"p[{{p}}].b[1].pco={{colorcode}}"{%- else -%}"p[{{p}}].b[1].pco2={{colorcode}}"{%- endif -%},{%- endfor -%} {%- else -%}{%- for p in range(1,12) %}"p[{{p}}].b[1].pco2={{colorcode}}",{%- endfor -%}{%- endif -%} {%- for p in range(1,12) %}{%- if p == page2page|int %}"p[{{p}}].b[2].pco={{colorcode}}"{%- else -%}"p[{{p}}].b[2].pco2={{colorcode}}"{%- endif -%},{%- endfor -%} {%- if not page_scroll -%}{%- for p in range(1,12) %}{%- if p == page3page|int %}"p[{{p}}].b[3].pco={{colorcode}}"{%- else -%}"p[{{p}}].b[3].pco2={{colorcode}}"{%- endif -%}{% if not loop.last %},{% endif %}{%- endfor -%} {%- else -%}{%- for p in range(1,12) %}"p[{{p}}].b[3].pco2={{colorcode}}"{% if not loop.last %},{% endif %}{%- endfor -%}{%- endif -%}]'

2021-04-09 23:37:48 ERROR (MainThread) [homeassistant.components.automation.hasp_plate_03_core_functionality] HASP Plate 03 Core functionality: Choose at step 1: choice 2: Error executing script. Error for call_service at pos 2: Error rendering data template: UndefinedError: 'jinja2.utils.Namespace object' has no attribute 'source'


This looks to be something related to the HA update but I’m not sure.

1 Like

This is super helpful, I can now re-create this in my dev environment and am working on tracking down what the heck is going on. Thanks @oday and @navierstokes!

edit: got a handle on what is happening. This is a breaking change with the new release that wasn’t listed as a breaking change. Previously, when “RUN ACTIONS” was pressed, trigger wasn’t defined and I could catch that and do things in response. With this release, trigger is now defined, which I can also catch but requires changing the logic on a lot of the blueprints. This is going to take me an hour or so to dig through, update, and test.

ahh okay!
another thing i noticed is that the mqtt integration just creates 3 entities instead of 6 (color select and unselect e.g.)… Dont know if that helps. :slight_smile:

Yeah, those are created by the Core automation, but aren’t being made for you because it’s broke :expressionless:

1 Like