I have three outdoor motion-controlled floodlights that use FLS100+ Floodlight sensors that include a motion detector and can be set up to act autonomously so that motion detected will turn on the light for a certain period of time if it is dark enough. But I wanted to be able to disable this action so that if I am sitting outside at night and don’t want the lights coming on every time I move, I can set them up to ignore the motion. But I didn’t want to be able to forget I had set it up that way and leave motion detection disabled forever, either. And while I was at it, I thought it might be nice to have a mode where motion detected by one sensor would turn on all three of the units and keep the lights on until there is no motion detected by any of the units. I also set it up to allow a virtual switch to turn all three on/off and have the motion ignored.
The standard DTH from HomeSeer does not expose the parameters for setting whether or not the light is directly controlled by the motion sensor, so a modified DTH is required. Thanks to Nate Schwartz for his help with modifying the DTH. Here is a link to the modified DTH: (NOTE - This DTH was updated on 1/18/2019)
https://github.com/youngbru/SmartThingsPublic/blob/e7b4b05f8e025ac987bf6b2320d6c4014050a8f3/devicetypes/homeseer/fls100-motion-sensor.src/fls100-motion-sensor.groovy
I created 4 different pistons that use two global variables to share data between them, @FloodsMode sets one of three different modes of operation (Autonomous, Motion Control Disabled, and Locked Together), and @LuxValue is the parameter that is used to control the behavior of the motion detector in the FLS100+. I created three virtual buttons in ST to set the three different modes. In the future I plan on linking them to double-click functions on some wall switches. The first piston manages the mode of operation based on the virtual buttons.
Once the Autonomous Mode is set, the FLS100+ devices handle their activities autonomously, so not WebCore code is required. Likewise for Motion Control Disabled (the motion detectors are basically disconnected from the light control). But the Locked Together mode requires a piston to manage the devices and provide the proper behavior. Thanks to @WCmore for some pointers on this.
As I mentioned above, I set up a virtual switch to allow for manual control of the floodlights as a group. I should note that there is a corner case here that I couldn’t solve - it might just be something that the FLS100+ device can’t do. If the light is turned on by the internal motion sensor, and then the floods are manually turned on, a light that was autonomously activated will turn off after the preset time delay. Here is the manual control piston:
Lastly, I didn’t want to take the chance that the motion control would be disabled and forgotten about, so I created a watchdog reset which resets things to autonomous mode every morning. (NOTE that this piston has been updated - The updated piston is in the next post)
The HS-FLS100+ is a very nice device. I don’t know if this code would be that applicable to other motion sensor floodlights, but hopefully someone will find this interesting. I haven’t had a chance to extensively test it, but my testing so far indicates it is working as expected except for the one corner-case I pointed out above. This was my first non-trivial WebCore project, so I am pleased with how it turned out.