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

@luma - Is this what your looking for?

MQTT Status: Connected
MQTT ClientID: plate01-68c63aca83b4
HASP Version: 0.30
LCD Model: NX3224T024_011R
LCD Version: 0
LCD Active Page: 0
CPU Frequency: 160MHz
Sketch Size: 407808 bytes
Free Sketch Space: 2736128 bytes
Heap Free: 29344
IP Address: 192.168.1.9
Signal Strength: -64
Uptime: 22
Last reset: Fatal exception:0 flag:4 (SOFT_RESTART) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000

home-assistant.log

2018-11-13 02:14:43 WARNING (MainThread) [homeassistant.components.http] legacy_api_password support has been enabled. If you don't require it, remove the 'api_password' from your http config.
2018-11-13 02:14:44 WARNING (MainThread) [homeassistant.loader] You are using a custom component for elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:46 WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate.elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate02/status
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate01/status
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate02/sensor
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate01/sensor
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate02/status
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate02/status: b'ON'
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate01/status
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate01/status: b'ON'
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate02/status: b'ON'
2018-11-13 02:14:47 WARNING (MainThread) [homeassistant.loader] You are using a custom component for sensor.elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:47 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate01/status: b'ON'
2018-11-13 02:14:47 WARNING (MainThread) [homeassistant.loader] You are using a custom component for alarm_control_panel.elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate02/light/status
2018-11-13 02:14:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate01/light/status
2018-11-13 02:14:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate02/brightness/status
2018-11-13 02:14:48 DEBUG (MainThread) [homeassistant.components.mqtt] Subscribing to hasp/plate01/brightness/status
2018-11-13 02:14:48 WARNING (MainThread) [homeassistant.loader] You are using a custom component for light.elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:49 WARNING (MainThread) [homeassistant.loader] You are using a custom component for switch.elkm1 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.components.sensor] amcrest: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 251, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 349, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/amcrest.py", line 103, in update
    sd_used = self._camera.storage_used
  File "/usr/local/lib/python3.6/site-packages/amcrest/storage.py", line 39, in storage_used
    status = [s for s in ret.split() if '.UsedBytes=' in s][0]
IndexError: list index out of range
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_2_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_7_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_8_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.sprinkler_system_in_standby_mode. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_5_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_1_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_4_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_3_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: switch.zone_6_2. Platform rachio does not generate unique IDs
2018-11-13 02:14:51 WARNING (SyncWorker_2) [pywemo.ssdp] Error fetching description at https://192.168.1.2:8888
2018-11-13 02:14:52 WARNING (SyncWorker_2) [pywemo.ssdp] Error fetching description at https://192.168.1.7:8888/capability
2018-11-13 02:14:54 WARNING (MainThread) [homeassistant.setup] Setup of wemo is taking over 10 seconds.
2018-11-13 02:14:55 WARNING (MainThread) [homeassistant.setup] Setup of wink is taking over 10 seconds.
2018-11-13 02:14:56 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate02/sensor: b'{"status":"available","espVersion":0.29,"updateEspAvailable":true,"lcdVersion":0,"updateLcdAvailable":true,"espUptime":317100,"signalStrength":-58,"haspIP":"192.168.1.34"}'
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate02/light/switch: ON
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/brightness/set: 255
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/light/switch: ON
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate02/light/status: b'ON'
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate01/brightness/status: b'255'
2018-11-13 02:14:59 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on hasp/plate01/light/status: b'ON'
2018-11-13 02:14:59 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'attributes'
2018-11-13 02:14:59 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'attributes'
2018-11-13 02:15:03 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'attributes'
2018-11-13 02:15:03 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/command/p[3].b[4].bco: 65535
2018-11-13 02:15:03 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'attributes'
2018-11-13 02:15:05 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/command/p[3].b[7].bco: 0xFBFC
2018-11-13 02:15:07 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'None' has no attribute 'attributes'
2018-11-13 02:15:10 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/command/p[3].b[6].bco: 0xFBFC
2018-11-13 02:15:21 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526417847184] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:26 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526323180320] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:31 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526319978536] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:36 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526416966208] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:41 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526352022440] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:46 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526352023224] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:51 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526415956288] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:15:56 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526389893440] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:00 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate02/command/p[2].b[4].txt: "2:16"
2018-11-13 02:16:00 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on hasp/plate01/command/p[2].b[4].txt: "2:16"
2018-11-13 02:16:01 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526320024600] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:06 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526390434056] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:11 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526415737016] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:16 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526319725592] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:21 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526319516248] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:26 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526319979992] Disconnected: Did not receive auth message within 10 seconds
2018-11-13 02:16:32 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection.140526322446008] Disconnected: Did not receive auth message within 10 seconds

From that log it appears that things are working. The homeassistant.components.websocket_api.http.connection messages aren’t related to HASP. In the web UI you should have a couple tabs labeled plate01 and plate02. Can you show us what those look like?

Somehow I got it working… not sure what did it. I’ll spend some time tonight trying to figure out what exactly fixed it.

Perhaps:
Uninstalling MQTT from the hassio add on gui
restart HASSIO
create a new user in HA (configuration, users)
Install MQTT from the hassio add on gui
within the MQTT configuration gui, use the new username and password
I enabled anonymous?

The MQTT not authorized when away…

1 Like

Hello all!

Is anyone willing to share their settings? I would like to compare the settings that Luma has created with someone else so that I can better understand how the programming works.

Upgrade MQTT to 4

know the MQTT log shows this

