Tutorial - Advanced automatic light control with flows

Did not discover your tuturial until now (someone responded to it making it come up)
Nice to see how you structured you flows almost exactly the way I do.
See my post about how to structure flows

I do this too, but use some more categories (and different tags)

Also defining scenes and using virtual devices too :slightly_smiling_face:

And check on that too (using papertrails for it…)

Did not use this yet, but I do like the idea and flow

1 Like

Nice man thanks

I don’t quite get the momory function. What do you use this for?

This is used if you manually overwrite your light configuration. Image you have set the brightness of your lights to 100% via the wall switch, if you wouldn’t have the memory function, it would reset it to the value configured in Homey when it detects movement.

1 Like

Hmm. And what if I want a certain value to be set when motion is detected, except when the light has been set manually? Would I still nee the memory.

Second question is, 60 seconds on motion in a room timer is short isn’t it? For me they turn off very quickly eg when I’m reading.

@Marvin_Schenkel I think you made a typo in your flow.
The name of the variable you check is “BR_darklight” the name of the variable you set is “BR_lightdark”

@victoroos

This is exactly what the memory function + reset flows are used for. Whenever you manually set the brightness via a physical switch, it will update the variable with the brightness and will use that brightness value from then on. In my reset flows, I reset that variable back to it’s default value, so my preconfigured values are used again the night after.

60 seconds is a bit low when you’re reading in the bedroom. I’ve got it set to 15 minutes in the living room, but feel free to tune the variables to your liking :slight_smile: . That’s why I chose to use variables, so it’s easy to tweak :wink: .

Good find. I think it used to be called BR_LightDark and the name just got stuck in the flows after I had renamed my variable :wink: .

Nice article - Thanks for sharing!
How do you track if people in the house hold is at sleep or awake (or at home or away)?

Great flow, this is what i`m looking for years. I have a few questions:

  • How do you do the presence check that one of you is sleeping?
  • When I test the BR_ev_LumChanged_Dark it gives an error at the logic part BR_DarkLight is not exactly dark… I don`t know where that is coming from?
  • I m using the hue motion sensor which also has the Lux sensor in it. But when I create the flow the flow will be inactive. I don`t know why.
  • Your memory function is great, but it is a lot of work when I want do that with all the lights, is somethign also possible with the hue scene`s?
1 Like
  • I use a flic button (but you can use any smart button) to mark myself as asleep/awake,. You can also buy products like Under-mattress sleep tracker - Sleep Analyzer | Withings or even DIY one: Building a bed occupancy sensor for Home Assistant - Everything Smart Home
  • It is probably because you have not provided a value for the variable ‘BR_DarkLight’ before hitting ‘test’. Before testing a flow, you have to provide values for any variables that are used in the flow
  • I would need a bit more context before I can help you out with the lux sensor :wink:
  • It sure is a lot of work, but it does allow granular control over your lights. It is definitely possible to stick to the Hue scenes, but I don’t really see how that would help with the memory functions. A nice ‘middle way’ is disabling the automatic light flows whenever manual control is used. That way you do not have to store the brightness in variables, but can still override the programmed values for your lights. Then you can use a timer to re-enable automatic lights when you please.

Hi Marvin, thanks for your reply.

  1. Yes the button that’s simple and good idea.

  2. See my screenshots. I do not know what I`m doing wrong. Wk_ev_LumChanged_Dark|333x500
    Logic|690x490

  3. The flows with Lum sensor are inactive.
    Flow_inactive_with_Lum_sensor|602x500 Does the motion sensor needs to be configured in the hue app? Now it is also already detecting motion and its working.

  4. Great idea.

  1. You probably need to supply a value for ‘Helderheid’ in order to test your flow. I wouldn’t worry too much about it, this flow looks fine and should work as expected
  2. Your flow is not disabled. The grayed-out icon means you just cannot run this flow on demand (by pressing the icon). This is usually the case for flows the trigger based on events that supply data that is used in the flow (e.g. the ‘Helderheid’ in your case). Flows that just ‘do stuff’ without using data from the event can be manually triggered :).

Just wanted to say that this is a really fantastic tutorial! Have set it up this afternoon for my living room and entrance way, now just waiting for it to start getting darker to see it in action. Thanks for spelling everything out so clearly, it’s super appreciated!

1 Like

Hi there. Little bit of an update. I added a (THEN) ‘Stop Countdown’ step in the BR_ev_Motion_on_dark flow as I kept finding that my lights would randomly (or not randomly, but actually when the timer hits zero) go out and leave me in the dark. Think it’s because my Light/motion sensors (Develco) don’t detect lux/motion nearly often enough. Will see if this step helps keep the lights on, literally :wink:

Also, I’m trying to wrap my brain around how to make it so that in my Kitchen, when lux is between two values (i.e. 40 & 100) then only one of my four lights (kitchen bench) comes on. Then, once lux drops below 40, it reverts back to all lights. Will this require new flows and additional variables? Or is there some way to strong-arm it in somewhere? I’m new to Homey so all the flows and variable can get a bit overwhelming :sweat_smile:

There is a problem with Fibaro Dimmer 2. When turning off, the Dim_Level is set to zero. Any idea on how this can be resolved? The result is that the light doesn’t turn on again since the parameter is set to zero.

Can’t say I have the same thing. Turning off just turns off.

It it’s with Fibaro Dimmer 2, it sounds like you either have an error in the settings, or in the Flow. Try reset the Dimmer 2, I had an issue that was similar, and used the dimmer from an old Smartthings config. Resetting the dimmer, solved it. But the problem with Dimmer 2 is still that turning it off, sets the dimming to zero

Maybe you can use an extra condition in your flows that set the brightness:

  • Light is on
  • or [Leve] is not equal to 0

This way the brightness is only saved when the light is on.

The problem is that Fibaro sets the DimLevel to zero when it turns off. I can’t see how your rule will help in any way? Maybe you can avoid storing the DimLevel when turning off somehow, but I can’t figure out how.