Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Deconz_event automation to dim all 'on' lights

$
0
0

@nicktheguitar wrote:

I’m building the automations to use tradfri 5 button remotes as light switches for my kids, using the Deconz Conbee2 stick. I’ve got the one below to work dimming one light, but I’d like one button to work dimming two lights, but only if they’re on. The same goes for another button but for brightness.

How would the data template work if I were to add light.ed_lamp and a condition that the action would only work if the light were already on?

- id: 'ed_main_dimmer_from_switch'
  alias: Ed Main Dimmer From Switch
  initial_state: 'on'
  trigger:
    platform: event
    event_type: deconz_event
    event_data:
      id: ed_switch
      event: 3002
  action:
  - service: light.turn_on
    data_template:
      entity_id: light.ed_main
      brightness: '{% set bri = state_attr(''light.ed_main'', ''brightness'') |
        int %} {{ [bri-30, 0] | max }}'

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles