GE Z-Wave Motion Sensor Switch

The Unofficial SmartThings Blog
Jump to: navigation, search

The GE Z-Wave Motion Sensor Switch is combination on/off switch and motion detector that when configured with the proper SmartThings device type handler (DTH) can locally control a light when there is movement in the room. This document outlines the installation and usage of this custom DTH. In addition, this DTH allows for you to directly control other Z-Wave switches within your SmartThings environment, allowing you to have a bit of automation without the need to program.

GEMotionSwitchDTH.png

Summary

Product: GE Z-Wave Motion Sensor Switch (Model 26931)

Capabilities: Motion Sensor, on/off Switch

Type: In-wall mounted on/off switch with motion sensor capabilities

Protocol: Z-wave Plus

Device Type Author: MichaelStruck (talk) 17:02, 3 January 2016 (EST) with code originally from @mlebaugh

ST Community Handle: https://community.smartthings.com/users/michaels/activity

Contributions: @Darwin (Motion Sensitivity Settings, programming interface, double press, testing)

Latest Version

The latest version of the device code is as follows (as of 12/6/18):

   GE Z-Wave Motion Sensor Switch DTH: 
   Version: 1.0.5
   https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/devicetypes/michaelstruck/ge-motion-switch-26931.src/ge-motion-switch-26931.groovy

Open Source License/Trademarks

Licensed under the Apache License, Version 2.0 (the "License"); you may not use the GE Z-Wave Motion Sensor Switch DTH code except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

Installation

First, copy the code from the following GitHub location:

   https://raw.githubusercontent.com/MichaelStruck/SmartThingsPublic/master/devicetypes/michaelstruck/ge-motion-switch-26931.src/ge-motion-switch-26931.groovy

Click the Raw link, and then select all of the code (CTRL+A), and then copy it (CTRL+C) to your computer’s clipboard. Then go to the SmartThings IDE at http://ide.smartthings.com. Log into the site and proceed to the link at the top labeled My Device Types. Click on this link.

MyDeviceTypes.png

This will present you with a list of custom device types that you may have within your account. If you do not yet have the GE Z-Wave Motion Sensor Switch listed, click the link +New Device Type in the upper right-hand corner of the screen.

+newDevice.png

There will be three tabs at the top, which represent the different ways to add a device. Choose From Code and you will be presented an empty area where the code you copied earlier can be placed. In the open area in the middle paste (CTRL+V) this code.

From here, simply Save and Publish this code.

DeviceSavePublish.png

   Notice
   The code for the GE Z-Wave Motion Sensor Switch only needs to be installed in this manner once; 
   you can add multiple Z-Wave Motion Sensor Switches as long as this code is in place.

You can now go through the normal process of adding devices to SmartThings.

Advanced Installation

For advanced users who have their SmartThings IDE integrated with GitHub, the installation and maintaining of code becomes very simple. This manual will not go into detail about setting up your IDE with GitHub; those instructions can be found here: http://docs.smartthings.com/en/latest/tools-and-ide/github-integration.html?highlight=git

Once you have integration, the code you might need will be available to you to download and keep in sync with the latest versions.

  • First, find the Settings button at the top of your SmartThings IDE page under My SmartApps or My Device Handlers(this button will only appear after you integrate with GitHub). For the virtual dimmer, you should be under the My Device Handlers section

IdeSettings.jpg

  • Clicking this button will open the GitHub Repository Integration page. To find the GE Z-Wave Motion Sensor Dimmer Switch code, enter the information as you see it below:

Owner: MichaelStruck

Name: SmartThingsPublic

GitHubIntegration.jpg

  • Close the GitHub Repository Integration page
  • Next, click the Update from Repo button at the upper-right corner of the IDE
  • On the right-hand column, scroll down to click the apps you want to install. This will typically be:
   GE Z-Wave Motion Sensor Switch: devicetypes/michaelstruck/ge-motion-switch-26931.src/ge-motion-switch-26931.groovy
  • Click the Execute Update in the bottom-right corner of the screen. When done syncing, the new device handler should now appear in your IDE. If they ever change color, that indicates a new version is available.

Settings