1542189556: Client plate01-dc4f2217f1de has exceeded timeout, disconnecting.
1542189556: Socket error on client plate01-dc4f2217f1de, disconnecting.
1542189557: New connection from 192.168.1.27 on port 1883.
1542189557: New client connected from 192.168.1.27 as plate01-dc4f2217f1de (c1, k5).
1542189563: Client plate01-dc4f2217f1de has exceeded timeout, disconnecting.
1542189563: Socket error on client plate01-dc4f2217f1de, disconnecting.
1542189563: New connection from 192.168.1.27 on port 1883.
1542189563: New client connected from 192.168.1.27 as plate01-dc4f2217f1de (c1, k5).
1542189575: New connection from 192.168.1.27 on port 1883.
1542189575: Client plate01-dc4f2217f1de already connected, closing old connection.
1542189575: Client plate01-dc4f2217f1de disconnected.
1542189575: New client connected from 192.168.1.27 as plate01-dc4f2217f1de (c1, k5).

the LCD screen displaying and the it goes back to the Connecting to MQTT then back to screen 1

tryed with and without username and password still get the above logs

download latest bin file uploaded that still get the above logs

HA showing me this
image
then
image

here is my MQTT setting

{
  "logins": [
    {
      "username": "mqttuser",
      "password": "notmypassword"
    }
  ],
  "anonymous": true,  <= need this ture so i dont have to change  15 sonoff  if I have to make false have to then
  "customize": {
    "active": true,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

any one got pointer why it happening

Wow, i love this project.
I wish there would be a similar enclosure for a RPi + one of the popular displays

I suspect you’re running into the fun new bug with the embedded MQTT broker that requires a username/password to be set. You can use an external MQTT broker, or set username/password auth on the hassio plugin and all your devices.

If this is annoying, I’d suggest adding your voice here.

Funny you should mention that…

Nothing serious yet, this is just for me to explore some ideas and see if the idea is at all feasible. I have a week of vacation at the in-laws coming up next week so I need a project that doesn’t involve me actually talking to anybody.

5 Likes

Sweet. For me it doesnt even need to fit in a standard backbox (im in the uk anyway), im just desperate for something what i can install in plasterboard wall, what’s gonna look nice and what can be used as an alarm keypad/scene controller/etc. Doesnt really matter if it’s gonna be a tiny uc-controlled screen, RPi with a larger screen, or full fledged android tablet. Ive been looking for 2 years now, and the only thing i found are in-wall Samsung tablet holders costing over 200 pounds each.

Got everything up and running but i dont’ have the trigger button in either of these cards in the plate01 tab. It shows connected to the mqtt and wifi on the screen. Don’t see anything that i can tell thats wrong in the config. Running on external mqtt server too.

57%20PM 10%20PM

It appears that none of the automations or components are showing up. The page should look something like this:

What you’re seeing is particularly surprising because you are seeing the group “view” for plate01 but none of the other groups which are defined in the same file.

Does the packages/plate01 folder in your installation appear to have all the files that you see listed here?

Yes its got all the packages but I did notice in atom that the folder was black which is weird but all the files are there and named plate01 like they are supposed too be.

Do you see the automations under “Developer tools” > “States”? If so, can you trigger it there?

Yeah i dont’ see any hasp automations. that must be the issue. i have an automations folder i keep all my .yaml automations files in. would that cause an issue with the install script.

I have to reload automations after every reboot to get them all to show and i have never understood why.

1 Like

I also have a automations folder with a pile of yamls that is outside of the HASP packages and so I can confirm that approach is compatible with the HASP packages. I suspect whatever is going on with your existing automations is also interfering with the HASP automations. I think you’re going to need to resolve that issue for this to work.

any idea of where to start on that. The automations all work just have to hit the reload to get them to show and the config checker doesnt’ throw any errors or anything.

I’m not a hassio user so I don’t have a lot of experience there. A quick search brought up this thread, which resulted in a re-install to resolve the issue :frowning:

Yeah i regret sometimes moving off my Unraid Server to the PI. Its nice because its not tied to a server i tinker with all the time but has these little querks blegh.

Reinstall fixed it thanks.

1 Like

Hi,

first of all, thanks to everyone who has helped to make this such a great thing!!
I ordered the screen from China and I was able to play around with it already changing some pages and texts.

I would like to contribute as well… I changed the automation group within the package (the one that lists all the automations in one group to be displayed in the view)
Since I already went ahead and added a few new autoomations myself I didnt want to update the group manually all the time to have my automations included. So I wrote an automation to do that for me.
Maybe it is helpful to someone else as well:

  - alias: hasp_plate01_automation_group_members_update
    trigger:
    - platform: homeassistant
      event: start
    - platform: time
      minutes: '/30'
      seconds: 00
    action:
    - service: group.set
      data_template:
        object_id: "plate01_automations"
        entities: >-
          {%- for item in states.automation if ((item.entity_id | lower).startswith('automation.hasp_plate01_')) -%}
          {{ item.entity_id }}
          {% if not loop.last %}, {% endif %}
          {%- endfor -%}

and then I added another one to make a second group that would only list the automations I added myself.
I am using “_se” at the end of all automation names that I make myself for the HASP Plate

  - alias: hasp_plate01_automation_group_members_update_se
    trigger:
    - platform: homeassistant
      event: start
    - platform: time
      minutes: '/30'
      seconds: 00
    action:
    - service: group.set
      data_template:
        object_id: "plate01_automations_se"
        entities: >-
          {%- for item in states.automation if ((item.entity_id | lower).endswith('_se')) -%}
          {{ item.entity_id }}
          {% if not loop.last %}, {% endif %}
          {%- endfor -%}

Here you go, if you wanted to could also add the trigger to update the automatio groups when the HASP boots:

  • platform: mqtt
    topic: ‘hasp/plate01/status’
    payload: ‘ON’

One question still remains for me: I started playing around with the colors (background and text color). Is there some documentation about what value is which color?

Thanks

1 Like