Created
February 29, 2020 18:19
-
-
Save Kagee/4cdc84d77c3c57651eef6dfa5e36171c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- id: 'cube-adjust-brightness-rotation' | |
alias: Adjust brightness based on rotation | |
description: 'Adjust brightness based on rotation (desc)' | |
trigger: | |
- platform: event | |
event_type: deconz_event | |
event_data: | |
id: switch_6 # analog events | |
condition: | |
condition: template | |
value_template: > | |
{% set gesture_ops = ({ 8:"rotate left", 7:"rotate right" }) %} | |
{{ trigger.event.data.gesture in gesture_ops }} | |
action: | |
- service: light.turn_on | |
entity_id: light.skrivebordslys | |
data_template: | |
brightness_step: > | |
{% if trigger.event.data.event < 0 %} | |
-63 | |
{% else %} | |
63 | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment