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

Thanks, ive got it connected in HA but trying to set it up on page nine of HASP, but not sure how to go about it.
Do i need to setup each segment/button to call a separate service?

Here is the automation I used for mine. climate.thermostat is the entity(?) that I used to access the thermostat. Something has broke with setting colors and icons, but it still controls the thermostat. Need to convert this to work with the blueprints though.

##############################################################################
# Automations for handling climate controls on page 9

automation:
  # Set font and text labels for scene buttons on device connection
  - alias: hasp_devplate_p3_HVACInit
    trigger:
      - platform: state
        entity_id: "binary_sensor.devplate_connected"
        to: "on"
      - platform: homeassistant
        event: start
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            ["p[9].b[4].font=6","p[9].b[4].txt=\"Mode\"",
            "p[9].b[5].font=6",
            "p[9].b[6].font=10","p[9].b[6].ycen=2",
            "p[9].b[9].font=10","p[9].b[9].ycen=2",
            "p[9].b[10].font=7","p[9].b[10].txt=\"\"",
            "p[9].b[11].font=6","p[9].b[11].txt=\"rH\"",
            "p[9].b[12].font=10","p[9].b[12].ycen=2"]

#            "p[9].b[7].font=7","p[9].b[7].bco=63488","p[9].b[7].txt=\"\"",
#            "p[9].b[8].font=7","p[9].b[8].bco=31","p[9].b[8].txt=\"\"",
#            "p[9].b[9].font=10","p[9].b[9].pco=63488","p[9].b[9].ycen=2",
#            "p[9].b[10].font=7","p[9].b[10].bco=63488","p[9].b[10].txt=\"\"",
#            "p[9].b[11].font=7","p[9].b[11].bco=31","p[9].b[11].txt=\"\"",
#            "p[9].b[12].font=10","p[9].b[12].pco=31","p[9].b[12].ycen=2"]

      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[5].txt"
          payload_template: '"{{ states("climate.thermostat")|replace("fan_only","Fan")|replace("_"," ")|title }}"'
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[6].txt"
          payload_template: '"  {{ state_attr("climate.thermostat", "current_temperature") }}°"'
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
# need to determine if we are off/heat/cool and set the color/icon/text accordingly
          payload_template: >-
            [
            {% if is_state('climate.thermostat', 'cool') %}
              "p[9].b[7].bco=31",
              "p[9].b[8].bco=31",
              "p[9].b[9].pco=31",
              "p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""
            {% elif is_state('climate.thermostat', 'heat') %}
              "p[9].b[7].bco=63488",
              "p[9].b[8].bco=63488",
              "p[9].b[9].pco=63488",
              "p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""
            {% else %}
              "p[9].b[7].bco=65535",
              "p[9].b[8].bco=65535",
              "p[9].b[9].pco=65535",
              "p[9].b[9].txt=\"\""
            {% endif %}
            ]              
              
              
#            {% elseif is_state('climate.thermostat', 'heat')% }
#              ["p[9].b[9].pco=63488","p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""]
#            {% else %}
#              ["p[9].b[9].txt=\"\""]
#            {% endif %}
             
#            {% if {{ states("climate.thermostat") == "cool" %}
#                ["p[9].b[9].pco=31","p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""]
#            {% elseif {{ states("climate.thermostat") == "heat" %}
#                ["p[9].b[9].pco=63488","p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""]
#            {% else %}
#                ["p[9].b[9].text =\"\"]
#            {% endif %}
            

#     - service: mqtt.publish
#        data:
#          topic: "hasp/devplate/command/p[9].b[9].txt"
#          payload_template: '" {{ state_attr("climate.thermostat", "temperature") }}°"'

      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[12].txt"
          payload_template: '"{{ state_attr("climate.thermostat", "current_humidity") }}%"'
