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

2 Likes

Thanks @nickrout

This is an amazing project! I have 3 of these running in my house right now and I love them. I do have a 4th that has been giving me fits and I was hoping I could get a nudge in the right direction. After about 30 seconds the screen goes blank (No text, just backlight on) Iā€™ve deleted and recreated it. Flashed the nextion firmware multiple times, flashed the D1 mini, replaced the D1 mini, connected the D1 directly to the screen, and Iā€™ve resoldered the screen, but the problem persists.
The logs around time of failure show that the screen is timing out.

[+24.369s] HMI OUT:
[+25.370s] HMI ERROR: Nextion Ack timeout
[+25.372s] MQTT OUT: 'hasp/porch_hasp/state/json' : '{"event":"nextionError","value":"Nextion Ack timeout"}'
[+47.115s] MQTT IN: 'hasp/porch_hasp/command/json' : '["p[2].b[5].txt=\"1:05 \"","delay=1","xstr 0,69,50,65,8,0,0,1,1,3,\"ā†Ø\""]'
[+47.119s] HMI OUT: p[2].b[5].txt="1:05 "                                       
[+47.122s] HMI OUT: delay=1                                                     
[+47.144s] HMI OUT: xstr 0,69,50,65,8,0,0,1,1,3,"ā†Ø"                             
[+60.001s] UPDATE: Checking update URL: https://raw.githubusercontent.com/HASwitchPlate/HASPone/main/update/version.json
[+65.094s] UPDATE: Update check failed: connection failed                       
[+107.155s] MQTT IN: 'hasp/porch_hasp/command/json' : '["p[2].b[5].txt=\"1:06 \"","delay=1","xstr 0,69,50,65,8,0,0,1,1,3,\"ā†Ø\""]'
[+107.159s] HMI OUT: p[2].b[5].txt="1:06 "                                      
[+107.162s] HMI OUT: delay=1                                                    
[+107.169s] HMI OUT: xstr 0,69,50,65,8,0,0,1,1,3,"ā†Ø"   

The peculiar thing is I can see every screen button press in the debugging and if I reboot the screen I can view it for about 30 seconds before it goes away. Any thoughts?

Iā€™m a pround owner of my-first-project-made HASP and I use esp8266. The thing is that is a kind of slow and 8 was wondering if it would run on esp32 wroom orn any other esp32 model?
Anyone tried esp32?

The way the Nextion communication works is that the HASPone sends a single command to the Nextion, and then waits for the Nextion to return an acknowledgement that the command was processed before proceeding. Thatā€™s the timeout youā€™re seeing. Check the serial wiring between the board the Nextion, and maybe try changing the serial communication speed down a bit to see if that clears it up. This should run without problems at the highest serial speed, so if changing the speed improves performance that might be a sign that you have some physical problem with the setup (again, signal quality between the board and the Nextion).

Iā€™ve not tried compiling the project on ESP32 as there arenā€™t (to my knowledge) any ESP32 boards that will fit within the footprint of a D1 mini and everything in the project is pretty tightly packed. However - the ESP8266 isnā€™t having much asked of it in this project, so if things are running slow, itā€™s very likely that your problem lies elsewhere.

Iā€™d check debug logs and try to get a sense of the timing between you sending an MQTT packet out from the device in response to a button press, and the returned message from Home Assistant. If you find that a button press message is followed by a response within a couple hundred msec, then there might be a performance problem on the HASPone. If not, itā€™s likely slow execution of automations in Home Assistant, WiFi problems (packet loss etc), or MQTT issues (and this list is in decreasing order of likelihood).

In nearly all cases where a user was experiencing slow performance, the issue was due to Home Assistant automations firing slowly. If youā€™re running on an RPi, you might find that the overall experience improves by moving to a more performant platform for your HA install.

Thanks for the suggestions. I sort of suspected that was probably the case. Iā€™ve resoldered the connections and even found alternate solder points for each spot. No luck. Iā€™ll pull one of my installed ones to verify that this is the case and probably end up ordering a new screen. Thanks for all of your hard work luma, the Blueprints make this thing ridiculously easy to setup and thanks for confirming what I feared :slight_smile:

Do you have a link to this product? Iā€™m assuming you built and sell it still?

The product page can be found here but Iā€™m currently out of stock while I scour the world for the power supply used in the project. The situation w/ parts availability has become increasingly problematic.

1 Like

@michael.leone
I am a bit late to this party, but would really appreciate if STL files were available for your printed cover for Au :slight_smile:

New blueprint!

Cycle Automations:

Cycle Automations

Preview

A button on the HASP will toggle through as many as 10 selected automations. This allows the user to assign multiple blueprints to the same button on the HASPone device, and to cycle between them by pressing the selected button.

Optionally, a timeout can be set to cycle back to a ā€œdefaultā€ automation after a specified interval, or to continuously cycle through selected automations.

2 Likes

HASPone v1.03 release

This release is mostly minor bug fixes, feature enhancements, and underlying library updates.

