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

Trying to save new mqtt settings to haswitchplate. I am getting the following error. None of the settings are saving

Last reset: Fatal exception:0 flag:4 (SOFT_RESTART) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000

What software are you using to flash the HASP?

tasmotizer

Not familiar with that tool, check to see if it has an option to clear EEPROM when flashing to do a full reset of your device.

EDIT: I flashed with esp-home flasher vs tasmotizer and it works fine now.
it says “erase before flashing” I could try like espeasyflasher or something?

image

I just tried Tasmotizer and it does seem to work. What happens if you do a reset of the device, either by pulling the USB cable to cycle power, or hitting the reset button? Are you stuck in a boot loop? Can you post serial debug logs of this process?

edit: after a reboot my device was also unable to retain stored EEPROM settings, seems like Tasmotizer is doing something funky here. Guess that’s not a good piece of software to use for HASP.

See above, i got it working with different program. All is good here!!

New question, Trying to pull value from HA, Not sure how to do this but great if you could help. The sensor is

sensor.dark_sky_apparent_temperature

  • service: mqtt.publish
    data:
    topic: ‘hasp/plate01/command/p[2].b[6].txt’
    payload_template: ‘"{sensor.dark_sky_apparent_temperature }°"’
- service: mqtt.publish
  data:
    topic: 'hasp/plate01/command/p[2].b[6].txt'
    payload_template: '"{{ states.sensor.dark_sky_apparent_temperature.state }}°"'
1 Like

Awesome Thank you!!!

hi on page 6 there are 8 buttons what do they start from numberwise

i take its 4-11 im trying to fill in the 8 squares to turn each one into a toggle button

thanks

Here you go!

thanks luma finally got one in my finished lounge

for anyone who wants page 6 fully populated with 8 buttons copy my code below

