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

This is what I get

[+146.731s] MQTT connection attempt 26 failed with rc 0 and error: -3. Trying again in 5 seconds.
                 [+146.754s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+151.886s] MQTT connection attempt 27 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+151.909s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+157.038s] MQTT connection attempt 28 failed with rc 0 and error: -3. Trying again in 5 seconds.
                        [+157.060s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+162.187s] MQTT connection attempt 29 failed with rc 0 and error: -3. Trying again in 5 seconds,
[+162.210s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'

I would but I don’t have a working voltmeter.

more serial output

================================================================================
                                                                               [+0.069s] SYSTEM: Starting HASwitchPlate v0.41
[+0.075s] SYSTEM: Last reset reason: Software/System restart
[+0.081s] SYSTEM: heapFree: 31808 heapMaxFreeBlockSize: 31704
================================================================================

                                                                               [+0.095s] SPIFFS: mounting SPIFFS
[+0.113s] SPIFFS: reading /config.json
[+0.124s] SPIFFS: read 369 bytes and parsed json:{"mqttServer":"mqtt://192.168.1.173","mqttPort":"1883","mqttUser":"mqttuser","mqttPassword":"tchdad200!","mqttTlsEnabled":false,"mqttFingerprint":"","haspNode":"plate01","groupName":"plates","configUser":"admin","configPassword":"","nextionBaud":"115200","motionPinConfig":"0","debugSerialEnabled":true,"debugTelnetEnabled":false,"mdnsEnabled":true,"beepEnabled":false}
[+0.161s] HMI: Waiting for LCD connection
[+0.386s] HMI IN: [7 bytes]: 0xfe 0x00 0x00 0x00 0xff 0xff 0xff
[+0.392s] HMI: Querying LCD backlight status
[+0.398s] HMI OUT: get dim
[+0.401s] HMI IN: [4 bytes]: 0x88 0xff 0xff 0xff
[+0.405s] HMI: Nextion panel connected.
[+0.586s] HMI IN: [5 bytes]: 0x66 0x00 0xff 0xff 0xff
[+0.592s] HMI IN: [sendme Page] '0'
[+0.595s] HMI IN: [8 bytes]: 0x71 0x64 0x00 0x00 0x00 0xff 0xff 0xff
[+0.602s] HMI IN: [Int Return] '100'
[+0.606s] HMI IN: lcdBacklightDim '100'
[+0.611s] HMI OUT: bkcmd=3
[+0.614s] HMI: Querying LCD firmware version number
[+0.620s] HMI OUT: get p[0].b[2].val
[+0.624s] HMI IN: [8 bytes]: 0x71 0x03 0x00 0x00 0x00 0xff 0xff 0xff
[+0.630s] HMI IN: [Int Return] '3'
[+0.634s] HMI IN: lcdVersion '3'
[+0.637s] HMI: Querying LCD model information
[+0.642s] HMI OUT: connect
                          [+0.650s] HMI IN: [69 bytes]: 0x63 0x6f 0x6d 0x6f 0x6b 0x20 0x31 0x2c 0x33 0x30 0x36 0x30 0x31 0x2d 0x30 0x2c 0x4e 0x58 0x33 0x32 0x32 0x34 0x54 0x30 0x32 0x34 0x5f 0x30 0x31 0x31 0x52 0x2c 0x31 0x35 0x31 0x2c 0x36 0x31 0x34 0x38 0x38 0x2c 0x44 0x45 0x36 0x39 0x42 0x43 0x38 0x32 0x39 0x42 0x38 0x42 0x31 0x43 0x32 0x34 0x2c 0x34 0x31 0x39 0x34 0x33 0x30 0x34 0xff 0xff 0xff
[+0.705s] HMI IN: nextionModel: NX3224T024_011R
[+0.712s] HMI OUT: 'p[0].b[1].font=6'
[+0.717s] HMI OUT: page 0
[+0.726s] HMI OUT: 'p[0].b[1].txt="WiFi Connecting...\rë Hall 2.4G_2GEXT"'
[+0.803s] HMI IN: [5 bytes]: 0x66 0x00 0xff 0xff 0xff
[+0.808s] HMI IN: [sendme Page] '0'
[+0.812s] WIFI: Connecting to previously-saved SSID: Hall 2.4G_2GEXT
[+2.142s] HMI OUT: 'p[0].b[1].font=6'
[+2.153s] HMI OUT: 'p[0].b[1].txt="WiFi Connected!\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178"'
[+2.161s] WIFI: Connected successfully and assigned IP: 192.168.1.178
[+2.169s] HTTP: Server started @ http://192.168.1.178
[+2.176s] ESP OTA: Over the Air firmware update ready
[+2.181s] MQTT: Configuring MQTT connection without TLS.
[+2.188s] HMI OUT: page 0
[+2.245s] HMI OUT: 'p[0].b[1].font=6'
[+2.259s] HMI OUT: 'p[0].b[1].txt="WiFi Connected!\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connecting:\r mqtt://192.168.1.173"'
[+2.384s] HMI IN: [5 bytes]: 0x66 0x00 0xff 0xff 0xff
[+2.389s] HMI IN: [sendme Page] '0'
[+2.392s] MQTT: Attempting connection to broker mqtt://192.168.1.173 on port 1883 with TLS disabled as clientID plate01-40f52069c29
[+7.516s] MQTT connection attempt 1 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+7.539s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+12.679s] MQTT connection attempt 2 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+12.703s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+17.836s] MQTT connection attempt 3 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+17.858s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+22.985s] MQTT connection attempt 4 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+23.008s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+28.139s] MQTT connection attempt 5 faihed with rc 0 and error: -3. Trying again in 5 seconds.
[+28.163s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+33.341s] MQTT connection attempt 6 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+33.364s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+38.492s] MQTT connection attempt 7 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+38.515s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+43.639s] MQTT connection attempt 8 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+43.662s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+48.786s] MQTT connection attempt 9 failed with rc 0 and error: -3. Trying again in 5 seconds.
               [+48.809s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+53.947s] MQTT connection attempt 10 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+53.970s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+59.102s] MQTT connection attempt 11 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+59.125s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+64.243s] MQTT connection attempt 12 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+64.266s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'
