Skip to content

Instantly share code, notes, and snippets.

@Kagee
Created February 29, 2020 18:19
Show Gist options
  • Save Kagee/4cdc84d77c3c57651eef6dfa5e36171c to your computer and use it in GitHub Desktop.
Save Kagee/4cdc84d77c3c57651eef6dfa5e36171c to your computer and use it in GitHub Desktop.
- 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