##############################################################################
# Automations for handling toggle state buttons on page 6
automation:
  # Set font and text for toggle buttons on device connection
  - alias: hasp_livingroom_p6_Buttons_2x4Init
    trigger:
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
    action:
      # Set font and justification for the 8 buttons (b4-b11)
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload: '["p[6].b[4].font=0","p[6].b[5].font=0","p[6].b[6].font=0","p[6].b[7].font=0","p[6].b[8].font=0","p[6].b[9].font=0","p[6].b[10].font=0","p[6].b[11].font=0","p[6].b[4].xcen=2","p[6].b[5].xcen=2","p[6].b[6].xcen=2","p[6].b[7].xcen=2","p[6].b[8].xcen=2","p[6].b[9].xcen=2","p[6].b[10].xcen=2","p[6].b[11].xcen=2"]'
      # Set text labels for the top 8 buttons (b4-b11)
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload: '["p[6].b[4].txt=\"LivingroomCurtains \"","p[6].b[5].txt=\"DiningroomCurtains \"","p[6].b[6].txt=\"Underfloor   Fans \"","p[6].b[7].txt=\"Sun Shade \"","p[6].b[8].txt=\"Spotlights \"","p[6].b[9].txt=\"LEDS \"","p[6].b[10].txt=\"Lamps \"","p[6].b[11].txt=\"Fishtank \""]'

  # Toggle light1 when p[6].b[4] pressed
  - alias: hasp_livingroom_p6_ToggleLight1
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[4]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: switch.living_room_curtains

  # Toggle light2 when p[6].b[5] pressed
  - alias: hasp_livingroom_p6_ToggleLight2
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[5]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: switch.diningroom_curtains

  # Toggle light3 when p[6].b[6] pressed
  - alias: hasp_livingroom_p6_ToggleLight3
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[6]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: switch.underfloor_fans

  # Toggle light4 when p[6].b[7] pressed
  - alias: hasp_livingroom_p6_ToggleLight4
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[7]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: switch.diningroomshade

  # Toggle light5 when p[6].b[8] pressed
  - alias: hasp_livingroom_p6_ToggleLight5
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[8]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: light.spot_lights

  # Toggle light6 when p[6].b[9] pressed
  - alias: hasp_livingroom_p6_ToggleLight6
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[9]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: light.ceiling_led

  # Toggle light7 when p[6].b[10] pressed
  - alias: hasp_livingroom_p6_ToggleLight7
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[10]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: light.lamps

  # Toggle light8 when p[6].b[11] pressed
  - alias: hasp_livingroom_p6_ToggleLight8
    trigger:
      - platform: mqtt
        topic: "hasp/livingroom/state/p[6].b[11]"
        payload: "ON"
    action:
      - service: homeassistant.toggle
        entity_id: light.fishtank_light

  # Toggle colors on p[6].b[4] when light1 changes
  - alias: hasp_livingroom_p6_ToggleColor1
    trigger:
      - platform: state
        entity_id: switch.living_room_curtains
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('switch.living_room_curtains') == "on" -%}
              "p[6].b[4].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[4].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[4].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[4].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[5] when light2 changes
  - alias: hasp_livingroom_p6_ToggleColor2
    trigger:
      - platform: state
        entity_id: switch.diningroom_curtains
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('switch.diningroom_curtains') == "on" -%}
              "p[6].b[5].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[5].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[5].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[5].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[6] when light3 changes
  - alias: hasp_livingroom_p6_ToggleColor3
    trigger:
      - platform: state
        entity_id: switch.underfloor_fans
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('switch.underfloor_fans') == "on" -%}
              "p[6].b[6].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[6].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[6].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[6].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[7] when light4 changes
  - alias: hasp_livingroom_p6_ToggleColor4
    trigger:
      - platform: state
        entity_id: switch.diningroomshade
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('switch.diningroomshade') == "on" -%}
              "p[6].b[7].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[7].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[7].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[7].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[8] when light5 changes
  - alias: hasp_livingroom_p6_ToggleColor5
    trigger:
      - platform: state
        entity_id: light.spot_lights
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('light.spot_lights') == "on" -%}
              "p[6].b[8].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[8].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[8].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[8].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[9] when light6 changes
  - alias: hasp_livingroom_p6_ToggleColor6
    trigger:
      - platform: state
        entity_id: light.ceiling_led
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('light.ceiling_led') == "on" -%}
              "p[6].b[9].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[9].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[9].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[9].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[10] when light7 changes
  - alias: hasp_livingroom_p6_ToggleColor7
    trigger:
      - platform: state
        entity_id: light.lamps
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('light.lamps') == "on" -%}
              "p[6].b[10].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[10].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[10].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[10].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

  # Toggle colors on p[6].b[11] when light8 changes
  - alias: hasp_livingroom_p6_ToggleColor8
    trigger:
      - platform: state
        entity_id: light.fishtank_light
      - platform: state
        entity_id: "binary_sensor.livingroom_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedbackgroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_selectedforegroundcolor
      - platform: state
        entity_id: input_number.hasp_livingroom_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/livingroom/command/json"
          payload_template: >-
            [{% if states('light.fishtank_light') == "on" -%}
              "p[6].b[11].bco={{ states('input_number.hasp_livingroom_selectedbackgroundcolor') | int }}","p[6].b[11].pco={{ states('input_number.hasp_livingroom_selectedforegroundcolor') | int }}"
            {%- else -%}
              "p[6].b[11].bco={{ states('input_number.hasp_livingroom_unselectedbackgroundcolor') | int }}","p[6].b[11].pco={{ states('input_number.hasp_livingroom_unselectedforegroundcolor') | int }}"
            {%- endif %}]

great work as always

2 Likes

Anybody have documention on the PIR sensor. I have one installed. Not sure what it does lol. Does it report back to HA? Does it turn screen off and on? I seen video where it scrolls or something with motion but not sure.

Since a recent HA update my HASwitch plates have been unavailable to HA. I am connect to MQTT and can connect to ESP. All of my automations are enabled, but never getting past initial Wifi connected screen. A
Any ideas?

does anyone have a sample page for the code for Page 11 Please and what should the file be name as?

hasp_devicename_p10_**********.yaml

thanks

What happens if you move the active page slider in Home Assistant for this device? Does the device change pages?

If not, what exactly is being shown on the display?

The filename kinda doesn’t matter outside of the .yaml bit. If you want to stick with existing convention, you could do hasp_devicename_p11_whatever.yaml.

I haven’t included any demo automations for page 11 as I didn’t think of anything to stick in there. There’s just one button p[11].b[4] which works like buttons on other pages, so you should be able to copy something from, say, page 1 to trigger a scene or whatever you’d like.

1 Like

Moving active slider does nothing. I have rebooted and unplugged devices and all that I get is,
Wifi Connected - IP address
MQTT Connected and mqtt IP

I have 4 devices and all show unavailable in HA.

I tried changing name of one device, and running new install script for device.

Still no change.

Thanks for ideas!!

Any chance you could post a debug log from the device? If you have one connected to your PC via serial that will work, or you can enable telnet debug and telnet to the device.