Ijust picked up these can light LED bulbs. I'd like guidance on the best approach to automate this. Here's how they work. The modes are controlled by the switch. When the bulb is on in full-brightness mode, then you quickly turn it off then on, it switches to a night light mode (a ring around the outside with warmer light). In night light mode, it's the same: with the switch on, turn it quickly off-on, and it switches to normal mode. The modes will remain in place until switched. That is, if you turn off the switch when in night light mode, and some time later turn the switch on, it is on in night light mode. Not until you do the quick off-on thing does it switch modes. Oh they are also dimmable.
So my question is, what's the best approach to encapsulate that logic? There's some state management and some sequences. I'd like to automate those and ideally make it so that I can create scenes that just tell those lights to go into night-light mode, for example, without the scene having to know what state the lights are currently in or otherwise having to re-implement any of that logic in each scene.
The first thing you'll need to do is confirm that Hubitat can control the dimmer fast enough to trigger the flipping of the light. Can you set up a rule that fires the off/on (or on/off/on) command without putting in a delay and have the switch still be controllable. Depending on your mesh, you are firing up to three commands within milliseconds of each other. Not every device can handle that. If you had to put in a one second delay between each command, would that still work to switch the light?
If so, almost everything you want can be done. The only part that cannot be done easily is Hubitat knowing which mode (full brightness or night light) the bulbs are in. To solve that issue, you'll probably need to create a Hub Variable that gets changed each time the light bulb switches modes. Basically, any time you initiate the command sequence to switch the bulb, you'll also add an action to set the Hub Variable.
It works, but not as consistently as I hoped. I think I initially misunderstood the Delayed parameter. After experimenting with it I think it sets an independent timer at the beginning of the action for each step with a delay? So the delay is specified as a delta from the start of the rule? Is there a way to just say do one action, wait 1 sec, do the next action? Also, I'm not sure the difference between Toggle and Dim actions with respect to the dimmer; they seem to do the same thing. Is there a difference?
After experimenting with it I think it sets an independent timer at the beginning of the action for each step with a delay? So the delay is specified as a delta from the start of the rule? Is there a way to just say do one action, wait 1 sec, do the next action?
Delayed on an action like you have is just a delay from the start of the rule running. So, when it gets triggered, the toggle is delayed one second and the second dim is delayed for two seconds immediately before running. Instead of a delay, you would also use "wait for event - elapsed time" between each action. This would functionally give you the same thing. It would probably be a little cleaner to use the wait in order to troubleshoot in the logs, but either should work for your needs.
Dim will set the light level of the dimmer. Toggle, will either turn on or off the switch depending on its current state (basically turn it off it is on and on if it is off). I don't know if I would recommend using toggle as it might add a little bit of complexity.
I should have mentioned. I first did the rule above with no delays and it didn't work at all. In fact the end state would be indeterminate almost like they ran in arbitrary order. So some delay is necessary. At first I was questioning whether RM was the right tool for the job.
The dim level is for the on command. With dimmers, Hubitat will send a setLevel command when it is toggling them on. Most dimmers turn on directly to the level when issued this. You can test by going to the device's page, make sure the dimmer is off, and then put a level number in and click Set Level. It should turn the dimmer straight to that value.
This is just the Zwave dimmer and mesh being unable to process the commands that fast. Waits between each action should help. As long as the light bulb flips modes with the 1 second waits between each command, you'll be able do all of this.
Sample Rule19201080 224 KB
Make sure that your bulb is on and at 100% before testing these actions. We can worry about logic later along with tracking state. The key is trying to get the actions correctly. These actions should dim the bulb to 5, turn off the dimmer, turn on the dimmer, and then set the dimmer back up to 100 with a one second wait between each command. For the on and off commands, use the actions under controlling switches rather than setting the dimmer the zero.
Thanks for your help. I've got something that works 95% of the time. I'll keep tweaking it. For some reason, the initial 25% dim works more reliably than a 5% dim. The last three actions look like they could be combined into one, but for some strange reason, the bulbs fail to switch modes if I do that.
I tested on both my Android smartphone and iPad, tried resetting the lamp, to no success. The Night Mode option (along with some others, like Movie, Romantic, etc) are all doing the same thing: applying full brightness to the lamp.
The function of the night light mode is: when you turn on the bedside lamp through the mobile phone app or the button on the lamp during the set night light mode, the night light mode will be automatically executed. It does not automatically switch to night light mode when the set time point is reached. Is that how you operate?
Subject. I do care about eyes (ish), so I have the "Night light" setting enabled almost always (Windows and android). But when I edit photos, I tempted to reduce color temp on them, and results looks cold for other people. How to keep the right color balance?
"Night Light" or "redshift" or other night light color apps don't do anything (as far as I know) to protect your eyes. Their intended function is to protect your sleep -- blue light is a signal to your system to remain awake. By reducing it for an hour or so before bedtime, the theory is that you'll find it easier to drop off to sleep promptly on hitting the pillow.
What I'd recommend in this regard is to disable your "night light" setting for photo editing, but then stop editing and turn the night light back on (or better yet, just get away from the screen, perhaps read a paper book) an hour before bed time. This will let you see the colors of your images accurately, and still protect your sleep.
The major problem with "night mode" probably is that it's by no means standardized.What you did not talk about is the ambient light:Do you edit in complete darkness?If so, the color temperature of your display "white" would adjust your visual system to white (within limits).However if you have an ambient light, the whole situation is much more complicated:Ambient light also infuences the "white point" if it's relatively strong.
I think a good analogy here would be trying to use rubber boots for running. Rubber boots are great when you are walking through mud (like night mode for doing something where colour reproduction is not critical, like reading StackExchange at night) but do a horrible job when used for running (editing photographs).
Simply put, you should calibrate your display for working on photographs and switch to night mode when doing something else, especially at night. And if you can avoid it, do not edit photos about an hour before going to bed.
Sure I am making it sound easier than it is in practice to slow down before making the pictures we all want to make. But in the long run getting it right in camera is easier than fixing things later. And taking as good a picture as you can is easier when you fully commit to taking as good a picture as you can while making the picture.
Hello,
yesterday my night mode settings stopped working.
I clicked "night mode" on the bar to access the settings: it was still set on "manual", but "from" and "to" fields were changed, showing a schedule I did not choose.
I played with the settings and I set a new timing to cover the whole day, but nothing happened, still not working.
More: after this attempt, the "night mode" icon completely disappeared from my menu bar (still accessible from the settings, though).
I actually ran into the same issue. So, I disabled Night Light and installed Redshift instead (you can find it in the app store). It works really well. Just make sure you enable Autostart after installing.
Ignore if you insist on manually setting this, but if not, try the "Sunset to Sunrise" option. You need to also turn on "Location Services". When this option is selected, the correct times will fill in immediately. Your system will adjust them as time goes on.
Sorry but I've been away from home for a while.
So...
Don't ask me why, but it started working again, more or less.
I mean: if I set the schedule from 04:00 to 03:59 to have the night light always on (as it has always been set since I started using Zorin) it doesn't work... but then I played again with timing and now set on a different time frame it works (07:00 to 05:58). Weird.
By the ways, I think "Always on" should be an option in the night-light settings, to be added to the already existing "Sunset to Sunrise" and "Manual".
I just came to the same conclusion after reading down to @Topaz post above. Tried it and as soon as I toggled the radio button on the top of the Settings/Privacy/Location Services screen, my 'Night Light' turned on immediately and actually stays on from Sunset to Sunrise.
I also don't know how often the Night Light polls for Location Services, or if it only requires that first toggle action I mentioned above. Either way, when disabling the radio toggle for Location Services again, the Night Light stays on - though again, for what duration I don't know yet.
3a8082e126