Hi, I am trying to find some examples of increasing brightness in about 6 steps and when it reaches the maximum of 255 I would like it to switch to the minimum of 3.
I hava a xiaomi double switch and the left and right button will be used to increase the brightness (and decrease) of the front and back living room respectively.
The dual button I have set up to turn on and off these 2 lights plus the xiaomi gateway witch already works great.
Right now I have an automation that will only increase to 255 en decrease to 3.
How can I make it so it will be incremental and If it reaches 255 drop back to 3 so I can keep clicking?
This is a default behavior af the Mi Home app for increase brightness.
This is my automation at the moment:
Left swith
- alias: Switch brightness living room light front
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.wall_switch_left_XXXXXXXXXXXXXXXX
click_type: single
action:
service: light.turn_on
entity_id: light.living_room_rgb_front
data_template:
brightness: >
{% if states.light.living_room_rgb_back.attributes.brightness < 150 %}
255
{% elif states.light.living_room_rgb_back.attributes.brightness <= 255 %}
3
{% endif %}