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

Finally go my Sonoff IFan 02 to work with HA SwitchPlate :smile:
Had to edit nextion display to add button row. Then some automation to make it all work, but it does!!!

Very awesome code!!! Great project! Thank you luma!

1 Like

I soldered to those connection tonight, and was able to make it work. Now I have three running on the bench. Thank you!

1 Like

NICE! Might be a good time to drop a glob of hot glue or epoxy or something over that now that you have it sorted as those pads aren’t going to hold for long. Great work on the fix @mikeyroth!

1 Like

has anyone tried to have a button cycle colors while a state is on? I want my plate to “flash” when my garage door is open. I figured I could send a new mqtt message set every couple of seconds to change the color. . Here is my first go. It works, just not sure it is the most efficient way. Any advice?

  - alias: hasp_test_plate_Garage_door
    trigger:
    - platform: time_pattern
      seconds: /2
    - platform: state
      entity_id: 'binary_sensor.test_plate_connected'
      to: 'on'
    - platform: homeassistant
      event: start
    condition:
      condition: state
      entity_id: 'cover.sonoff_sv_garage'
      state: 'open'
    action:
    - service: mqtt.publish
      data:
        topic: 'hasp/test_plate/command/p[1].b[6].bco'
        payload: '63616'
    - service: mqtt.publish
      data_template:
        topic: 'hasp/test_plate/command/p[1].b[6].pco'
        payload: '32'
    - service: mqtt.publish
      data:
        topic: 'hasp/test_plate/command/p[1].b[6].txt'
        payload: '"Garage Open"'
    - delay: '00:00:01'
    - service: mqtt.publish
      data:
        topic: 'hasp/test_plate/command/p[1].b[6].bco'
        payload: '32'
    - service: mqtt.publish
      data_template:
        topic: 'hasp/test_plate/command/p[1].b[6].pco'
        payload: '63616'
    - delay: '00:00:01'

The only thing I’d see in there that might be redundant is the final delay call. Otherwise, it looks like it should do what you’re suggesting.

1 Like

getting this error in log:
configuration variable "json_attributes" is deprecated, replace with "json_attributes_topic"

had to change sensor json attributes in hasp_plate01_00_components.yaml

from this:
sensor:
- platform: mqtt
name: desk_plate Sensor
state_topic: “hasp/desk_plate/sensor”
value_template: ‘{{ value_json.status }}’
json_attributes:
- espVersion
- updateESPAvailable
- lcdVersion
- updateLcdAvailable
- espUptime
- signalStrength
- haspIP

to this:
sensor:
- platform: mqtt
name: test_plate Sensor
state_topic: “hasp/test_plate/sensor”
value_template: ‘{{ value_json.status }}’
json_attributes_topic: “hasp/test_plate/sensor”

i now the plate names are different, just wanted to share what fixed errors in my log. Figured I’d post it here if others were having similar issue. Also was discussed here
https://community.home-assistant.io/t/help-needed-cant-find-the-syntax-error-not-completely-solved/98048/19?u=mikeyroth

1 Like

Looks awesome but i have no neutral wire in my uk light backbox :frowning:

So I just received my assembled HAswitchplate the other day and have an issue. Hopefully someone can maybe help me out on. I was able to configure it to connect to my wireless network but after reboot it seems to be stuck in some kind of loop. It will connect to my network and then try to contact my MQTT server but for some reason it cannot. It comes back with an error saying Faile to connect to MQTT - RC=6. That particular error code isn’t defined on the github page. Then the device waits 10 seconds and tries again. During this process I can not get into the web admin page to change the settings.

I guess what I am asking is what is the best way to reset back to default?

The web server should still be working while attempting to contact MQTT. Are you getting no reply back at all?

Sometimes I can, but I have to hit refresh many times to get back into it. Then once I am in as soon as I hit save the page times out and can’t connect.

When it comes back up, try hitting the following URL to factory reset, substituting in your device’s real IP: http://192.168.1.10/resetConfig?confirm=yes

So the issue appears to be a connectivity problem. The laptop was working fine through the wifi but the HAswitchplate was not. I was about 20 feet away line of site with nothing in between. Right now I am about 10 feet away and it seems to be working fine.

I’m making a couple changes in the MQTT retry process which may help with both problems (not enough time to react, and WiFi dropping out). You should see the results in the next HASP release, thanks for bringing this up!

That good to know, though I think I figured out what was really going on in my case, just had not gotten back to post about it yet.

It turns out I somehow switched the hot and neutral wires around when connecting up for testing. The unit powered on and seemed to work so I didn’t think anything of it. But as I was playing around with it I kept seeing the signal drop out a lot, even right next the access point. So I decided to try moving somewhere else which involved un-wiring it from my test harness check. That is when I noticed I had wired it up wrong. As soon as I changed the wiring the the wifi started working as expected. Hopefully I didn’t damage any components.

HASP v0.37 release

Stability and performance improvements

ESP8266 code v0.37

  • Updated ESP8266 Arduino core to 2.5.0, which comes will a whole truckload of stability and performance improvements
  • Major improvements for LCD firmware updates to improve reliability and update speed
  • Re-enable mDNS services with LEA MDNSResponder
  • Improve user experience when MQTT client cannot connect to broker

Home Assistant Automations

  • Updated JSON sensor to new format after changes in 0.85

ESP8266 Update Procedure

If you’re using the AutoFirmwareUpdate automation your devices should pull this update at 3:00am. Otherwise, log into the admin web page and you can pull the update from the firmware page.

Home Assistant Update Procedure

Run the deployhasp.sh script to pull down the updated automations using one of the guides below:

Links for more HASP info

1 Like

Hi Michael,
Any chance you could share those STL files. I too also require it for an australian faceplate.

Thanks

I am late to the party, but you can buy drill bits meant for plastic. Wood or Steel bits will often shatter your work.

I’m having an issue executing the:

bash <(wget -qO- -o /dev/null https://raw.githubusercontent.com/aderusha/HASwitchPlate/master/Home_Assistant/deployhasp.sh)

command. I receive an error indicating that the “o” option is not recognized:

wget: unrecognized option: o

Can anyone suggest what I may be doing wrong?

Can you paste the output from a wget --version somewhere?

I don’t seem to be able to use that command…

wget: unrecognized option: version

If I try to reinstall:

core-ssh:/config# apk add tar wget
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.adfa7ceb.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.efaa1f73.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
tar (missing):
required by: world[tar]
wget (missing):
required by: world[wget]