hjgsr
(Sebastian)
January 19, 2020, 4:33pm
1
I took Dim (and brighten) lights via a remote example and modified it so that it can be used for multiple lights.
Operation is simple: by long pressing the button, normally assigned to toggle the light, it will be brightened in intervals until it reaches maximum brightness, then it will dim it to minimum brightness and so on until the button is released. I use it with IKEA on/off zigbee remote but in my configuration a single remote controls 2 smart bulbs instead of 1.
automation.yml
- id: 'remote_dim_living_room_bulb'
alias: remote dim living room bulb
trigger:
- device_id: 977ed79430444f9dab60df1c7035c4fd
domain: deconz
platform: device
subtype: turn_off
type: remote_button_long_press
action:
- service: script.turn_on
This file has been truncated. show original
configuration.yml
input_number:
light_step:
name: 'Light dimmer step'
initial: 64
min: 1
max: 64
step: 1
light_minimum:
name: 'No dimmer than this'
initial: 1
This file has been truncated. show original
scripts.yml
light_start_dimmer:
fields:
light:
description: 'Light entity id'
example: 'light.ikea_bulb_1'
sequence:
- service: script.turn_on
data_template:
entity_id: >-
{% if state_attr(light, 'brightness')|default(1)|int < states('input_number.light_maximum')|int %}
This file has been truncated. show original
Full configuration:
1 Like
jimz011
(Jim)
January 19, 2020, 5:15pm
2
Didn’t know we could trigger a deconz event this way. I always use the event id’s but this seems not necessary this way.
This is created automatically through the automation editor. I think you can’t easily find the device id to do the same in manual automations. Anyway I think the “normal” way is more readable.
jimz011
(Jim)
January 19, 2020, 6:54pm
4
I make automations with deconz like this (event id’s are pretty easy to find though)
- alias: 'Livingroom Philips button 2 tap_action'
initial_state: 'on'
trigger:
platform: event
event_type: deconz_event
event_data:
id: ab_woonkamer_muur
event: 2002
action:
- service: light.turn_on
data_template:
entity_id: light.woonkamer
brightness: >
{% set bri = state_attr('light.woonkamer', 'brightness') | int %}
{{ [bri+30, 249] | min }}
but your method sounds cool to experiment with, thanks
1 Like
It’s not my method, I just commented *goes on preparing for HKI