I’ve modified the SmartThings energy app (normally turns off switches if an energy threshold is exceeded) to turn on switches if a set threshold is exceeded. Otherwise, it turns them off.
Normally you would use a remote, or a load sensing outlet to manage a dust collector (vacuum) when a power tool is powered up. I’d like to use a few of these: Aeon Labs DSC06106-ZWUS - Z-Wave Smart Energy Switches to manage the dust collector automatically. I have this working right now with the SmartThings smart plugs, however they are only rated for 12amps.
Right now, this app turns on one or multiple switches ( connected to dust collector(s)) if one SmartPlug (with energy monitoring) exceeds the user-set threshold. It would be about perfect if you could monitor multiple smart plugs (each connected to a power tool) and turn on one or more switches for the dust collector(s). I’m wondering if one of you could modify this code so that you can choose multiple Smart Plugs so that if any of them exceeded the set threshold, the switches would power up. All of the Smartplugs would be need to report below the threshold to trigger all of the switch(s) to power-off.
This way if you have 2 or 3 machines powered by smart plugs and connected to the dust management tubes, any of them powered up would in turn power on all the dust management switch(s). If all of the smart plugs are reporting below the set threshold, ideally you would wait about 5 seconds, then power all of the dust collector switches off.
I’m a code newbee…so was hoping one of you wizards could help me out Hope that makes sense. If this is a license issue, let me know. Doing this in RM is super easy, but as it is currently not an option for new users, I figured a Smart App would be nice. Cheers, Dennis.
/**
* Energy Saver
*
* Copyright 2014 SmartThings
*
* 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.
*
*/
definition(
name: "Dust Collector Smart Plugs",
namespace: "smartthings",
author: "SmartThings, modified by Dennis Wood",
description: "Dust collector plug management",
category: "Green Living",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png",
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png"
)
preferences {
section {
input(name: "meter", type: "capability.powerMeter", title: "When This Plug...", required: true, multiple: false, description: null)
input(name: "threshold", type: "number", title: "Reports Above...", required: true, description: "in either watts or kw.")
}
section {
input(name: "switches", type: "capability.switch", title: "Turn On These Switches (otherwise off)", required: true, multiple: true, description: null)
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}
def initialize() {
subscribe(meter, "power", meterHandler)
}
def meterHandler(evt) {
def meterValue = evt.value as double
def thresholdValue = threshold as int
if (meterValue > thresholdValue) {
log.debug "${meter} reported energy consumption above ${threshold}. Turning on switches."
switches.on()
} else {
switches.off()
}
}