Permalink
Browse files

HASP v0.28

  • Loading branch information...
aderusha committed May 26, 2018
1 parent 08433eb commit 3d29bba2b046dfd2efd78f829cd105df46fb312d
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
Binary file not shown.
@@ -43,12 +43,9 @@ binary_sensor:
sensor:
- platform: mqtt
name: plate01 Status
state_topic: "hasp/plate01/status"
name: plate01 Sensor
state_topic: "hasp/plate01/sensor"
value_template: '{{ value_json.status }}'
availability_topic: "hasp/plate01/status"
payload_available: "ON"
payload_not_available: "OFF"
json_attributes:
- espVersion
- updateESPAvailable
@@ -127,7 +124,7 @@ group:
view: yes
entities:
- binary_sensor.plate01_connected
- sensor.plate01_status
- sensor.plate01_sensor
- light.plate01_backlight
- group.plate01_pageselect
- group.plate01_automations
@@ -165,7 +162,17 @@ group:
- automation.hasp_plate01_p1_scenesinit
- automation.hasp_plate01_p2_clockinit
- automation.hasp_plate01_p2_clockupdate
- automation.hasp_plate01_p2_calendarupdate
- automation.hasp_plate01_p2_weather
- automation.hasp_plate01_p3_toggleall
- automation.hasp_plate01_p3_togglecolor1
- automation.hasp_plate01_p3_togglecolor2
- automation.hasp_plate01_p3_togglecolor3
- automation.hasp_plate01_p3_togglecolorall
- automation.hasp_plate01_p3_toggleinit
- automation.hasp_plate01_p3_togglelight1
- automation.hasp_plate01_p3_togglelight2
- automation.hasp_plate01_p3_togglelight3
- automation.hasp_plate01_p4_dimmer7updatehasp
- automation.hasp_plate01_p4_dimmer7updatehass
- automation.hasp_plate01_p4_dimmer8updatehasp
@@ -216,7 +223,7 @@ automation:
- service: input_text.set_value
data:
entity_id: 'input_text.hasp_plate01_pagebutton3label'
value: 'alarm'
value: 'lights'
- service: input_number.set_value
data:
entity_id: 'input_number.hasp_plate01_pagebutton1page'
@@ -228,7 +235,7 @@ automation:
- service: input_number.set_value
data:
entity_id: 'input_number.hasp_plate01_pagebutton3page'
value: 7
value: 3
- service: input_number.set_value
data:
entity_id: 'input_number.hasp_plate01_activepage'
@@ -15,16 +15,16 @@ automation:
payload: '3'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[5].font'
payload: '1'
topic: 'hasp/plate01/command/p[2].b[4].txt'
payload_template: "\"{{now().strftime('%-I:%M')}}\""
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[4].txt'
payload_template: "\"{{now().strftime('%H:%M')}}\""
topic: 'hasp/plate01/command/p[2].b[5].font'
payload_template: '{% if now().strftime("%B %-d")|length <= 6 -%}3{% elif (now().strftime("%B %-d")|length > 6) and (now().strftime("%B %-d")|length <= 10) %}2{% elif (now().strftime("%B %-d")|length > 10) and (now().strftime("%B %-d")|length <= 15) %}1{% else %}0{%- endif %}'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[5].txt'
payload_template: "\"{{now().strftime('%A')}}\\r{{now().strftime('%B %-d')}}\""
payload_template: "\"{{now().strftime('%B %-d')}}\""
# Send the current time every minute
- alias: hasp_plate01_p2_ClockUpdate
@@ -40,8 +40,27 @@ automation:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[4].txt'
payload_template: "\"{{now().strftime('%H:%M')}}\""
payload_template: "\"{{now().strftime('%-I:%M')}}\""
# Send "Month Day" every day, scaling font to fit
# 0 consolas 24 - 20 chars x 2 lines (wrapped)
# 1 consolas 32 - 15 chars x 2 lines (wrapped)
# 2 consolas 48 - 10 chars x 1 line
# 3 consolas 80 - 6 chars x 1 line
- alias: hasp_plate01_p2_CalendarUpdate
trigger:
platform: time
at: '00:00:00'
condition:
- condition: state
entity_id: 'binary_sensor.plate01_connected'
state: 'on'
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[5].font'
payload_template: '{% if now().strftime("%B %-d")|length <= 6 -%}3{% elif (now().strftime("%B %-d")|length > 6) and (now().strftime("%B %-d")|length <= 10) %}2{% elif (now().strftime("%B %-d")|length > 10) and (now().strftime("%B %-d")|length <= 15) %}1{% else %}0{%- endif %}'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[5].txt'
payload_template: "\"{{now().strftime('%A')}}\\r{{now().strftime('%B %-d')}}\""
payload_template: "\"{{now().strftime('%B %-d')}}\""
@@ -0,0 +1,215 @@
##############################################################################
# Create a group of lights to be toggled
group:
light_toggle_group:
name: Light Toggle Group
view: no
entities:
- light.light_1
- light.light_2
- light.light_3
##############################################################################
# Automations for handling toggle state buttons on page 3
automation:
# Set font and text for toggle buttons on device connection
- alias: hasp_plate01_p3_ToggleInit
trigger:
- platform: mqtt
topic: 'hasp/plate01/status'
payload: 'ON'
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[4].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[4].txt'
payload: '"Light 1"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[5].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[5].txt'
payload: '"Light 2"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[6].font'
payload: '2'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[6].txt'
payload: '"Light 3"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[7].font'
payload: '2'
# Toggle light1 when p[3].b[4] pressed
- alias: hasp_plate01_p3_ToggleLight1
trigger:
platform: mqtt
topic: 'hasp/plate01/state/p[3].b[4]'
payload: 'ON'
action:
service: homeassistant.toggle
entity_id: light.light_1
# Toggle light2 when p[3].b[5] pressed
- alias: hasp_plate01_p3_ToggleLight2
trigger:
platform: mqtt
topic: 'hasp/plate01/state/p[3].b[5]'
payload: 'ON'
action:
service: homeassistant.toggle
entity_id: light.light_2
# Toggle light3 when p[3].b[6] pressed
- alias: hasp_plate01_p3_ToggleLight3
trigger:
platform: mqtt
topic: 'hasp/plate01/state/p[3].b[6]'
payload: 'ON'
action:
service: homeassistant.toggle
entity_id: light.light_3
# Toggle all light_toggle_group when p[3].b[7] pressed
- alias: hasp_plate01_p3_ToggleAll
trigger:
platform: mqtt
topic: 'hasp/plate01/state/p[3].b[7]'
payload: 'ON'
action:
service_template: >
{% if states.group.light_toggle_group.state == "on" -%}
homeassistant.turn_off
{%- else -%}
homeassistant.turn_on
{%- endif %}
entity_id: group.light_toggle_group
# Toggle colors on p[3].b[4] when light1 changes
- alias: hasp_plate01_p3_ToggleColor1
trigger:
- platform: mqtt
topic: 'hasp/plate01/status'
payload: 'ON'
- platform: state
entity_id: light.light_1
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[4].bco'
payload_template: >-
{% if states.light.light_1.state == "on" -%}
65535
{%- else -%}
25388
{%- endif %}
- service: mqtt.publish
data_template:
topic: 'hasp/plate01/command/p[3].b[4].pco'
payload_template: >-
{% if states.light.light_1.state == "on" -%}
0
{%- else -%}
65535
{%- endif %}
# Toggle colors on p[3].b[5] when light1 changes
- alias: hasp_plate01_p3_ToggleColor2
trigger:
- platform: mqtt
topic: 'hasp/plate01/status'
payload: 'ON'
- platform: state
entity_id: light.light_2
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[5].bco'
payload_template: >-
{% if states.light.light_2.state == "on" -%}
65535
{%- else -%}
25388
{%- endif %}
- service: mqtt.publish
data_template:
topic: 'hasp/plate01/command/p[3].b[5].pco'
payload_template: >-
{% if states.light.light_2.state == "on" -%}
0
{%- else -%}
65535
{%- endif %}
# Toggle colors on p[3].b[6] when light1 changes
- alias: hasp_plate01_p3_ToggleColor3
trigger:
- platform: mqtt
topic: 'hasp/plate01/status'
payload: 'ON'
- platform: state
entity_id: light.light_3
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[6].bco'
payload_template: >-
{% if states.light.light_3.state == "on" -%}
65535
{%- else -%}
25388
{%- endif %}
- service: mqtt.publish
data_template:
topic: 'hasp/plate01/command/p[3].b[6].pco'
payload_template: >-
{% if states.light.light_3.state == "on" -%}
0
{%- else -%}
65535
{%- endif %}
# Set button 4 to "All Off" if any lights are on, otherwise set to "All On"
- alias: hasp_plate01_p3_ToggleColorAll
trigger:
- platform: mqtt
topic: 'hasp/plate01/status'
payload: 'ON'
- platform: state
entity_id: group.light_toggle_group
action:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[3].b[7].bco'
payload_template: >-
{% if states.group.light_toggle_group.state == "on" -%}
25388
{%- else -%}
65535
{%- endif %}
- service: mqtt.publish
data_template:
topic: 'hasp/plate01/command/p[3].b[7].pco'
payload_template: >-
{% if states.group.light_toggle_group.state == "on" -%}
65535
{%- else -%}
0
{%- endif %}
- service: mqtt.publish
data_template:
topic: 'hasp/plate01/command/p[3].b[7].txt'
payload_template: >-
{% if states.group.light_toggle_group.state == "on" -%}
"Lights Off"
{%- else -%}
"Lights On"
{%- endif %}
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -1,6 +1,6 @@
{
"d1_mini": {
"version": "0.27",
"version": "0.28",
"firmware": "http://haswitchplate.com/update/HASwitchPlate.ino.d1_mini.bin"
},
"NX3224T024_011R": {

0 comments on commit 3d29bba

Please sign in to comment.