#          payload_template: '" {{ state_attr("climate.thermostat", "current_humidity") }}°"'

  - alias: hasp_devplate_p3_UpdateHVACMode
    trigger:
      - platform: state
        entity_id: "climate.thermostat"
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[5].txt"
          payload_template: '"{{ states("climate.thermostat")|replace("fan_only","Fan")|replace("_"," ")|title }}"'

  # Catch either of the "mode" buttons, iterate through the list of supported modes, and
  # select the next one in the list or loop back to the beginning if it's the last item
  - alias: hasp_devplate_p3_CycleHVACMode
    trigger:
      - platform: mqtt
        topic: "hasp/devplate/state/p[9].b[4]"
        payload: "ON"
      - platform: mqtt
        topic: "hasp/devplate/state/p[9].b[5]"
        payload: "ON"
    action:
      - service: climate.set_hvac_mode
        entity_id: "climate.thermostat"
        data_template:
          hvac_mode: >-
            {% for mode in state_attr("climate.thermostat", "hvac_modes") %}
              {% if mode == states("climate.thermostat") %}
                {% if loop.last %}
                  {{ state_attr("climate.thermostat", "hvac_modes")[0] }}
                {% else %}
                  {{ state_attr("climate.thermostat", "hvac_modes")[loop.index] }}
                {% endif %}
              {% endif %}
            {% endfor %}
  
  # Display current HVAC temp on HASP when updated in Home Assistant
  - alias: hasp_devplate_p3_UpdateHVACTemp
    trigger:
      platform: state
      entity_id: "climate.thermostat"
    condition:
      condition: template
      value_template: '{{ trigger.from_state and trigger.to_state.attributes.current_temperature != trigger.from_state.attributes.current_temperature }}'
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[6].txt"
          payload_template: '"  {{ state_attr("climate.thermostat", "current_temperature") }}°"'
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/p[9].b[12].txt"
          payload_template: '"{{ state_attr("climate.thermostat", "current_humidity") }}%"'
          
#          payload_template: '" {{ state_attr("climate.thermostat", "current_humidity") }}°"'

  # Display current HVAC high temp set point on HASP when updated in Home Assistant
  - alias: hasp_devplate_p3_UpdateHVACTempHigh
    trigger:
      platform: state
      entity_id: "climate.thermostat"
    condition:
      condition: template
      value_template: '{{ trigger.from_state and trigger.to_state.attributes.temperature != trigger.from_state.attributes.temperature }}'
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            [
            {% if is_state('climate.thermostat', 'cool') %}
              "p[9].b[7].bco=31",
              "p[9].b[8].bco=31",
              "p[9].b[9].pco=31",
              "p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""
            {% elif is_state('climate.thermostat', 'heat') %}
              "p[9].b[7].bco=63488",
              "p[9].b[8].bco=63488",
              "p[9].b[9].pco=63488",
              "p[9].b[9].txt=\" {{ state_attr("climate.thermostat", "temperature") }}°\""
            {% else %}
              "p[9].b[7].bco=65535",
              "p[9].b[8].bco=65535",
              "p[9].b[9].pco=65535",
              "p[9].b[9].txt=\"\""
            {% endif %}
            ]              

#         topic: "hasp/devplate/command/p[9].b[9].txt"
#         payload_template: '" {{ state_attr("climate.thermostat", "temperature") }}°"'

  # Display current HVAC low temp set point on HASP when updated in Home Assistant
#  - alias: hasp_devplate_p3_UpdateHVACTempLow
#    trigger:
#      platform: state
#      entity_id: "climate.thermostat"
#    condition:
#      condition: template
#      value_template: '{{ trigger.from_state and trigger.to_state.attributes.temperature != trigger.from_state.attributes.temperature }}'
#    action:
#      - service: mqtt.publish
#        data:
#          topic: "hasp/devplate/command/p[9].b[12].txt"
#          payload_template: '" {{ state_attr("climate.thermostat", "temperature") }}°"'

  # Increment HVAC high temp set point when p[9].b[7] is pressed
  - alias: hasp_devplate_p3_SetHVACTempHighPlus
    trigger:
      - platform: mqtt
        topic: "hasp/devplate/state/p[9].b[7]"
        payload: "ON"
    condition:
      condition: not
      conditions:
        - condition: state
          entity_id: climate.thermostat
          state: 'off'
    action:
      - service: climate.set_temperature
        entity_id: "climate.thermostat"
        data_template:
          temperature: '{{ state_attr("climate.thermostat", "temperature") + 1 | int}}'
#          target_temp_high: '{{ state_attr("climate.thermostat", "temperature") + 1 | int}}'
#          target_temp_low: '{{ state_attr("climate.thermostat", "temperature") | int}}'

  # Decrement HVAC high temp set point when p[9].b[8] is pressed
  - alias: hasp_devplate_p3_SetHVACTempHighMinus
    trigger:
      - platform: mqtt
        topic: "hasp/devplate/state/p[9].b[8]"
        payload: "ON"
    condition:
      condition: not
      conditions:
        - condition: state
          entity_id: climate.thermostat
          state: 'off'
    action:
      - service: climate.set_temperature
        entity_id: "climate.thermostat"
        data_template:
          temperature: '{{ state_attr("climate.thermostat", "temperature") - 1 | int}}'
