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

HASP 0.32 release

Minor ESP8266 release but several changes/fixes happening here on the Home Assistant side. Thanks to @DrZzs for livestreaming his process of deploying a new device, this has helped me better understand how new users experience getting a HASP going and has exposed several problem areas I wasn’t previously aware of.

ESP8266 code v0.32

  • Fix password being lost in web admin interface

Home Assistant Automations

deployhasp.sh

  • Detect if you’re re-deploying an existing device and prompt the user to take appropriate action in response. This greatly simplifies the process of upgrading your automations.

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.

4 Likes

Excellent!
Thanks Luma!

2 Likes

It’s pretty exciting to see the growth of this project! My installation has been working perfectly for quite some time now and I’m glad to have it. Guests even sometimes touch it hahah.

I’ll toss this out as an open question as I am not sure what’s going on so far. My plate sensors are missing the updateESPAvailable tag even though it’s being sent via MQTT.

My sensor section in the components.yaml package is as follows:

sensor:
  - platform: mqtt
    name: plate02 Sensor
    state_topic: "hasp/plate02/sensor"
    value_template: '{{ value_json.status }}'
    json_attributes:
      - espVersion
      - updateESPAvailable
      - lcdVersion
      - updateLcdAvailable
      - espUptime
      - signalStrength
      - haspIP

And HA reports the following:

image

My MQTT messages come across as such:

{"status":"available","espVersion":0.32,"updateEspAvailable":false,"lcdVersion":1,"updateLcdAvailable":false,"espUptime":8400,"signalStrength":-62,"haspIP":"192.168.1.114"}

Anyone else run into this? Any idea what’s wrong?

Edit: In looking closely at my post I suspect it’s the case on ESP so it’s not being parsed… I’ll check that this evening!

Edit 2: Yep, changing “updateESPAvailable” to “updateEspAvailable” took care of it.

1 Like

Home Assistant 0.84 upgrade WARNING

https://github.com/home-assistant/home-assistant/pull/17270

This change in Home Assistant 0.84 is going to revert all saved states, meaning sliders, text input fields, etc. After updating Home Assistant to 0.84+ you’ll need to re-run the FirstTimeSetup automation and then re-apply any changes you made to button labels, colors, etc through the Home Assistant web interface.

Hooray for the never-ending string of configuration-breaking changes…

edit: I’ve deployed 0.84.2 and outside of the issue mentioned above none of the other breaking changes seem to have impacted HASP at all.

1 Like

I’ve added models for a desktop version suitable for desk, bedstand, or tabletop use. STLs available here.

12 Likes

@luma - that tablestand looks very nice Luma - thanks for sharing this:) Is it possible to mount it together without the switchplate PCB?

Sure! When not powered by AC this is much less likely to catch on fire when assembled on a 40mm x 60mm protoboard. Check out details here.

1 Like

interesting, nice design. would it be possible to add a temp sensor to the hardware, is there spare gpio?

Thank you luma for all your work on this. It is really cool. I was wondering if you could tell me how I could pull weather data, from WU? I have a weather station on my roof and I send data to WU then I pull that data into hass. So it would be great to be able to show actual outside temp, but I just don’t know how to code that json I suppose.
somewhere in here i guess?

- service: mqtt.publish
  data:
    topic: 'hasp/plate01/command/p[2].b[6].txt'
    payload_template: '"{{state_attr("weather.metno","temperature")|int}}F"'

Blockquote

Thanks! And yes, the PCB has a breakout header which exposes some power pins, the analog A0 pin, and D0, D1, and D2 for GPIO.

You guess correct! The specific attribute you want is going to depend on your sensor. From the states view [1], find your sensor [2], find the attribute [3], and change the automation above to match your own sensor.

Hey luna, struggling here, I know I am kinda dumb when it comes to this templating stuff.

But I have tried a few things and nothing sticks

do you know how I should change to get this data?

In that case the thing you’re after is state, not an attribute, so it’d look like this:

  data:
    topic: 'hasp/plate01/command/p[2].b[6].txt'
    payload_template: '"{{states.sensor.pws_temp_f.state|int}}F"'

thanks… I am learning slowly…

1 Like

@luma - how do I configure a 24 hour clock, that we use in Europe (Denmark) ? We also use Celsius degrees instead of Fahrenheit for temps. Would it be possible to add this option in the Config for the HASP?

If you look here at the clock automation, you can change strftime('%I') to strftime('%H') for 24 hour time. See the strftime reference for details on that.

This one is pretty easy :smiley: If you look at the weather automation, you’ll find the following line:

payload_template: '"{{state_attr("weather.metno","temperature")|int}}F"'

Change that F to a C and you’re done. The temp will report using your local settings, the F/C is added manually due to issues with how Home Assistant sends the “°” symbol over MQTT.

2 Likes

Great @luma and thanks for such quick reply;)

@jascdk

here you can find my p2_clock.yaml where I changed a few things to make it a 24h clock and also display “C” instead of “F” for the temperature:

https://hastebin.com/agitewifed.coffeescript

Also changed the Date to be Day and then Month (20. December)
I was not able to get the little circle before the Celcius… °C to work. I think that might be a problem of the Nextion panel…? @luma

The needed change for the 24h clock in this stuff here:

   - service: mqtt.publish
     data:
      topic: 'hasp/plate01/command/p[2].b[4].txt'
      payload_template: "\"{{(now().strftime('%H')|int)~now().strftime(':%M')}}\""

And for the Temperature:

   - service: mqtt.publish
     data:
       topic: 'hasp/plate01/command/p[2].b[6].txt'
       payload_template: '"{{states.sensor.aussen_temperatur.state | int}} C"'

EDIT:
I just saw your posts… I started making this post and then had to leave and came back and just finished it…

Here is a picture of my screen:
@luma do you have any idea how to make the special character work?? ( äöü )
That line should read: Überwiegend bewölkt (Mostly cloudy)

1 Like

luma or really anyone, This has little to do with HASP but what does the
{{states.sensor.pws_precip_today_in.state|int}} “int” mean and can I change it to something that will give me a 2 place decimal?

thanks again

That will require modifying the font used in the HMI. Font support on Nextion is pretty dicey, but you might be able to get a suitable codepage working for you using the Nextion Editor’s font tools.

1 Like