Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! Reorganize switches around
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-V committed Jul 21, 2024
1 parent 034b4f7 commit 495c46b
Show file tree
Hide file tree
Showing 6 changed files with 260 additions and 22 deletions.
220 changes: 220 additions & 0 deletions blueprints/automation/zwave/paddle_scenes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
blueprint:
name: Inovelli Red Series (LZW-SN) scene control
description: >
Associate actions to scenes from Inovelli's Red Series LZW30-SN swiches and LZW31-SN dimmers.
domain: automation
input:
on_entity_id:
name: Event entities
description: Listen to events from these entities.
default: ""
selector:
entity:
filter:
integration: zwave
domain: event

off_entity_id:
name: Event entities
description: Listen to events from these entities.
default: ""
selector:
entity:
filter:
integration: zwave
domain: event

favorite_entity_id:
name: Event entities
description: Listen to events from these entities.
default: ""
selector:
entity:
filter:
integration: zwave
domain: event

hold_on:
name: Hold on paddle
description: Action to execute when the on paddle is held.
default: []
selector:
action: {}
hold_off:
name: Hold off paddle
description: Action to execute when the off paddle is held.
default: []
selector:
action: {}

release_on:
name: Release on paddle
description: Action to execute when the on paddle is released, typically after a hold event.
default: []
selector:
action: {}
release_off:
name: Release off paddle
description: Action to execute when the off paddle is released, typically after a hold event.
default: []
selector:
action: {}

tap_favorite:
name: Tap the favorite button
description: Action to run when the favorite button is pressed.
default: []
selector:
action: {}

tap_on_1x:
name: Tap the on paddle once
description: Action to run when the on paddle is pressed.
default: []
selector:
action: {}
tap_off_1x:
name: Tap the off paddle once
description: Action to run when the off paddle is pressed.
default: []
selector:
action: {}

tap_on_2x:
name: Tap the on paddle twice
description: Action to run when the on paddle is quickly pressed twice.
default: []
selector:
action: {}
tap_off_2x:
name: Tap the off paddle twice
description: Action to run when the off paddle is quickly pressed twice.
default: []
selector:
action: {}

tap_on_3x:
name: Tap the on paddle 3 times
description: Action to run when the on paddle is quickly pressed 3 times.
default: []
selector:
action: {}
tap_off_3x:
name: Tap the off paddle 3 times
description: Action to run when the off paddle is quickly pressed 3 times.
default: []
selector:
action: {}

tap_on_4x:
name: Tap the on paddle 4 times
description: Action to run when the on paddle is quickly pressed 4 times.
default: []
selector:
action: {}
tap_off_4x:
name: Tap the off paddle 4 times
description: Action to run when the off paddle is quickly pressed 4 times.
default: []
selector:
action: {}

tap_on_5x:
name: Tap the on paddle 5 times
description: Action to run when the on paddle is quickly pressed 5 times.
default: []
selector:
action: {}
tap_off_5x:
name: Tap the off paddle 5 times
description: Action to run when the off paddle is quickly pressed 5 times.
default: []
selector:
action: {}

max_exceeded: silent
mode: "queued"

trigger:
- platform: state
entity_id: !input on_entity_id
- platform: state
entity_id: !input off_entity_id
- platform: state
entity_id: !input favorite_entity_id

variables:
on_entity_id: !input on_entity_id
on_pressed: "{{ trigger.entity_id == on_entity_id }}"
off_entity_id: !input off_entity_id
off_pressed: "{{ trigger.entity_id == off_entity_id }}"
favorite_entity_id: !input favorite_entity_id
favorite_pressed: "{{ trigger.entity_id == favorite_entity_id }}"
event_type: "{{ trigger.to_state.attributes.event_type }}"

action:
- choose:
# Tap 1x
- conditions: "{{ event_type == 'KeyPressed' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input tap_on_1x
- conditions: "{{ off_pressed }}"
sequence: !input tap_off_1x
- conditions: "{{ favorite_pressed }}"
sequence: !input tap_favorite

# Hold
- conditions: "{{ event_type == 'KeyHeldDown' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input hold_on
- conditions: "{{ off_pressed }}"
sequence: !input hold_off

# Release
- conditions: "{{ event_type == 'KeyReleased' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input release_on
- conditions: "{{ off_pressed }}"
sequence: !input release_off

# Tap 2x
- conditions: "{{ event_type == 'KeyPressed2x' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input tap_on_2x
- conditions: "{{ off_pressed }}"
sequence: !input tap_off_2x

# Tap 3x
- conditions: "{{ event_type == 'KeyPressed3x' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input tap_on_3x
- conditions: "{{ off_pressed }}"
sequence: !input tap_off_3x

# Tap 4x
- conditions: "{{ event_type == 'KeyPressed4x' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input tap_on_4x
- conditions: "{{ off_pressed }}"
sequence: !input tap_off_4x

# Tap 5x
- conditions: "{{ event_type == 'KeyPressed5x' }}"
sequence:
- choose:
- conditions: "{{ on_pressed }}"
sequence: !input tap_on_5x
- conditions: "{{ off_pressed }}"
sequence: !input tap_off_5x
15 changes: 9 additions & 6 deletions packages/areas/dining_room.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ automation:
- id: "c531a467-eef3-484d-9b4e-b5fc90414bf4"
alias: "dining_room_dimmer_zwave_scenes"
use_blueprint:
path: "zwave/inovelli_lzw_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 78
on_entity_id: "event.dining_room_light_dimmer_on_pressed"
off_entity_id: "event.dining_room_light_dimmer_off_pressed"
favorite_entity_id: "event.dining_room_light_dimmer_favorite_pressed"

