I have two Elgato Keylights at my desk and I have set up automations at every hour to change the brightness and color temperature throughout the workday. I use a new Big Timer node for every hour.
I am just wondering if this is the best way to do this, or if there is a more elegant way to accomplish this that I don't yet know about.
I have multiple lighting settings for multiple lights depending on time of day and light levels. But I long ago moved away from Bigtimer. Specifically, I moved to CRON+ for complex cases since you can easily define multiple schedules in a single node - typically, since I only have a limited number of lights, I use 1 node for each light. I also use node-red-contrib-sunposition to keep current sun positions and day/night variables that can play a part in the calculations.
That is obviously the most complex one. This is the simplest:
Not sure that you would describe these as "more elegant" though
Bigtimer is not elegant to begin with
With the default nodes from node-red you can get a long way, i would implement it something like this:
This will gradually increase/decrease the brightness over the course of 4 hours (every 240s +1 or -1). Ofcourse you can adapt to your liking.
An alternative way is to implement the within-time node from node-red-contrib-sun-pos
You can fire a message every minute through the stadnard trigger node and take actions if the time falls within a certain range - or cascade down to the next node
I use it for setting our electricity tarriffs based on time of day and time of year - here is a visual of the flow
Not related to the question asked by OP, but, I found that node-red-contrib-chronos (node) - Node-RED provides a much more elegant way to split your day (and more) in various ranges within the same node.
Typically, if I understand well what you do the 5 nodes off peak, evening peak, evening shoulder, day shoulder and weekend, can by merged into one.
An example with three "ranges" in one node.
The overall maintenance of the flow is simpler
will check it out thanks - does look like it might simplify it further.
Just looked at the Chronos nodes - unfortunately not going to simplify much as it only passes the message through - whereas the within time nodes i use allow me to send message properites to the next node (such as Peak, Off-peak etc) which are then used to set the global variables
Whilst chronos would allow me to simplify the number of time nodes i would then have to add a change node to each output to set the correct text for the next node
Thanks for the hint though as it does look good for some other things i do
Okay, so my setup with BigTimer wasn't actually working to change the state every hour, for some reason. It was only working to turn my lights on and off.
However, I set it up with Chronos Time Switch and now it seems to be working great!
The only thing I would like to include is a switch to turn the automation on and off. Any tips on how to do that? A quick search seems to suggest that I use switch node with a boolean.
Thank you for the reply. I did not end up using Cron+, but I did end up using Chronos (see my other comment) and got it working as wanted and expected.
Not at a computer but it seems to me you can have multiple schedules in cron+ with individual topics for each schedule. So you could use one timer node for many schedules and use the topic to determine which light. But to toss in with the others cron+ is probably the node to use whichever way you do it.
I do like the idea of using CronPlus to be able to create a control dashboard. However, I copied and imported the JSON on that page to check it out, but I couldn't figure out how or where to see the dashboard.
Cron+ doesn't have a dash board per se. You can add widgets to a dashboard to control it but there isn't one natively
Yep i typically have a swtich node at the start of all my flows with timed automations - it checks a Global variable to see if auto is set to yes and proceeds on - otherwise branches to nowhere.
Some of these variables i do at the GLobal level and others at the flow level depending on what makes sense for the project
How do you set up a Global variable? Can you link to an example?
For now, I set up some gate nodes with a toggle.
Easiest way to setup a global variable is using a Change Node - throw one on your flow and then read the help on it (after watching the stuff Bakman posted)
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.