#          target_temp_high: '{{ state_attr("climate.thermostat", "temperature") - 1 | int}}'
#          target_temp_low: '{{ state_attr("climate.thermostat", "temperature") | int}}'

  # Increment HVAC low temp set point when p[9].b[10] is pressed
#  - alias: hasp_devplate_p3_SetHVACTempLowPlus
#    trigger:
#      - platform: mqtt
#        topic: "hasp/devplate/state/p[9].b[10]"
#        payload: "ON"
#    action:
#      - service: climate.set_temperature
#        entity_id: "climate.thermostat"
#        data_template:
#          target_temp_high: '{{ state_attr("climate.thermostat", "temperature") | int}}'
#          target_temp_low: '{{ state_attr("climate.thermostat", "temperature") | int + 1 }}'

  # Decrement HVAC low temp set point when p[9].b[11] is pressed
#  - alias: hasp_devplate_p3_SetHVACTempLowMinus
#    trigger:
#      - platform: mqtt
#        topic: "hasp/devplate/state/p[9].b[11]"
#        payload: "ON"
#    action:
#      - service: climate.set_temperature
#        entity_id: "climate.thermostat"
#        data_template:
#          target_temp_high: '{{ state_attr("climate.thermostat", "temperature") | int}}'
#          target_temp_low: '{{ state_attr("climate.thermostat", "temperature") | int - 1 }}'

##############################################################################
# Automations to set colors on HASP Page 9
#
  - alias: hasp_devplate_p3_ColorConfig_selectedforegroundcolor
    trigger:
      - platform: state
        entity_id: "binary_sensor.devplate_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_devplate_selectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            ["p[9].b[4].bco={{ states('input_number.hasp_devplate_selectedforegroundcolor')|int }}",
            "p[9].b[5].pco={{ states('input_number.hasp_devplate_selectedforegroundcolor')|int }}",
            "p[9].b[6].pco={{ states('input_number.hasp_devplate_selectedforegroundcolor')|int }}",
            "p[9].b[11].pco={{ states('input_number.hasp_devplate_selectedforegroundcolor')|int }}",
            "p[9].b[12].pco={{ states('input_number.hasp_devplate_selectedforegroundcolor')|int }}"]
  - alias: hasp_devplate_p3_ColorConfig_selectedbackgroundcolor
    trigger:
      - platform: state
        entity_id: "binary_sensor.devplate_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_devplate_selectedbackgroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            ["p[9].b[4].pco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[5].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[6].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[7].pco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[8].pco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[9].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[10].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[11].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            "p[9].b[12].bco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}"]
            