Changelog

  • Add option ā€œIgnore touchevents when backlight is offā€, allowing one to ā€œsecureā€ a HASPone device if needed by locking out user input and display. Thanks to @jjfalling for the initial code and idea!
  • Add option to set custom discovery prefix at request from user @scyto. Iā€™ll add that this is probably a bad idea and you will likely create a bunch of problems for yourself if you change this value.
  • Add configurable value for the number of pages in the Nextion project. The default value of ā€œ11ā€ is what most people will use unless you have modified the Nextion project file.
  • Add platformio.ini file to simplify library management when compiling HASPone device firmware
  • Fix JSON return error with some troubleshooting help from @rebel7580 - thanks!
  • Some general code cleanup and small bug fixes
  • Update blueprints to avoid logging errors on startup in response to upcoming breaking change in Home Assistant 2021.12
  • Update ESP8226 core to 3.0.2
  • Update ArduinoJSON library to 6.18.5
  • Update MQTT library to 2.5.0
  • Update WiFiManager to 2021-10-30

Firmware Update Procedure

  • Open a browser to your HASPoneā€™s IP address or http://<devicename>.local
  • Click the button labeled update firmware
  • Click the first button Update ESP from URL and allow that process to complete. The device will power cycle after a minute or two.
  • If your HASPone is no longer connected to your computer via a USB cable, uncheck the option Serial debug output enabled for a small boost in performance.

Blueprint Update Procedure

  • Navigate to your Home Assistant folder with a file manager
  • Replace files under <homeassistant>/blueprints/automation/HASwitchPlate with the blueprints from the repo.
  • Reload automations or restart Home Assistant

Links for more HASPone info

Hi everyone,
is there a way to reboot the display from remote through mqtt, please?
Many thanks!

Sure is! Check the MQTT command documentation here.

Just send an MQTT message (message body can be empty) on the topic 'hasp/plate01/command/reboot', where plate01 is the name of the HASPone device you want to reboot.

1 Like

Can the discord link be updated? It says it has expired. Thank you!

Thanks for the headā€™s up!

HASPone Discord chat courtesy of our friend @DrZzs

HASPone v1.04 release

Bugfix release to address file corruption during configuration save in 1.03

Changelog

  • Fix configuration save process
  • Expand MQTT broker to 128 bytes
  • Speed up MQTT broker connection failure reporting and checks

Firmware Update Procedure

  • Open a browser to your HASPoneā€™s IP address or http://<devicename>.local
  • Click the button labeled update firmware
  • Click the first button Update ESP from URL and allow that process to complete. The device will power cycle after a minute or two.
  • If your HASPone is no longer connected to your computer via a USB cable, uncheck the option Serial debug output enabled for a small boost in performance.

Links for more HASPone info

1 Like

HASPone v1.05 release

New configuration options via MQTT, new Nextion Discovery series panel support, and performance + reliability fixes to blueprints. Be sure to update your blueprints for the new capabilities! I have some new blueprint ideas kickinā€™ around here, but they will require that all of the other blueprints have been updated for reasons.

Changelog

  • Enable configuration of some values via MQTT
  • (Hopefully) resolve remaining bugs in config JSON save/load process
  • Add TFT files and update workflow for Nextion Discovery series panel
  • Add ā€œMaximize HASPone performanceā€ option to Core Functionality. Enable this and click ā€œRUN ACTIONSā€ for the best HASPone performance!
  • Disambiguate sensor enumeration template across all blueprints
  • Add weather condition colorization to weather condition blueprints
  • Add configurable icon color to clock and calendar blueprints
  • Add advanced text and color controls to several blueprints

Firmware Update Procedure

  • Open a browser to your HASPoneā€™s IP address or http://<devicename>.local
  • Click the button labeled update firmware
  • Click the first button Update ESP from URL and allow that process to complete. The device will power cycle after a minute or two.

Blueprint Update Procedure

  • Navigate to your Home Assistant folder with a file manager
  • Replace files under <homeassistant>/blueprints/automation/HASwitchPlate with the blueprints from the repo.
  • Reload automations or restart Home Assistant

Links for more HASPone info

4 Likes

The 1.05 blueprints have some fixes that allow for some more advanced features. One common request has been a solution for dealing with RGB lights. I have yet to find any good solution for a color-wheel style color picker, but maybe something similar could work.

Iā€™m working on a blueprint which would allow you to select a button and a color-capable light to control. Thatā€™d create a button like this somewhere:

image

When you press the assigned button, the device will flip over to page 11 and present a palette of 12 color swatches along with dimmer controls:

image

The top row has on/off toggle and a slider to control dimming. The 12 squares below that will send a color value, and pressing ā€œReturnā€ will take the user back to the page they started from. With this approach, one can control as many RGB lights as you have available buttons.

I have the basic functionality worked out but I have one problemā€¦

Call for help!

I would like to provide a ā€œniceā€ default palette of 12 colors that would be suitable for RGB lighting. The user will be able to change these values (more on that later, itā€™s extremely customizable), but I think itā€™d be great if there was some sensible set of colors offered out of the box.

Thatā€™s where you come in!

image

1 Like

I love this. My use case is that I have a ā€œlampā€ in my living room that I made with RGBW strips and use the HASP to control it. My color needs are limited since most of the time weā€™re just looking for different temperatures of white from cool to warm depending on the mood. Itā€™s hard for me to step outside of my own use case so I guess if I had a few temps of white Iā€™d be set and the other colors would just be a bonus that likely my kids would just enjoy playing with.

1 Like