So I have a version of this driver that breaks the dimmer and motion sensors into child devices. I kind of like that idea as the device really is 2 devices in 1. I've been poking around on this for the last few days, but seems to work as expected.
Parent device manages the motion lighting control functions (defaultDimmerLevel, occupancy/vacancy/manual lighting control, motion lighting timeout, etc)
Child Dimmer and Motion Sensor use the stock in-box Generic Component drivers.
Not sure if I am going to publish it or not, if anyone else besides me is interested in this oddball idea I might though.
I could also add that functionality into a single driver with child component option - but I don't really want to do that, as one of the things I like about doing it this way is that the parent device only has the commands it needs. If I make it an all-in-one the parent will have all of the dimmer commands in it again, making it bulky and ugly.
Edit: I will also be changing the "Debug Logging" command in my drivers to be a dropdown with timer settings (OFF, 30m, 1h, 3h, 6h, 12h, 24h, ON) at some point. Irritates me when debug logging turns off after 30m and I'm still troubleshooting.
@JasonJoel Hey, so. I'm using your cool "parent/child" driver and I wanted to change my switch from "occupancy" to "manual" (and back) in certain cases.
I'm stumped about how to do it (I don't see any relevant custom actions that are surfaced to do that on the parent device, regardless of what device type I use).
So, this driver allows the motion sensor to function independently of the load allowing me to use its state to control other devices?
I don't currently have one of these devices but I am looking at replacing a couple of switches and if this would also allow me to do away with my Dome motion sensors that would be a huge plus.
Automatic control of the local load via motion. It basically makes it a regular smart light switch/dimmer - not motion activated. which may be what you want?
So when in manual mode:
motion does nothing to the local load
motion reading still comes into hub
switch/dimmer can be operated from hub (or locally, of course)
* 2.5.0 (02/17/2021) - Removed erroneous duplicate event recording. Added new preference "Wait for device report before updating status." - defaults to off (the pre-2.5.0 behavior)
Probably, I'll look. The reporting is a really minor fix/thing.
The other item is a new reporting option, and would apply to the component driver as well. It is an option on purpose, as many people will want it off.
If your devices are not missing any commands, then the option is unnecessary and makes the status updates slower. If you have a device that misses commands on occasion, though, this will make it show the real status as reported by the device, with the side effect that hub initiated commands will report status slower (as they have to wait for the device to send the report).
The current behavior is that hub initiated commands change hub status immediately - they don't wait for the device to report back that they got the command and did the change. That works fine and makes things like dashboards update much faster as long as the device gets the command, but if it does not for whatever reason then status can get out of sync.