Using the 'gear' in the upper right corner of the DTH (See Item "F" on GE_Z-Wave_Motion_Sensor_Switch#Interface), you can access some of the advanced settings for the DTH.

General SmartThings Options

Option Settings/Notes
Name This is the name of the switch that will be seen by other applications and SmartThings.
Icon This is the icon associated with the switch and will be seen throughout the SmartThings app

DTH Specific Options

   Please Note
   The settings marked as 'Default' will be applied to the switch regardless
   of whether you have set them within the Settings area. The only item
   this does NOT apply to is the Operating Mode. If this is left blank in the 
   Settings the value will NOT be changed from what it was previously (be 
   it Manual, Vacant or Occupied.
   
   Also note that tapping 'SAVE' on the Settings page will overwrite 
   all settings that may have been set, including any settings that
   have been set programmatically. The dashboard on the main interface
   will show you which settings differ from the Settings page.
Option Settings/Notes Programming Access
Operating Mode This allows you to set the operating mode to one of the 3 modes listed below:
  • Occupancy - Used in conjunction with the settings below, the light will turn on when motion is sensed and off when the motion stops
  • Vacancy - Similar to Occupancy, except the light will not automatically come on with motion. However, it will turn off after motion has subsided
  • Manual - This disables the automation within the dimmer switch, allowing it to behave just like a normal switch. Please note the motion sensor can still be used with other SmartThings' applications even in 'Manual' mode (as long as the motion sensor setting below is enabled)

As mentioned above, leaving this area blank in the Settings area will retain the current operating mode

Y
Timeout Duration This is utilized only in the "Occupancy" and "Vacancy" modes and is the amount of time after the motion sensor stops sensing motion that the lights will turn off. The default time is 5 minutes and can be set as short at 5 seconds, and as long as 30 minutes. To disable this functionality, you can set the operating mode to 'Manual' N
Triple Press Timeout Like the option above, this is utilized only in the "Occupancy" and "Vacancy" modes. However, this timeout will only be initiated if you press the 'on' (top) button three times within 10 seconds of each other (this does NOT get implemented if you programmatically send the on command three). This timeout overrides the setting above. When the light it turned off (either through physical press or programmatically), the original settings are re-implemented. It is NOT recommended you press the button in rapid secession to implement this override; instead a simple press (turning on the light), then waiting 1 second, press the on button again, wait 1 second, then press a final time will do just fine. N
Triple Press Mode By setting this option, when the physical 'off' (bottom) is pressed twice withing 10 seconds (physical presses only) it will override the currently set operating mode. A good use case for this would be a switch in a guest room that is normally in the 'vacant' operating mode, which will not turn on the light, but will turn it off after a time of inactivity. If a guest arrives and does not need to turn off the light automatically, pressing 'off' three times within 10 seconds then back on could put the switch into 'manual' operating mode. Please note there is not an override for this; you must use the app or programmatically change the mode again N
Enable Motion Sensor With this setting, you can enable or disable the motion sensor. Doing this will affect the Operating Mode listed above. Y
Motion Sensitivity When the motion sensor is activated above, you can set the sensitivity of the detector from low, medium (Default) to high Y
Enable Light Sensing Used exclusively with the "Occupancy" operating mode, this will sense the light in the room and determine if the light will come on with motion. Unfortunately, the light levels are NOT exposed to SmartThings and are used internally by the switch itself. Turning this option off will simply allow the motion sensor (if enabled) to control when the light automatically comes on. Y
Invert Remote Switch Orientation This setting, while defined as orientation by GE's documentation, does NOT change the orientation of the dimmer switch itself; the top button of the switch will always be the 'on' position and the bottom switch will always turn off the switch. However, if you have a 'child' switch connected via the 'traveler' wire, this child switch WILL have its on/off orientation swapped (inverted) N
Motion Reset Cycle This is the amount of time after motion stops that the DTH will report out that the motion has stopped. You can choose to disable this (if the motion detector goes on, it stays on), or chose a time between 10 seconds to 27 minutes. The default is 20 seconds N
Association Groups This is a very unique feature of this DTH. When set up, it allows you to control other switches (Z-Wave only) when physically pressing the main dimmer switch associated with this DTH, or activated through the local (motion detector controlled) activation. Simply place the Device Network ID (from the SmartThings IDE>>My Devices) in one of the two lists provided. Separate each device with a comma; then, when you press the "on" button from the main dimmer (or is activated through the local motion detector option in the "occupancy" mode), all of the Z-Wave devices will go on as well. This control is only one way; you can not go to one of the 'associated' Z-Wave switches and turn it off and expect the main switch to react, unless you have this DTH on THAT switch as well. Please note that these commands bypass the normal SmartThings cloud. Turning on remote lights via this method MAY NOT properly show the correct status of the associated switches in the SmartThings Mobile Application N

Interface

The interface for the DTH is rather straight forward and is consistent with other SmartThings devices, but there are a few custom buttons you should be familiar with:

GEMotionSwitchDTHGUI.png

Item Name Notes
A On/Off Indicator/Button Just like an ordinary switch, this area not only shows the state of the switch, but also acts as a button to turn on or off the device with a tap
B Version Number This is informational and will show the version and date of the DTH.
C Motion Detector This is an indicator of the motion registered at the dimmer. Please note that the device may appear non-operational if the settings are turned off for the motion detector
D Operation Mode Button This indicates the current operation mode (Occupancy, Vacancy, Manual) for how the device reacts to motion. You can also tap this button to toggle the modes one at a time
E Refresh This refreshes the display when tapped. Some actions may require you to leave the DTH and come back into it to see the changes
F Dashboard This area shows you individual settings that could differ from your global device settings (due to other apps controlling aspects of the DTH)
G Settings This area allows you to access the advanced settings of the DTH (See: GE_Z-Wave_Motion_Sensor_Switch#Settings)

Dashboard

The small section at the bottom of the main page is designated as a dashboard. This area shows settings that can be changed by other applications. If you see a double exclamation points (!!) appear in front of a setting, that means it differs from the settings you set up in the Settings area (or the default values if you haven't set up a specific value for some of the settings).

GEMotionSwitchSync.png

   Please note
   If you are upgrading from a previous version, you MAY see 
   an empty dashboard or simply two dashes (--). To resolve this, 
   enter the Settings area and save the settings. Your 
   dashboard should now be visible.

Developer Notes

While a user can set the capabilities of the dimmer using the Settings area (GE_Z-Wave_Motion_Sensor_Switch#Settings), advanced users/developers can access many of these same settings from applications using the commands below. Many of these commands are already used in applications like WebCoRE or Ask Alexa. Changing these setting via other applications will display a log entry in SmartThings' Live Logging. Please note that all these commands are case-sensitive.

On/Off

Just like an ordinary switch, you can use the standard SmartThings commands for lighting:

device.on()
device.off()

Operating Mode

These 3 commands can be used to set the operating mode for the switch and how it reacts to motion (Vacancy, Occupancy, Manual). Please note that you MUST have the motion detector enabled in order to utilize some of these functions.

Vacancy

These commands set the operation mode to 'Vacant'. This means that the switch will NOT turn on automatically, but will turn off automatically based on the motion parameters you have set up. Please note there is no preference on which command you utilize; both will place the device into the 'Vacancy' operations mode.

device.vacancy()
device.vacant()

Occupancy

These commands set the operation mode to 'Occupancy'. This means that the switch will turn on and off automatically based on the motion parameters you have set up. Please note there is no preference on which command you utilize; both will place the device into the 'Occupancy' operations mode.

device.occupancy()
device.occupied()

Manual

This command set the operation mode to 'Manual'. This means that the switch will not turn on or off automatically.

device.manual()

Motion Sense

These commands allow you to set the sensitivity of the motion sensor (when activated) via Groovy programming or through the WebCoRE interface. You can also turn the motion sense capability off using the device.setMotionSenseOff() command.

device.setMotionSenseLow()
device.setMotionSenseMed()
device.setMotionSenseHigh()
device.setMotionSenseOff()

If you change this to a level (or off) that differs than how you have it set within the device's settings area, a small "!!" will appear in your dashboard to indicate this.

GEMotionSwitchSync.png

   Please Note
   If you programmatically set the motion sense to anything but off
   and the motion sensor is currently disabled, this action will not 
   only set the sensitively of the motion sensor, but it will also enable
   it.

Light Sense

These commands will programmatically set the light sensor. The light sensor is used while in "Occupancy" operational mode to determine if the light should come on in response to motion. If you change this setting and it differs than how you have it set within the device's settings area, a small "!!" will appear in your dashboard to indicate this.

device.lightSenseOn()
device.lightSenseOff()

Timeout Delay

These commands are only used in the "Occupancy" and "Vacancy" modes. "Timeout delay" is the amount of time after the motion sensor stops sensing motion that the lights will turn off. Instead of sending a specific time, there are commands for each of the options, from 5 seconds to 30 minutes. Any requirement of anything longer that 30 minutes and you should consider using the "Manual" mode with requires a ZWave (programmic) or physical push of the 'off' button to turn off the light. If you change this timeout and it differs than how you have it set within the device's settings area, a small "!!" will appear in your dashboard to indicate this.

device.setTimeout5Second()
device.setTimeout1Minute()
device.setTimeout5Minutes()
device.setTimeout15Minutes()
device.setTimeout30Minutes()

Community Discussion

You may participate in the community discussion for this DTH here:

https://community.smartthings.com/t/release-ge-z-wave-motion-switch-26931-and-motion-dimmer-26933-version-1-0-2/131305