Hey guys!
I want to increase and decrease some lights with the “rotate” action from my Aqara Cube.
After searching the forum i decided to use an automation like this:
- id: '1601415207224'
alias: Dim light from cube
description: ''
trigger:
- platform: state
entity_id: sensor.aqara_cube_terrasse_action
to: rotate_left
attribute: action
- platform: state
entity_id: sensor.aqara_cube_terrasse_action
attribute: action
to: rotate_right
condition:
- condition: state
entity_id: sensor.aqara_cube_terrasse_action
state: '0'
attribute: side
action:
- service: light.turn_on
entity_id: light.schreibtischlampe_buro
data:
brightness: "'{{ (state_attr('sensor.aqara_cube_terrasse_action','angle') / 5 ) | int }}'"
mode: single
While testing it (in the development template testing tool) the template seems to work. The Angle rotation is translated to a +/ - value. But after using it in the automation, nothing happens to the lightbulb. Does someone has any idea? Where is the fault?
Best regards!
Marcus
Sorry i’m new to HA. I have a Blueprint but thats it. With a Mediaplayer i can adjust the volume etc. but for the lights a Dimmer is missing.
I use aswell the mqqt binding and the Blueprint from “SirGoodenough”. I came from openhab where you just could create a Dimmer Switch and the use it wherever you want. Is this here a possibility?
Otherwise it would be really nice, if someone can give me a code snippet on how to dimm lights.
I just need it for 1 Side on the cube, so i can dimm multiple lights and Mediaplayers (which is already working)