-
Description
I’m having a little trouble stepping through how I would code this, although it seems like it would be a fairly common use case. I want to set up one of the following combos (whichever method is cheaper and/or easier to program).
- motion sensor + smart wired dimmer with doubletap (like the Homeseer unit) + dumb bulb
- motion sensor + battery powered dimmer (like Osram’s) + smart bulb
- motion sensor + 3-button switch (is there one?) + smart bulb
I also want it to also behave mostly like a normal switch if someone manages to hit the switch before the motion sensor detects motion, and also have override capability. Note that I’ve set up a virtual switch called “Sleep Mode” that gets turned on when I go to bed.
The expected behaviors below assume option 1 or 2. I still need to check if there’s a neutral wire at this location. If not, then I’m left with 2 or 3. For option 3, the sentences below would change accordingly: the top button would be 100%, middle button 20%, and bottom button OFF. I don’t really need continuous dimming in the bathroom, I just need a way to control 3 different levels (off, dim, bright).
2) Expected behavior
- When the motion sensor detects motion, and sleep mode is on, turn ON to 20%.
- When the motion sensor detects motion, and sleep mode is off, turn ON to 100%
- When the switch is tapped UP 1x and sleep mode is on, turn on light to 20%, and stay at that level as long as motion is active, or unless the switch is tapped UP 2x, or tapped DOWN.
- When the switch is tapped UP 1x and sleep mode is off, turn on light to 100%, and stay at that level as long as motion is active, or unless the switch is tapped DOWN 1x or 2x.
- When the switch is tapped UP 2x, turn on the light to 100% regardless of night mode and stay that way as long as motion is active.
- When the switch is tapped DOWN 2x, turn on the light to 20% regardless of night mode and stay that way as long as motion is active.
- When the switch is tapped DOWN 1x, turn off the light and ignore the motion sensor for 30 seconds, unless the light is turned back on.
- When no motion is detected for 2 minutes, turn off the light.
3) What is happening/not happening?
I’m trying to avoid the following situations:
- if the switch is tapped on 2x, the light will come on to 100%, but as soon as the motion sensor detects motion, if night mode is on, it will fall back to 20%.
- if someone leaves the room and re-enters within 2 minutes, the light still turns off at the end of 2 minutes.
4) Post a Green Snapshot of the piston!
I haven’t created one yet, still trying to figure out how to code it.
5) Attach any logs (From [ST IDE]
N/A