tap_favorite:
- service: "light.toggle"
Expand All @@ -82,15 +84,16 @@ automation:
- id: "7a81bc8a-fc13-426e-b324-e2c76c1142d7"
alias: "hallway_light_switch_zwave_scenes"
use_blueprint:
path: "zwave/zooz_zen77_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 75
on_entity_id: "event.hallway_spots_dimmer_on_pressed"
off_entity_id: "event.hallway_spots_dimmer_off_pressed"

tap_on_2x:
- service: light.turn_on
- service: "light.turn_on"
data:
entity_id: "light.kitchen_track"
tap_off_2x:
- service: light.turn_off
- service: "light.turn_off"
data:
entity_id: "light.kitchen_track"
11 changes: 7 additions & 4 deletions packages/areas/kitchen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ automation:
- id: "ab8460a3-e7b3-4cef-989e-11a65da297f9"
alias: "kitchen_track_dimmer_zwave_scenes"
use_blueprint:
path: "zwave/inovelli_lzw_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 79
on_entity_id: "event.kitchen_track_light_dimmer_on_pressed"
off_entity_id: "event.kitchen_track_light_dimmer_off_pressed"
favorite_entity_id: "event.kitchen_track_light_dimmer_favorite_pressed"

tap_favorite:
- service: "light.toggle"
Expand All @@ -74,9 +76,10 @@ automation:
- id: "3353147e-584b-4a98-8a1f-6a46bda78960"
alias: "kitchen_sink_light_switch_zwave_scenes"
use_blueprint:
path: "zwave/inovelli_lzw_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 50
on_entity_id: "event.kitchen_sink_light_switch_on_pressed"
off_entity_id: "event.kitchen_sink_light_switch_off_pressed"

tap_on_2x:
- service: "light.turn_on"
Expand Down
10 changes: 6 additions & 4 deletions packages/areas/master_bedroom/master_bedroom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ automation:
- id: "650fdbf6-2f22-4bd0-b430-c8a1c29d3217"
alias: "master_bedroom_spots_dimmer_scenes"
use_blueprint:
path: "zwave/homeseer_100_series_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 59
on_entity_id: "event.master_bedroom_spots_dimmer_on_pressed"
off_entity_id: "event.master_bedroom_spots_dimmer_off_pressed"

tap_on_2x:
- service: "light.turn_on"
Expand All @@ -101,9 +102,10 @@ automation:
- id: "7d71c23b-929c-4553-a150-2f990fc7ff87"
alias: "master_bedroom_sconces_dimmer_scenes"
use_blueprint:
path: "zwave/homeseer_100_series_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 4
on_entity_id: "event.master_bedroom_sconces_dimmer_on_pressed"
off_entity_id: "event.master_bedroom_sconces_dimmer_off_pressed"

tap_on_2x:
- service: "light.turn_on"
Expand Down
25 changes: 17 additions & 8 deletions packages/areas/outdoor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ automation:
- id: "abe8645a-9131-4822-8877-631f62b3e716"
alias: "front_porch_light_switch_zwave_scenes"
use_blueprint:
path: "zwave/homeseer_100_series_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 6
on_entity_id: "event.front_porch_light_switch_on_pressed"
off_entity_id: "event.front_porch_light_switch_off_pressed"

<<: &all_outdoor_on_off
tap_on_3x:
Expand All @@ -81,9 +82,12 @@ automation:
- id: "bc0ae565-8522-4e0c-b0d3-f0e46b109f04"
alias: "side_porch_sconce_switch_zwave_scenes"
use_blueprint:
path: "zwave/inovelli_lzw_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 76
on_entity_id: "event.side_porch_sconce_dimmer_on_pressed"
off_entity_id: "event.side_porch_sconce_dimmer_off_pressed"
favorite_entity_id: "event.side_porch_sconce_dimmer_favorite_pressed"

<<: *all_outdoor_on_off

tap_on_2x:
Expand All @@ -98,9 +102,12 @@ automation:
- id: "c0215e45-73ab-4e4a-af7f-f5ea1b7cff00"
alias: "backyard_soffit_spots_switch_zwave_scenes"
use_blueprint:
path: "zwave/inovelli_lzw_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 77
on_entity_id: "event.backyard_soffit_spots_dimmer_on_pressed"
off_entity_id: "event.backyard_soffit_spots_dimmer_off_pressed"
favorite_entity_id: "event.backyard_soffit_spots_dimmer_favorite_pressed"

<<: *all_outdoor_on_off

tap_on_2x:
Expand All @@ -115,7 +122,9 @@ automation:
- id: "a503f433-fcce-4763-9930-a2c7b7679426"
alias: "shed_outdoor_light_switch_zwave_scenes"
use_blueprint:
path: "zwave/homeseer_100_series_scene_control.yaml"
path: "zwave/paddle_scenes.yaml"
input:
node_id: 5
on_entity_id: "event.shed_outdoor_light_switch_on_pressed"
off_entity_id: "event.shed_outdoor_light_switch_off_pressed"

<<: *all_outdoor_on_off
1 change: 1 addition & 0 deletions packages/core/history.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ recorder:
- "calendar"
- "climate"
- "device_tracker"
- "event"
- "fan"
- "group"
- "input_boolean"
Expand Down

0 comments on commit 495c46b

Please sign in to comment.