[+69.387s] MQTT connection attempt 13 failed with rc 0 and error: -3. Trying again in 5 seconds.
[+69.410s] HMI OUT: 'p[0].b[1].txt="WiFi Connected:\rë Hall 2.4G_2GEXT\rIP: 192.168.1.178\r\rMQTT Connect to:\r mqtt://192.168.1.173\rFAILED rc=0\r\rRetry in 5 sec"'

You mentioned a successful connection w/ MQTT Explorer - can you post a screenshot of your connection configuration there? For example:

Allright! Spent the last 3 hours on the phone with a couple of HASP users chasing down some problems and I want to report back (and then probably write up a FAQ).

First problem: blueprints will import but cannot be executed (nor saved)
Root cause: The line automation: !include automations.yaml had been commented out in the configuration.yaml. The result is the the GUI could not be used for deploying or modifying automations. Blueprints require being able to interact with the file automations.yaml, so if you disable that in your Home Assistant configuration, you are disabling all Blueprint functionality.
Solution: Leave the line automation: !include automations.yaml in your configuration. If you want to still use YAML for editing automations, either add your existing automations into automations.yaml, or create packages.

Second problem: HASP cannot reach MQTT
Root cause: Network partition.
Solution: Make sure all wired and wireless network devices are able to communicate with each other. Once we straightened out the network, and devices could communicate, then MQTT works as expected. I’ll try and see if I can’t get better status messages shown to the user to help indicate something like this.

Well done!

Are your settings saved across reboots now?

I was only scratching the page 8 comment, ie mqtt was not working. And still isn’t after the new firmware.

