This is something I've been playing with for a few weeks, and maybe of use to more advanced users, or those who want to dive into code. I figured I'd share it..because it's fun to toil away in your own world, but maybe it could help others.
So my goal was to make a lighting app that ran in under 150ms, so when you see the blink on the motion sensor, or blink on the contact sensor the lights come on "instantly." Simple lighting does this, but:
- I wanted something more complicated than Simple lighting
- I hit several problems with Motion lighting. Maybe I didn't understand it...maybe it had bugs, but I got annoyed by it and went to RM4.
- I ended up with 10 RM4 rules that were almost the same
- I wanted something faster than RM4 to control lights via motion/switches/etc.
- I wanted to be able to complicate it, and maybe sacrifice speed for but only for certain lights
- Don't use this if your lights don't report state back. It only applies deltas, so if your light/switch/whatever is reporting off, but it's actually on then it won't get switched on/off consistently.
- Probably a ton of others, I warned you, it seems to work for me and gets past the GAF (Girlfriend acceptance factor)
- This is probably built backwards. It's very easy for a child to call parent.function() so instead of keeping a list of child functions a parent can call, it would seem easier to keep a parent library of common functions and exposing it to the child. Ah well...next time?
- Always click done in the parent before adding children or your edits in the parent get lost. Arg.
Features: (you're still reading?)
- Built around a base app, PlugableLights. You will have to install one of these, App->Add User App. one for each motion or contact controlled lights.
- The base app turns on lights based on a motion sensor, or contact switch opening, and turns them off after a period when motion stops, or the contact closes.
- Optionally install as many of the feature plugins as you like.
- Plugin Mode: Change the level, or colortemp per hub mode
- Plugin Blocker: Have a (virtual) contact sensor block turning on lights
- Plugin Delay Off: Longer motion is active the longer the off time becomes when motion ends. Avoids the "sitting still, off, wave hands"
- Plugin Force On: Have a (virutal) switch turn on and force the lights on regardless of motion
- Plugin Short Off: If there's a very short Motion Off->On transition there's almost certainly someone there, so it adds a longer off period
- Plugin Max On: turn the lights off after a period regardless of motion/contact. Aka someone left the closet door open.
- The kind of neat part, you can instantiate the "plugins" more than once. For example you can force on on multiple switches by making multiple force on children. Surely this will lead to mostly more confusion than good...but I am using it.
I don't know what happens if you mix to many conflicting plugins together...for example the blocker and the force on...might work?
Here's what my config looks like: