I suspect this is a very simple task but some reason i just can’t seem to find the appropiate action.
I have a dial to dim up/down lights and currently i have registered the trigger “dial_right/dial_left”. As an action i want to set the brightness of a light. The light integration is IHC so all ligths show up as entities and not devices (like hue lights does).
The light entity has the following state properties:
What im looking for is an action where I preferably can set any property of an entity, is this case the brightness prop.
Thanks in advance.
To change the brightness of a light, use the light.turn_on action and specify the brightness
or brightness_pct
. It doesn’t matter if the light is already on.
Thanks for that… got the light dimming up and down now. However i have one last tweak i want to implement.
The brightness adjustments at quite high (around 45) so it does not take for ever to dim the light. That also means is quite hard to hit the value 1 before turning it off with a 0.
Basically I want to add the following logic.
UP Trigger: IF (brightness == 0) set brightness = 1 ELSE brightness=+45
DOWN Trigger: IF (brightness != 1 && brightness - 45 < 1) set brightness = 1 ELSE brightness=-45
I quess its possible by add additional trigger conditions. However that seems a little cumbersom since its “my standard logic” i want on all dimmer actions.
Do i have to implementent a new type of trigger to achive my logic or are there actions where you can define your own logic ?
Use a template for the brightness. The down trigger template might look like:
{{ '1' if state_attr('light.YOUR_LIGHT', 'brigtness') | int(0) < 46 else '-45' }}
Thanks for pointing me in the right direction. Ill read up on the template and play around with it.