Can you try grabbing this flash tool, select your Serial port, the current dev HASP bin, and check “yes” for erase flash.

Haven’t forgotten about you @garrettbeachy!

I just pushed a new version of the Toggle blueprint which brings a couple major changes:

  • You can now define either a state or an attribute to track to determine if something is “on” or “off”
  • I’m now using an Action selector to allow you to determine which action(s) to take in order to make something “on” or “off”.

OK, so how do we turn that into a fan controller?

For a “speed” button (low/medium/high), the fields should be configured like this:


That’s creating a “low” speed button. We want to track the attribute “speed”, and consider this button to be “on” when “speed” matches the text we’ve entered: “low”.

For our “on” action we tell the automation to send a couple of service calls (this works just like creating a regular automation). We send a fan.turn_on, followed by a fan.set_speed with speed: low

For the “off” action, we do the same thing, but with fan.turn_off and fan.set_speed with speed: off

In this example, we want to show the text “low” regardless of the device state, so just enter “low” for both text fields.

“High” and “medium” are duplicates, with the button number changed and the various references to “low” changed to “medium” or “high”.

Off works the same, except we flip the on/off condition. We want the “Off” button to be highlighted when the device is “off”. So, we set it up to function like the low/medium/high example above, but with the on/off conditions reversed, like this:


Then I just use a more normal configuration for a light toggle on top for button 4, and you have yourself a ceiling-fan controller w/ a light on/off toggle plus 4 buttons to control the speed:


The “toggle” blueprint is pretty powerful and with a little creativity you can make it work in a heck of a lot of use cases!

3 Likes

Finally got an alarm panel blueprint ready to go!

The blueprint allows you to select the target alarm system, the length of your code, and the action to take when the user presses “arm”.

Code entry rolls over like a regular alarm panel. So, if you have a 4-digit code set on your alarm panel of “1234” (like my luggage) and you mis-type one of the digits, you can just re-key the whole thing without needing to backspace or whatever.

2 Likes

Very nice!

Thanks for this! Turns out you can simplify it a bit, because calling fan.set_speed also turn on the fan, and calling fan.turn_off sets the speed to “off”. So no need to make multiple service calls!

I apologize for the following dumb question but…

I am in process of completely gutting my very old kitchen (not me, my contractor) and, among other things, rewiring to be completely up to code. If I want my electirical to create a switch box solely for the purpose of connectingh a HASP, what do I tell him to do? It will be a “dummy” box that is not needed to control any lights since it will be created just to host the HASP. Thanks for any help!

Just mains power to it.

How did you make this , i will love to see what and how can you show it somewhere more about it please , it looks so nicely done ,and i wood like to be able to make it to.

I am using Fusion 360 for the design and 3D printing it. So far I have just modified the existing nextion code to fit the display. There are a couple other pictures showing it. My idea is to do a custom layout using the blueprints. Using the display in landscape mode, I can fit a row of buttons on one side for menus and do the equivalent of two displays.

image

1 Like

So basically it’s an outlet, not a switch? I just tell the electricial to wire it up as if for an outlet but to put a blank cover on it?

Two other, possibly dumb, questions:

  1. I know the HASP supports multiple pages but I didn’t see how you swipe to see one of the other defined pages.
  2. I see that the firmware is periodially updated. Are the firmware upgrades idiot-proof?

To be clear, I’m a techie and have been in software for years. I am not, however, a hardware guy. I am writing support for some new integrations and I can configure and customize HA but I don’t know squat about hardware. Thanks.

Correct! If you have a hot and a neutral you should be all set.

There a 3 configurable page-select buttons on the bottom of each screen, as shown below. You have a lot of options there, they can be assigned to directly switch to a given page, or to “scroll” through the list of available pages. The text + font + icons displayed on each button is also configurable

Firmware updates are typically a one-click affair in the web admin page hosted on the device itself. The device periodically checks github to see if an update is available, and can optionally update itself when that happens.