#            "p[9].b[10].pco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
#            "p[9].b[11].pco={{ states('input_number.hasp_devplate_selectedbackgroundcolor')|int }}",
            
  - alias: hasp_devplate_p3_ColorConfig_unselectedforegroundcolor
    trigger:
      - platform: state
        entity_id: "binary_sensor.devplate_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_devplate_unselectedforegroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            [{%- for i in range(4,9) -%}"p[9].b[{{i}}].pco2={{ states('input_number.hasp_devplate_unselectedforegroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}]

#            [{%- for i in range(4,13) -%}"p[9].b[{{i}}].pco2={{ states('input_number.hasp_devplate_unselectedforegroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}]

  - alias: hasp_devplate_p3_ColorConfig_unselectedbackgroundcolor
    trigger:
      - platform: state
        entity_id: "binary_sensor.devplate_connected"
        to: "on"
      - platform: homeassistant
        event: start
      - platform: state
        entity_id: input_number.hasp_devplate_unselectedbackgroundcolor
    action:
      - service: mqtt.publish
        data:
          topic: "hasp/devplate/command/json"
          payload_template: >-
            [{%- for i in range(4,13) -%}"p[9].b[{{i}}].bco2={{ states('input_number.hasp_devplate_unselectedbackgroundcolor')|int }}"{% if not loop.last %},{% endif %}{%- endfor -%}]

1 Like

Congratulations on the release!

very smooth!

I am however missing some of the older blueprints. namely the temperature w/o icon and the calendar without icon blueprint. Do you still have those around?

Also any chance for having the a blueprint for idle backlight off?

Works great with the blueprints. Compliments for the work done!
However in the ‘old’ situation it was possible to change the yaml files, this seems no longer possible with the blueprints.
I want to change the day / month to Dutch format.
In the yaml file i changed the corresponding line into:

payload_template: "\"{{now().day ~ '  ' ~ (now().strftime('%b')|replace('Mar', 'Mrt')|replace('May', 'Mei')|replace('Oct', 'Okt'))}} \""   

This does not work in the blueprint.
Is there a way to change code in the blueprints?

Regards, Peter.

Don’t know why the first lines are bold. This is my first post.

Sure! You can still use regular automations and hand-code the YAML, blueprints are just a way for me to get automations out to you in a way that’s easy for both of us.

Thanks for the reaction.
It seems the code should change in the blueprint, because the old (adapted by me) code does not work in the blueprint.
Any suggestions?
After this i shall change over to the github pages.

If you’re looking to modify a blueprint which you’ve imported, you can find it under homeassistant/blueprints/automation/HASwitchPlate. Make changes there, then do a “RELOAD AUTOMATIONS” under configuration > general to have your changes applied in Home Assistant.

2021-03-07 19.10.08|375x500

Found it and working.

@kuma I got around to installing Haspone on my device (and clearing all flash like you suggested) and it now works fine and remembers settings!

Trouble is importing the HASP Core functionality blueprint, it cannot find a device. Under “HASP Device” in the blueprint it says “no matching devices found”.

Under MQTT in integrations I have a device

HASP v1.0.0
by HASwitchPlate
Firmware: 0.41

It has entities (with their current state):

binary_sensor.plate01_connected on
light.plate01_backlight on
number.plate01_active_page 1
sensor.plate01_sensor ON

The attributes of the sensor are

espVersion: 0.41
updateEspAvailable: true
lcdConnected: true
lcdVersion: '3'
updateLcdAvailable: false
espUptime: 57660
signalStrength: -57
haspIP: 192.168.20.228
haspClientID: plate01-5ccf7fc17686
haspMac: '5c:cf:7f:c1:76:86'
haspManufacturer: HASwitchPlate
haspModel: HASP v1.0.0
heapFree: 23496
heapFragmentation: 2
heapMaxFreeBlockSize: 23088
espCore: '2_7_4'
friendly_name: plate01 sensor
icon: 'mdi:cellphone-text'

Clicking through the active_page seems to work and the backlight on/off works.I just cannot connect any blueprints.

It looks like you’re running the dev firmware - be sure to update both the ESP8266 and the Nextion LCD to the HASPone release and the release blueprints should work.

I’ll do that tonight. No ingress for the HaspOne :frowning:

Thanks Luma … working through the blueprint now … seems pretty easy to understand … and then I can update with my code to give me the function I need …

I’m really loving HASPOne and blueprints … another great upgrade from goth you and the HA team :sunglasses:
Gary

I clicked update a number of times on various things, and it started to work.

Looks good!

1 Like

That’s a nice job.

I’d love to find something that fit in either a single or double-gang decora opening. I’ve had Russound audio controls in a double-gang panel. They fit quite nicely into a double-gang Lutron Claro faceplace if you very carefully cut out the center section between the regular side-by-side single gang paddle openings. It’s about a 77.7mm x 66.7mm opening. Something undersized that’d allow for a bezel would be great. But I never came across anything suitable.

A bit of searching lately though shows a 2.8" might fit in the double-gang profile.

https://www.waveshare.com/product/displays/2.8inch-tft-touch-shield.htm?___SID=U

Food for thought if you wanted to consider different form-factors.

Or one like this could be set under with a bezel into a single gang.

https://www.waveshare.com/product/displays/2.13inch-touch-e-paper-hat.htm

@wkearney99 neither of those screens will work with haspone.

Hi.

Annotation 2021-03-14 104113

I’m getting this error. When I open the blueprint file from the file editor(every blueprint I add have this issue). I think because of that I cant validate my home assistant instance.

HA Version: 2021.3.4

What does that mean?

This
Annotation 2021-03-14 111544

it keeps on loading

OK I understand.

Where is the unknown tag error appearing?

Also, did you test the blueprint system before @luma released it? If so you might be using an old version of one of the blueprints?