Window-Control Automation with color changing Light

Hi, I recently switched from Homebridge to Home Assistant and I am astonished by all the new features and possibilities! With Homebridge I organized all of my Automations with HomeKit itself, but it was limited a lot. Another Solution is to use Home+ App on iPhone to get full potential for automations.
Anyways I wanted HA for more flexibility.

Now I got struck with the following: I have an Ikea Trader Shortcut button integrated with deconz which I want to use as a window control button:

Press it once, if all windows are closed it will turn on a specific RGB light in green for 10 secs, if any window is open it will turn the light on in red for 10 sec. (+ Bonus: Send a Notification on iPhone).

I integrated all window sensors, but doesn’t get it to run either with the delay, nor the color switch.
For more convenience I changed the brightness to 90 and 10 percent:

alias: Fensterkontrolle
description: ""
trigger:
  - device_id: d533200a019ddf07918587e342e4e625
    domain: deconz
    platform: device
    type: remote_button_short_press
    subtype: ""
condition: []
action:
  - if:
      - type: is_not_open
        condition: device
        device_id: eb1b4e6f592701a9c0b00e737862de03
        entity_id: binary_sensor.kuchenfenstersensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 452193bf8e7141b6f72954aed988440c
        entity_id: binary_sensor.terassentur_nord
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 5bb6e5f4d87e278de7b723e93c4e3e28
        entity_id: binary_sensor.burof_sensor
        domain: binary_sensor
      - type: is_open
        condition: device
        device_id: 324ca8a221f643a0bd5c5a010ebb88d6
        entity_id: binary_sensor.wohnzimmerfenstervornesensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 783eebc9c89d213fc097269a63ac9e70
        entity_id: binary_sensor.terassentur_sud
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 59312ef590b007e911b95ee290817bfa
        entity_id: binary_sensor.buroh_sensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 783eebc9c89d213fc097269a63ac9e70
        entity_id: binary_sensor.terassentur_sud
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 56438fc87925552789c6845fb6aaf66b
        entity_id: binary_sensor.schlafzimmerfenstersensor
        domain: binary_sensor
    then:
      - type: turn_on
        device_id: eea3d4190f78df907e9f892e306d71e4
        entity_id: light.fensterkontrollleuchte
        domain: light
        brightness_pct: 90
    else:
      - type: turn_on
        device_id: eea3d4190f78df907e9f892e306d71e4
        entity_id: light.fensterkontrollleuchte
        domain: light
        brightness_pct: 10
mode: single

Any Idea how I can add the missing features?

Cheers
Fred

Hey Fred, welcome to Home Assistant!

Device actions are limited. Use service actions instead:

action:
  - service: light.turn_on
    …

Thanks, that did the trick for me, I wasn’t aware that the Service Option can also trigger lights!

Here is the final Automation, maybe I will add a Door Sensor on my main door which will trigger the automation later instead of the shortcut button:

alias: Fensterkontrolle
description: ""
trigger:
  - device_id: d533200a019ddf07918587e342e4e625
    domain: deconz
    platform: device
    type: remote_button_short_press
    subtype: ""
condition: []
action:
  - if:
      - type: is_not_open
        condition: device
        device_id: eb1b4e6f592701a9c0b00e737862de03
        entity_id: binary_sensor.kuchenfenstersensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 452193bf8e7141b6f72954aed988440c
        entity_id: binary_sensor.terassentur_nord
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 5bb6e5f4d87e278de7b723e93c4e3e28
        entity_id: binary_sensor.burof_sensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 324ca8a221f643a0bd5c5a010ebb88d6
        entity_id: binary_sensor.wohnzimmerfenstervornesensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 783eebc9c89d213fc097269a63ac9e70
        entity_id: binary_sensor.terassentur_sud
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 59312ef590b007e911b95ee290817bfa
        entity_id: binary_sensor.buroh_sensor
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 783eebc9c89d213fc097269a63ac9e70
        entity_id: binary_sensor.terassentur_sud
        domain: binary_sensor
      - type: is_not_open
        condition: device
        device_id: 56438fc87925552789c6845fb6aaf66b
        entity_id: binary_sensor.schlafzimmerfenstersensor
        domain: binary_sensor
    then:
      - service: light.turn_on
        data:
          rgb_color:
            - 0
            - 249
            - 0
        target:
          entity_id: light.fensterkontrollleuchte
      - delay: "00:00:10"
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.fensterkontrollleuchte
    else:
      - service: light.turn_on
        data:
          rgb_color:
            - 255
            - 38
            - 0
        target:
          entity_id: light.fensterkontrollleuchte
      - delay: "00:00:10"
      - service: light.turn_off
        data: {}
        target:
          entity_id: light.fensterkontrollleuchte
mode: single