Blueprint to use the Schneider Electric Wireless 4 button wall switch as a dimmer remote using ZHA Events.
Get started
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Blueprint to use the Schneider Electric Wireless 4 button wall switch as a remote using ZHA Events
Buttons programmed to act as a dimmer for lights. Left and right button control seperate entity(ies).
Single press turns light on or off (press up for on and down for off)
Long press dims light (hold up to increase brightness, hold down to decrease brightness)
Possible to set seperate start-level brightness for each button.
Dim level adjust brightness change in % for each dimming step, and dim delay adjust the speed of the dimming.
Standard values often works best, but if dimming is lagging / not smooth (often occurs when grouping multiple lights), increasing the delay lvl will give a smoother but slower dimming.
Reducing dim level and dim delay will give a quicker and more accurate dimming, but will require more cpu performance and may cause lag.
Works for: Wiser Exxact Battery-powered Wireless Switch 4 button
Model nr: WDE002924 (WS5001)
(ZigbeeID: FLS/SYSTEM-M/4)
Platform: ZHA
blueprint:
name: ZHA-Wiser Dim with 4-Button Wireless Wall Switch
description:
'Blueprint to use the Schneider Electric Wireless 4 button wall switch as a remote using ZHA Events
Buttons programmed to act as a dimmer for lights. Left and right button control seperate entity(ies).
Single press turns light on or off (press up for on and down for off)
Long press dims light (hold up to increase brightness, hold down to decrease brightness)
Possible to set seperate start-level brightness for each button.
Dim level adjust brightness change in % for each dimming step, and dim delay adjust the speed of the dimming.
Standard values often works best, but if dimming is lagging / not smooth (often occurs when grouping multiple lights), increasing the delay lvl will give a smoother but slower dimming.
Reducing dim level and dim delay will give a quicker and more accurate dimming, but will require more cpu performance and may cause lag.
Works for: Wiser Exxact Battery-powered Wireless Switch 4 button
Model nr: WDE002924 (WS5001)
(ZigbeeID: FLS/SYSTEM-M/4)
Platform: ZHA
'
source_url: https://gist.github.com/dlundgren44/3c7487e6ffbc71672b8710fac923923b
domain: automation
# Inputs
input:
wiser_ZHA_device-ID:
name: Schneider Wiser Wireless wall switch
description: 'Wall switch to be used to controll the lights.
Must be a Wiser Exxact Battery-powered Wireless Switch 4 button
Model number: WDE002924'
selector:
device:
integration: zha
manufacturer: Schneider Electric
model: FLS/SYSTEM-M/4
multiple: false
target_light_1:
name: Light(s) for left button
description: Light(s) to be controlled by the left button
selector:
target:
entity:
domain: light
target_light_2:
name: Light(s) for right button
description: Light(s) to be controlled by the right button
selector:
target:
entity:
domain: light
on_bright_1:
name: On brightness for left button
description: Brightness level in percentage when lights are turned on with the left button single press.
default: 50
selector:
number:
min: 1
max: 100
unit_of_measurement: '%'
dim_lvl_1:
name: Dim level for left button
description: Brightness difference for each dimming step with the left button.
default: 5
selector:
number:
min: 1
max: 10
unit_of_measurement: '%'
dim_delay_1:
name: Dim delay for left button
description: Delay for every dimming step with the left button.
default: 3
selector:
number:
min: 1
max: 5
unit_of_measurement: lvl
on_bright_2:
name: On brightness for right button
description: Brightness level in percentage when lights are turned on with the right button single press.
default: 50
selector:
number:
min: 1
max: 100
unit_of_measurement: '%'
dim_lvl_2:
name: Dim level for right button
description: Brightness difference for each dimming step with the right button.
default: 5
selector:
number:
min: 1
max: 10
unit_of_measurement: '%'
dim_delay_2:
name: Dim delay for right button
description: Delay for every dimming step with the right button.
default: 3
selector:
number:
min: 1
max: 5
unit_of_measurement: lvl
# Actions
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input wiser_ZHA_device-ID
action:
- variables:
command: '{{ trigger.event.data.command }}'
endpoint_id: '{{ trigger.event.data.endpoint_id }}'
args: '{{ trigger.event.data.args }}'
dim_lvl_1: !input dim_lvl_1
dim_lvl_2: !input dim_lvl_2
dim_delay_1: !input dim_delay_1
dim_delay_2: !input dim_delay_2
delay_1: '{{ dim_delay_1**2 * 30 }}'
delay_2: '{{ dim_delay_2**2 * 30 }} '
- choose:
# LHS Up Short press
- conditions: '{{ command == ''on'' and endpoint_id == 22 }}'
sequence:
- service: light.turn_on
data:
brightness_pct: !input on_bright_1
transition: 1
target: !input target_light_1
# LHS Up Long press
- conditions: '{{ command == ''move_with_on_off'' and endpoint_id == 22 }}'
sequence:
- repeat:
count: '{{ 100 / dim_lvl_1 }}'
sequence:
- service: light.turn_on
data:
transition: 1
brightness_step_pct: '{{ dim_lvl_1 }}'
target: !input target_light_1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: '{{ delay_1 }}'
# LHS Down Short press
- conditions: '{{ command == ''off'' and endpoint_id == 22 }}'
sequence:
- service: light.turn_off
data:
transition: 1
target: !input target_light_1
# LHS Down Long press
- conditions: '{{ command == ''move'' and endpoint_id == 22 }}'
sequence:
- repeat:
count: '{{ 100 / dim_lvl_1 }}'
sequence:
- service: light.turn_on
data:
transition: 1
brightness_step_pct: '{{ dim_lvl_1 * -1 }}'
target: !input target_light_1
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: '{{ delay_1 }}'
# RHS Up Short press
- conditions: '{{ command == ''on'' and endpoint_id == 21 }}'
sequence:
- service: light.turn_on
data:
brightness_pct: !input on_bright_2
transition: 1
target: !input target_light_2
# RHS Up Long press
- conditions: '{{ command == ''move_with_on_off'' and endpoint_id == 21 }}'
sequence:
- repeat:
count: '{{ 100 / dim_lvl_2 }}'
sequence:
- service: light.turn_on
data:
transition: 1
brightness_step_pct: '{{ dim_lvl_2 * 1 }}'
target: !input target_light_2
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: '{{ delay_2 * 1 }}'
# RHS Down Short press
- conditions: '{{ command == ''off'' and endpoint_id == 21 }}'
sequence:
- service: light.turn_off
data:
transition: 1
target: !input target_light_2
# RHS Down Long press
- conditions: '{{ command == ''move'' and endpoint_id == 21 }}'
sequence:
- repeat:
count: '{{ 100 / dim_lvl_2 }}'
sequence:
- service: light.turn_on
data:
transition: 1
brightness_step_pct: '{{ dim_lvl_2 * -1 }}'
target: !input target_light_2
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: '{{ delay_2 }}'
# Stop conditions after long press, LHS and RHS
- conditions: '{{ command == ''stop'' and endpoint_id == 22 }}'
sequence:
- stop: Stop dim light 1
- conditions: '{{ command == ''stop'' and endpoint_id == 21 }}'
sequence:
- stop: Stop dim light 2
default:
- stop: Stop dim