AS
Size: a a a
AS
h
AS
AS
h
AS
V
O
V
Д
AS
DD
E
id: micube_brightness_rotate
alias: "MiCube rotate - Master lights"
initial_state: 'on'
condition:
- condition: state
entity_id: light.yeelight_lights_2
state: 'on'
trigger:
platform: event
event_type: xiaomi_aqara.cube_action
event_data:
entity_id: binary_sensor.cube_158d00027d8e39
action_type: rotate
action:
- service: light.turn_on
data_template:
entity_id: light.yeelight_lights_2
brightness: >
{% set state = (state_attr('light.yeelight_lights_2','brightness') + trigger.event.data.action_value|int) -%}
{%- if state > 255 -%}
{%- set state = 255 -%}
{%- elif state < 0 -%}
{%- set state = 0 -%}
{%- endif %}
{{ state }}
K
AS
K
AS
K