Instead of separate automations for turning light on/off, increasing/decreasing brightness and stopping the increase/decrease I would like to combine all of this in one automation using [choose].
I have the individual automations working very well but when I make the combined version only light on and light off works.
All automations have been made from the graphical userfase so I did not write the code directly.
As I have now spent quite some time searching for the solution I would really appreciate any kind of help to find the problem, so thank you in advance for your time spent here.
Below are my individual automations for turning on the light, increasing brightness and stopping the increse of brightness. This works very well:
- id: '1606411576373'
alias: Trådfri Lampe On
description: ''
trigger:
- device_id: a5bd785166b8486313ec97e92455e3d5
domain: deconz
platform: device
type: remote_button_short_press
subtype: turn_on
condition:
- condition: device
type: is_off
device_id: 1af06852fd574f1e6cb621b41ad8d80e
entity_id: light.lampe
domain: light
action:
- type: turn_on
device_id: 1af06852fd574f1e6cb621b41ad8d80e
entity_id: light.lampe
domain: light
mode: single
- id: '1606350872297'
alias: Trådfri Lampe Increase
description: ''
trigger:
- device_id: a5bd785166b8486313ec97e92455e3d5
domain: deconz
platform: device
type: remote_button_long_press
subtype: turn_on
condition: []
action:
- service: deconz.configure
data:
entity: light.lampe
field: /action
data:
bri_inc: 254
transitiontime: 30
mode: single
- id: '1606690107599'
alias: Trådfri Lampe Increase stop
description: ''
trigger:
- device_id: a5bd785166b8486313ec97e92455e3d5
domain: deconz
platform: device
type: remote_button_long_release
subtype: turn_on
condition: []
action:
- service: deconz.configure
data:
entity: light.lampe
field: /action
data:
bri_inc: 0
mode: single
Below is my combined automation where only turning on the light works (that is 1002):
(The event codes have been checked and I am sure that they are right)
- id: '1606762112503'
alias: Trådfri Lampe
description: ''
trigger:
- platform: event
event_type: deconz_event
event_data:
id: tradfri_on_off_dimmer_2
condition: []
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event == 1001 }}'
sequence:
- service: deconz.configure
entity_id: light.lampe
data:
entity: light.lampe
field: /action
data:
bri_inc: 254
transitiontime: 30
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event == 1002 }}'
- condition: device
type: is_off
device_id: 1af06852fd574f1e6cb621b41ad8d80e
entity_id: light.lampe
domain: light
sequence:
- service: light.turn_on
data: {}
entity_id: light.lampe
- conditions:
- condition: template
value_template: '{{ trigger.event.data.event == 1003 }}'
sequence:
- service: deconz.configure
data:
entity: light.lampe
field: /action
data:
bri_inc: 0
default: []
mode: single
Best regards