Closed bob-oey closed 4 years ago
Your profile modifying/copying script could restart Prismatik process.
But the best solution would be to use the ambient light (regardless of the time of the day), and the simplest way to do this is to plug a photoresistor into an analog pin of your board and scale the brightness in the firmware depending on the value read from the pin. You'd need to be careful while positioning the photoresistor to avoid feedback loops.
There is a couple of opened issues here about smoothing, check them out.
Restarting Prismatik is pretty smart, although it would cause a fast on/off cycle on the LEDs every time, which would be annoying when doing gradual transitions. I thought hooking into Prismatik itself would be nicer, but at that point it may be more useful to implement it in the actual codebase. It seems a bit of a mess (no offense) regarding use of languages I don't have experience in (Pascal...) to me though so I'm not sure it's feasible.
I did find the smoothing issues, but it is not clear to me which versions were actually used to build that; I could only find a 404'd link to several builds.
I'm not 100% sure, but if you brutally kill the process it might leave the lights on as it will skip the proper shutdown routine (that's what happens in debugging anyway or on crash). Meh, putting it in Prismatik is less than ideal imo, since it will do it regardless of your real light conditions, unless your lights are on the same schedule and never change (or if you use home automation, in which case you could sync everything up with scripts).
You could ask fork authors for a build. Also there are firmware side implementations of this iirc.
Thank you for your thoughts. I just realized there's an API through which I should be able to do all of this! There's even a python library for it (py-lightpack) :).
Yes there's an API. You should also be able to just run Prismatik.exe start (or something similar, I'm not sure) and it will talk to the running instance. To trigger it, use task scheduler / cron.
It would be nice to have brightness scale during the day (peak during daylight, reduced in nighttime). Many ways to implement this of course, but I feel an easy one would be different profiles per time slot. This time schedule could also be a profile in itself, but may be harder to implement.
A workaround fix could be using a script that just modifies/changes the profile.ini file, but I haven't found a way to make Prismatik automatically reload the profile on detected file change (or just once every t time units).
Unless I'm missing something! I feel I am also missing something regarding the lack of (temporal) smoothing using an Adalight setup (Arduino Nano/APA102). Would love to hear how others are handling this, as the light changes are very fast (good) but a bit too fast for comfort.