Add multiple blue prints

This commit is contained in:
2024-04-13 09:38:16 +02:00
parent c5c71f4176
commit d3fdd654c6
4 changed files with 691 additions and 0 deletions

View File

@@ -0,0 +1,172 @@
blueprint:
name: 'Z2M IKEA On Off and dimming Lights'
description: Blueprint for Ikea Remote Controls (On/Off and dim) for controlling lights
domain: automation
source_url: https://forge.slopez.fr/homeassistant/blueprints/raw/branch/main/Z2M/IKEA/tradfri-dimmer-switch-on-off-and-dimming.yaml
input:
remote:
name: Remote
description: IKEA remote to use (e.g sensor.kitchen_remote_action)
selector:
entity:
domain: sensor
multiple: false
device:
integration: zha
manufacturer: IKEA
model: E1743
lights:
name: Lights
description: Light(s) to control when using default light actions
default:
entity_id: none
selector:
entity:
domain: light
helper_transition_switch:
name: Helper - Transition time in seconds for switching on / off
description: Transition time in seconds for switching on / off (0.0-10.0)
default: 1
selector:
number:
min: 0.0
max: 10.0
mode: box
step: 0.5
helper_step_up:
name: Helper - brightness up step
description: Step size for changing brightness up (0-20)
default: 5
selector:
number:
min: 0
max: 20
mode: box
step: 1
helper_step_down:
name: Helper - brightness down step
description: Step size for changing brightness down (0-20)
default: -5
selector:
number:
min: -20
max: 0
mode: box
step: 1
helper_transition_dim:
name: Helper - Transition time for dimming up / down
description: Transition time in seconds for dimming up / down. 0 makes visible steps. Greater than 0.1 makes it smoother. (0.0-10.0)
default: 0.5
selector:
number:
min: 0.0
max: 10.0
mode: box
step: 0.5
helper_pause:
name: Helper - pause between each dimming step
description: How long should be delayed between each step of dimming in milliseconds. 0 makes no delay. (10-2000)
default: 500
selector:
number:
min: 10
max: 2000
mode: box
step: 10
mode: restart
max_exceeded: silent
variables:
helper_transition_switch: !input helper_transition_switch
helper_step_up: !input helper_step_up
helper_step_down: !input helper_step_down
helper_transition_dim: !input helper_transition_dim
helper_pause: !input helper_pause
trigger:
- platform: state
entity_id:
- !input remote
to: "on"
id: "on"
- platform: state
entity_id:
- !input remote
to: "off"
id: "off"
- platform: state
entity_id:
- !input remote
to: brightness_move_up
id: move_up
- platform: state
entity_id:
- !input remote
to: brightness_move_down
id: move_down
- platform: state
entity_id:
- !input remote
to: brightness_stop
id: stop
action:
- choose:
- conditions:
- condition: trigger
id: "on"
sequence:
- service: light.turn_on
data:
transition: !input helper_transition_switch
target:
entity_id: !input lights
- conditions:
- condition: trigger
id: "off"
sequence:
- service: light.turn_off
data:
transition: !input helper_transition_switch
target:
entity_id: !input lights
- conditions:
- condition: trigger
id: move_up
sequence:
- repeat:
count: "20"
sequence:
- service: light.turn_on
data:
transition: !input helper_transition_dim
brightness_step_pct: !input helper_step_up
target:
entity_id: !input lights
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: !input helper_pause
- conditions:
- condition: trigger
id: move_down
sequence:
- repeat:
count: "20"
sequence:
- condition: numeric_state
entity_id: !input lights
attribute: brightness
above: 20
- service: light.turn_on
data:
transition: !input helper_transition_dim
brightness_step_pct: !input helper_step_down
target:
entity_id: !input lights
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: !input helper_pause

View File

@@ -0,0 +1,129 @@
blueprint:
name: ZHA - Tuya 3 Gang Portable Remote
description: 'Control anything with a Tuya 3 Gang Portable Remote.
You can set functions for a single press, double press and long press of each of the three buttons. This allows you to assign,
e.g., a scene or anything else.'
source_url: https://forge.slopez.fr/homeassistant/blueprints/raw/branch/main/Z2M/tuya/3_gang_portable_remote.yaml
domain: automation
input:
remote:
name: Remote
description: Tuya 3 Gang Portable Remote to use
selector:
device:
integration: mqtt
manufacturer: TuYa
model: TS0043
single_press_1:
name: Single press button 1
description: Action to run on single press of button 1
default: []
selector:
action: {}
single_press_2:
name: Single press button 2
description: Action to run on single press of button 2
default: []
selector:
action: {}
single_press_3:
name: Single press button 3
description: Action to run on single press of button 3
default: []
selector:
action: {}
double_press_1:
name: Double press button 1
description: Action to run on double press of button 1
default: []
selector:
action: {}
double_press_2:
name: Double press button 2
description: Action to run on double press of button 2
default: []
selector:
action: {}
double_press_3:
name: Double press button 3
description: Action to run on double press of button 3
default: []
selector:
action: {}
long_press_1:
name: Long press button 1
description: Action to run on long press of button 1
default: []
selector:
action: {}
long_press_2:
name: Long press button 2
description: Action to run on long press of button 2
default: []
selector:
action: {}
long_press_3:
name: Long press button 3
description: Action to run on long press of button 3
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'single_press_1'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'single_press_2'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'single_press_3'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'double_press_1'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'double_press_2'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'double_press_3'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'long_press_1'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'long_press_2'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'long_press_3'

View File

