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

is there a list of parts to build it? i cant seem to find one. do you know where it is? thanks!

The BOM appears on the front page of the GitHub project site.

@luma I can not see the Time or Date on the display? Is my string wrong? Where is the time getting pulled from?

- alias: HASwitchPlate_Clock
  trigger:
    platform: time
    # Matches every minute
    seconds: 00
  condition:
  - condition: state
    entity_id: 'binary_sensor.haswitchplate'
    state: 'on'
  action:
  - service: mqtt.publish
    data:
      topic: 'homeassistant/haswitchplate/HASwitchPlate/command/p[2].b[4].txt'
      payload_template: "\"{{now().strftime('%H:%M')}}\""
      retain: true
  - service: mqtt.publish
    data:
      topic: 'homeassistant/haswitchplate/HASwitchPlate/command/p[2].b[5].txt'
      payload_template: "\"{{now().strftime('%A')}}\\r{{now().strftime('%B %-d')}}\""
      retain: true
      
- alias: HASwitchPlate_Clock_Init
  trigger:
  - platform: mqtt
    topic: 'homeassistant/binary_sensor/HASwitchPlate/state'
    payload: 'ON'
  - platform: homeassistant
    event: start
  action:
  - service: mqtt.publish
    data:
      topic: 'homeassistant/haswitchplate/HASwitchPlate/command/p[2].b[4].font'
      payload: '3'
  - service: mqtt.publish
    data:
      topic: 'homeassistant/haswitchplate/HASwitchPlate/command/p[2].b[5].font'
      payload: '1'

This is the example code Iā€™m trying from the examples. Please help I love this project.

Dear all,
really nice work!
Nobody has added a temperature sensor and a relay?? My idea is to transform in a Generic Thermostat with MQTT Temperature sensor and put all in a 503 wall socketā€¦
Thanks,

Ivan

The date/time comes from now() and is formatted by strftime.

This is what the second example above looks like in the Home Assistant template editor:

If itā€™s not showing up on the display, can you monitor the MQTT traffic w/ mosquitto_sub (or similar) and post what the output looks like here?

The trouble with a temperature sensor will be finding enough space on the front panel to position such a sensor so that it faces into the room. A relay is on my ā€œmaybeā€ list, but that involves a substantial amount of engineering to implement in a safe manner.

Thanks @luma ,
maybe 503 has more space to fit all the thingā€¦

Ivan

Ok @luma I had 2 problems with the clock the date call was not working like this
"\"{{now().strftime('%A')}}\\r{{now().strftime('%B %-d')}}\"" the date %-d was not working for me I used %d Now it works. :slight_smile: also I have no entity_id: 'binary_sensor.haswitchplate' So commented it out then looked at the docs but didnā€™t see were you added a binary_sensor. Also Iā€™m in US so I changed the Clock to 12hr with

payload_template: "\"{{now().strftime('%I:%M')}}\""

Thanks! yet again

Iā€™m curious about this - what platform are you running on? -d is mentioned in the strftime documentation as being ā€œplatform specificā€. Iā€™ve run hass w/ the automation on raspbian and ubuntu (x64) and it works as expected.

That requires MQTT discovery to be enabled. Itā€™s used in a lot of places in my example automations, and Iā€™d strongly recommend adding that to your config. ā€˜binary_sensor.haswitchplateā€™ will be created automatically via this mechanism and is used to report to hass if the HASP device is online or not. Several of the automations will trigger based on this sensor going online to initialize the panel, so a bunch of things arenā€™t going to work right if you donā€™t have MQTT discovery enabled.

Maybe it does! I have no idea what a 503 is, and Google isnā€™t helping, but the enclosure design is included in the github repo and is editable with the free version of SketchUp if you want to modify it to fit your own use case.

Iā€™m running it on a VM Ubuntu x64 but Iā€™m using HassIO maybe thats why.

I guess I need to get MQTT discovery working correctly. :wink: I thought it was working with a prefix of homeassistant maybe the code required /homeassistant got to check.

homeassistant (no leading slash) should be the correct setting.

Yes, I think itā€™s working. What other sensors does it make? It looks like it is working with other auto discover devices (Espurna).

Thanks for this amazing Project

Next Year i have to renovate our Kitchen an Living room, then i will integrate a few switches :slight_smile:

1 Like

Is it possible to utilize the Nextion vis property to show/hide an object?

Yup! The Arduino sketch is mostly just passing through Nextion commands, so you can send any normal Nextion command using MQTT per the docs here.

So something like ā€˜[ā€¦]/command/p[1].b[4].visā€™ ā€˜0ā€™ or am I way off base?

Nvm. Figured it out. Iā€™m a little slow apparently. :slight_smile: I didnā€™t realize that sending the page, etc wasnā€™t needed.

Just ā€˜[ā€¦]/commandā€™ ā€˜vis 4,0ā€™

1 Like

Installed into the wall in a low voltage bracket (Iā€™m using a 5V micro-USB power supply and feed the power under the outlet cover and up the inside of the wall to it). Glad I finally did this and it works great. I had the display, ESP8266, and cover but never put it anywhere. Itā€™s in a nice central location of my house.

I know I brought this up before and I donā€™t remember what the cause is, but can you @luma explain to me again why the page does a double or triple refresh when it changes pages? Thanks!

1 Like

:star_struck:

The writeup below is still pertinent although input_slider is now input_number. The updated page flipping automation should address the issue.

1 Like

Hmmm, I have the latest pages automation yet it still refreshes the multiple times on page change. Iā€™ve reloaded automations and restarted HA many times. In fact Iā€™ve had that exact automation file since at least november 6th.