Motion, modes and overrides

Hello!

I have been trying to set up the lighting automation for a common kitchen for a while but the specific settings of some parameters have been quite confusing and I have not reached the desired result yet, so I thought to ask here and figure out if somebody can help me out.

Basically, the space will be divided into different parts and each part will have to react to two factors: motion perception and time of the day. The intensity of light (dimmers) for a specific time of day will have to increase when detecting motion; after a while, then, it will have to go back to the original intensity of the dimmers without turning the lights off. All this taking into account the possibility to regulate the light also through switches, which would be overridden by the time of the day/motion detection.

Making it into a scheme with a specific example so that it could be more clear:

  1. The basic dimmer settings would be set to:
  • 50% during the Day (from 06:00 to sunset+30 minutes),
  • 40% during the Evening (from sunset +30minutes to 01:00AM);
  • 20% during the Night (from 01:00 to 06:00 AM)
  1. When motion is detected by either of 2 sensors, dimmers’ intensity will increase by 30 (i.e. from 50 to 80, from 40 to 70 and from 20 to 50), in an independent way from the considered scenario (time of the day). It would be okay to create multiple rules according to time of day if necessary, I just wanted to specify mode is not relevant but only relative to an overall increase in intensity.

  2. After 60 minutes of no motion detected by either of the sensors (both inactive), the system get back to the basic dimmer settings as mentioned in point 1 (either by an override function or by lowering the dimmers by 30% in all scenarios)

  3. More over, we have to consider the presence of a Switch on the dashboard that regulates the lights independently, so it would be great if any manual change done with the switch could be overridden after 60 minutes and brought back to the basic dimmer settings mentioned in point 1.

Thank you in advance for the help and hope someone can figure this one out!

Carlotta.

I would do this with 3 rules in the Rule Machine app, though there are likely other options. If you decide to go with this option, and run into issues, take a snapshot of the rule and post it here, and I or someone else from the community should be able to help.

Rule 1:
Trigger:
Certain Time: 6:00

Action:
Dim lights to 50%
Wait for event: sunset +30 minutes
Dim lights to 40%
Wait for event: Time becomes 1:00
Dim lights to 20%

Rule 2:

Trigger:
Motion Detected from sensors

Action:
If Time between 06:00 and Sunset+30 minutes:
Set Dimmer to 80
Else if Time between Sunset+30 and 01:00:
Set Dimmer to 70
Else
Set Dimmer to 50
Endif
Wait Motion inactive and stays that way for: 0:60:00
If Time between 06:00 and Sunset+30 minutes:
Set Dimmer to 50
Else if Time between Sunset+30 and 01:00:
Set Dimmer to 40
Else
Set Dimmer to 20
Endif

For Rule 3, a Virtual dimmer will need to be created first. The virtual dimmer on the dashboard will not show the real dimmer value, except when it has just been adjusted.

Rule 3:
Create a Rule Variable: dimmerLevel

Trigger:
Virtual Dimmer Change

Action:
Set dimmerLevel to Virtual Dimmer
dim: dimmer: dimmerLevel
Pause Rules: Rule 1, Rule 2
Wait for duration: 60 minutes
Resume Rules: Rule 1, Rule 2
If Time between 06:00 and Sunset+30 minutes:
Set Dimmer to 50
Else if Time between Sunset+30 and 01:00:
Set Dimmer to 40
Else
Set Dimmer to 20
Endif

Hi!
Thank you so much for your input. I've been trying to implement the rules you've mentioned and I've been having some trouble making them work together. At some point after elaborating them, it seems like they either stop working or don't respond appropriately to the input (for example, the dimmer isn't changed after the set time, or virtual dimmer doesn't fix any manual change in the dashboard). Please disregard the waiting times in these rules, as they were only used to check in a faster way.
Thank you!



The first thing I would recommend changing is the else conditions that are followed by an if. They should be an “ELSE-IF” command. Let’s try this fist and if it doesn’t fix the issue, we can continue debugging.

This change will be required in 2 spots in the second rule:

And in 1 in the 3rd:

Hi!

Thank you so much for the reply. I set everything that was mentioned according to your suggestions, using else if clauses instead of the separate ones, and I'm still having the same issues – motion doesn't work and the action doesn't follow through everything. I am attaching the updated screenshots so that maybe we can find other issues.
Thank you again!


Can you describe a specific situation that isn’t working properly? With this, we can run through the rule and see if something might be missing, or if the issue might be elsewhere.

Ideally as well, you can turn on all logging for the rules and then share a screenshot of these logs when the issue occurs.