@@ -0,0 +1,162 @@
blueprint:
name: ZHA - Tuya 4 Gang Portable Remote
description: 'Control anything with a Tuya 4 Gang Portable Remote.
You can set functions for a single press, double press and long press of each of the four buttons. This allows you to assign,
e.g., a scene or anything else.'
source_url: https://forge.slopez.fr/homeassistant/blueprints/raw/branch/main/Z2M/tuya/4_gang_portable_remote.yaml
domain: automation
input:
remote:
name: Remote
description: Tuya 4 Gang Portable Remote to use
selector:
device:
integration: mqtt
manufacturer: TuYa
model: TS0044
single_press_1:
name: Single press button 1
description: Action to run on single press of button 1
default: []
selector:
action: {}
single_press_2:
name: Single press button 2
description: Action to run on single press of button 2
default: []
selector:
action: {}
single_press_3:
name: Single press button 3
description: Action to run on single press of button 3
default: []
selector:
action: {}
single_press_4:
name: Single press button 4
description: Action to run on single press of button 4
default: []
selector:
action: {}
double_press_1:
name: Double press button 1
description: Action to run on double press of button 1
default: []
selector:
action: {}
double_press_2:
name: Double press button 2
description: Action to run on double press of button 2
default: []
selector:
action: {}
double_press_3:
name: Double press button 3
description: Action to run on double press of button 3
default: []
selector:
action: {}
double_press_4:
name: Double press button 4
description: Action to run on double press of button 4
default: []
selector:
action: {}
long_press_1:
name: Long press button 1
description: Action to run on long press of button 1
default: []
selector:
action: {}
long_press_2:
name: Long press button 2
description: Action to run on long press of button 2
default: []
selector:
action: {}
long_press_3:
name: Long press button 3
description: Action to run on long press of button 3
default: []
selector:
action: {}
long_press_4:
name: Long press button 4
description: Action to run on long press of button 4
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'single_press_1'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'single_press_2'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'single_press_3'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'single_press_4'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'double_press_1'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'double_press_2'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'double_press_3'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'double_press_4'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'long_press_1'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'long_press_2'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'long_press_3'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'long_press_4'

View File

@@ -0,0 +1,228 @@
blueprint:
name: ZHA - Tuya 6 Gang Portable Remote
description: 'Control anything with a Tuya 6 Gang Portable Remote.
You can set functions for a single press, double press and long press of each of the four buttons. This allows you to assign,
e.g., a scene or anything else.'
source_url: https://forge.slopez.fr/homeassistant/blueprints/raw/branch/main/Z2M/tuya/6_gang_portable_remote.yaml
domain: automation
input:
remote:
name: Remote
description: Tuya 6 Gang Portable Remote to use
selector:
device:
integration: mqtt
manufacturer: TuYa
model: TS0046
single_press_1:
name: Single press button 1
description: Action to run on single press of button 1
default: []
selector:
action: {}
single_press_2:
name: Single press button 2
description: Action to run on single press of button 2
default: []
selector:
action: {}
single_press_3:
name: Single press button 3
description: Action to run on single press of button 3
default: []
selector:
action: {}
single_press_4:
name: Single press button 4
description: Action to run on single press of button 4
default: []
selector:
action: {}
single_press_5:
name: Single press button 5
description: Action to run on single press of button 5
default: []
selector:
action: {}
single_press_6:
name: Single press button 6
description: Action to run on single press of button 6
default: []
selector:
action: {}
double_press_1:
name: Double press button 1
description: Action to run on double press of button 1
default: []
selector:
action: {}
double_press_2:
name: Double press button 2
description: Action to run on double press of button 2
default: []
selector:
action: {}
double_press_3:
name: Double press button 3
description: Action to run on double press of button 3
default: []
selector:
action: {}
double_press_4:
name: Double press button 4
description: Action to run on double press of button 4
default: []
selector:
action: {}
double_press_5:
name: Double press button 5
description: Action to run on double press of button 5
default: []
selector:
action: {}
double_press_6:
name: Double press button 6
description: Action to run on double press of button 6
default: []
selector:
action: {}
long_press_1:
name: Long press button 1
description: Action to run on long press of button 1
default: []
selector:
action: {}
long_press_2:
name: Long press button 2
description: Action to run on long press of button 2
default: []
selector:
action: {}
long_press_3:
name: Long press button 3
description: Action to run on long press of button 3
default: []
selector:
action: {}
long_press_4:
name: Long press button 4
description: Action to run on long press of button 4
default: []
selector:
action: {}
long_press_5:
name: Long press button 5
description: Action to run on long press of button 5
default: []
selector:
action: {}
long_press_6:
name: Long press button 6
description: Action to run on long press of button 6
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
action:
- variables:
command: '{{ trigger.event.data.command }}'
cluster_id: '{{ trigger.event.data.cluster_id }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
- choose:
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'single_press_1'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'single_press_2'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'single_press_3'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'single_press_4'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 5 }}'
sequence: !input 'single_press_5'
- conditions:
- '{{ command == ''remote_button_short_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 6 }}'
sequence: !input 'single_press_6'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'double_press_1'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'double_press_2'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'double_press_3'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'double_press_4'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 5 }}'
sequence: !input 'double_press_5'
- conditions:
- '{{ command == ''remote_button_double_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 6 }}'
sequence: !input 'double_press_6'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 1 }}'
sequence: !input 'long_press_1'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 2 }}'
sequence: !input 'long_press_2'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 3 }}'
sequence: !input 'long_press_3'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 4 }}'
sequence: !input 'long_press_4'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 5 }}'
sequence: !input 'long_press_5'
- conditions:
- '{{ command == ''remote_button_long_press'' }}'
- '{{ cluster_id == 6 }}'
- '{{ endpoint_id == 6 }}'
sequence: !input 'long_press_6'