#License Copyright (c) 2014 Brian S. Lowrance ([email protected])
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 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.
#Description
SmartThings app to control bathroom lights based on motion / humidity
Version 1.0.2
An app for SmartThings that will turn on a bathroom light based on motion, start a timer
and turn the light off after motion has stopped for a period of time (5 minutes by default); however
adjust the timer if it appears that humidity is rising in the room (ie: Shower in use).
#Installation
- Login at http://graph.api.smartthings.com
- Go to "My SmartApps" section and click on the "+ New SmartApp" button on the right.
- On the "New SmartApp" page, fill out mandatory "Name" and "Description" fields (it does not matter what you put there).
- Click the "Create" button at the bottom.
- When a new app template opens in the IDE, replace the contents with that in the .groovy file here
- Click the blue "Save" button above the editor window.
- Click the "Publish" button next to it and select "For Me". You have now self-published your SmartApp.
- Open SmartThings mobile app on iPhone or Android and go to the Dashboard.
- Tap on the round "+" button and navigate to "My Apps" section by swiping the menu ribbon all the way to the left.
- "Batroom Light Control" app should be available in the list of SmartApps that appears below the menu ribbon. Tap it and follow setup instructions (I recommend naming each app install with the name of the bathroom being controlled).
- 11/26/2014 - 1.0.1 - Initial Release
- 11/29/2014 - 1.0.2
- 1.0.2
- Modified pages to dynamic pages
- Added default app launch into Status page showing humidity, light, and fan status. Status page contains Configure button.
- Added auto-exhaust fan option (toggles on when humidity > avg. or off when humidity <= avg and humidity or light switch event occurs)
- Removed debug code that prevented analyzing "currentHumidity" and averaging/trending as intended
- Added in app notification event (not push notifications, but notices within the SmartThings mobile app) for testing/debugging purposes
- Modified logged data to better detect where we are in code based on Trace/Debug log.
- Added logging level option in code. 0 = off, 1 = on, 2 = debug. Configured by changing variable in initialize()
- General code cleanup (tabs/spacing, commenting, etc)
- Corrected issue with comparing current light change event with last known status.