Hi, i’m trying to fade light on movement using run_at service but i’ve got some problems because callback are not executed in the times listed belowe.
do you know if is there a way to do it?
and this is the log, callback is not executed in the right sequence
2018-04-26 22:02:56.556105 INFO luce_moviento_ingresso: live 40 percento
2018-04-26 22:02:56.558722 INFO luce_moviento_ingresso: live 30 percento
2018-04-26 22:02:56.559821 INFO luce_moviento_ingresso: live 20 percento
2018-04-26 22:02:57.604877 INFO luce_moviento_ingresso: live 80 percento
2018-04-26 22:02:57.609757 INFO luce_moviento_ingresso: live 50 percento
2018-04-26 22:02:57.616977 INFO luce_moviento_ingresso: live 70 percento
2018-04-26 22:02:57.618406 INFO luce_moviento_ingresso: live 60 percento
2018-04-26 22:02:58.416943 INFO luce_moviento_ingresso: live 100 percento
2018-04-26 22:02:58.419436 INFO luce_moviento_ingresso: live 90 percento
appdaemon doesnt work with microseconds, but in seconds.
you could try it wit time.sleep in between the commands but i dont think you get the effect you like.
i’m using IKEA tradfri, i don’t like the standard transition so i tried to do it myself.
i’ve tried the solution you posted but to have a good effect i would need to call the “turn_on” sevice very often with little tme.sleep (about 0.025) and it’s not supported because if i do 40 loops with 0.025 appdaemon take about 8 seconds (i’m having 4 calls per second).
Have you thought about creating a custom component? I don’t believe it has any timing restrictions, but it will be a bit more complicated to implement.
creating a transition like that is possible as you see, but if it is a desired way thats the question.
sending 40 turn_on commands in such a short time will put quite a load on your system.
it could be that you run into other sideeffects in the future, while transitioning the light.
it could disturb network, other sensors, etc.
maybe you could try to use transition in a few steps. from 0 to 25, from 25 to 50 etc.
@petro a custom component would run into the same problems. the fact stays that you need to send 40 commands to the light to get the desired effect.
now that you mention it yes. @dvd78 have you looked at the configuration of the device itself? Maybe it has a configuration that allows you to adjust rampup.
@petro, unfortunately there is not configuration to adjust on device to fade it… @ReneTode i undetstand there could be some problems on network, i thought that there wouldn’t be problems for only 2 seconds. and the problems to use transition with big difference of brightess from one step and nex one is that you see light going on like a “stair”…