Hey Ashley,
Congrats and thank you for the script, it is the by-far best effect that I was able to see, especially for the lamps which doesn’t support transition attribute.
I have (may be a dumb) question / goal. I am trying to use your script to simulate the transition
effect - as my lamp doesn’t accept transition key in the service calls. I am trying to adjust the brightness of the floor lamp with a philips hue tap dial switch…
Your script works great with buttons on the switch, like increasing the brightness from 10% to 70% in a second with a press on button 1, etc… very smooth transitions.
But I am also trying to make use of the dial to increase and decrease the light brightness with the turn of the dial. The dimmer switch supports, 3 actions for increase and decrease. Fast Turn Right, Slow Turn Right and Step Turn Right and similar 3 actions for left turns.
My goal was to use your script by creating a custom entity (sensor) which will have some more or less some value to the current brightness of the lamp, and I will be able to use that entity for the endBrightnessEntity
.
For example, if the current brightness of the lamp is 40 (0-255 range), I will have 3 custom sensors that I can use with your script - for the endBrightnessEntity value… (to keep 0-255 range)
sensor_increase_fast: current brightness of the light + 50 (so 40 + 50 => 90)
sensor_increase_slow: current brightness of the light + 25 (so 40 + 25 => 65)
sensor_increase_step: current brightness of the light + 10 (so 40 + 10 => 50)
Using your script in 3 different automations for increase, and another 3 automations for the decrease actions…
something like: (only the last line changes for the 6 increase / decrease automations)
service: script.ashley
data:
lampBrightnessScale: zeroToTwoFiftyFive
easingTypeInput: easeOutSine
endBrightnessEntityScale: zeroToTwoFiftyFive
autoCancelThreshold: 10
shouldStopIfTheLampIsTurnedOffDuringTheFade: true
shouldResetTheStopEntityToOffAtStart: false
shouldInvertTheValueOfTheStopEntity: false
minimumStepDelayInMilliseconds: 100
shouldTryToUseNativeLampTransitionsToo: false
isDebugMode: false
light: light.floor_lamp
transitionTime:
hours: 0
minutes: 0
seconds: 1
endBrightnessEntity: sensor.sensor_increase_fast ## or sensor_increase_slow or sensor_increase_step in each automation
This works ok but not with smooth transtion.
I guess when I turn the dial, the script is called multiple times and that’s why the transtion is not smooth anymore due to parallel executions. It still works but it looks very like linear increase then the smooth increase / decrease that I can get with the buttons.
Can you think of any solution for this kind of a use-case ?
2- I wish we could have used milliseconds in transitionTime
3- I wish the increase calls were able to get cancelled if there is a decrease (and vice-versa)
Thanks very much.
Marco