Monitoring Power Outlet - Notifications?


(Steven) #1

I recently upgraded to the Hub v2, and along with it I got one of the smart power outlets. I have it paired up to the hub, and it’s working like a champ; I can remotely turn it on and off, and can monitor the power draw from it.

With the release of the new app alongside of the v2 hub, I’m having a hard time trying to find the little “extras” that can be configured alongside of the device (ex., things like “turn on when in a certain mode”, or “do something after sunset”, etc.). So, it’s entirely possible that I’m missing it, but I can’t seem to find where to tweak these additional settings on devices paired with the hub.

I know about the marketplace section, where you can download additional “apps” to allow for more control over the devices. But many of these are not SmartThings specific apps, and instead are developed by others.

I’m simply looking for a way to try to monitor power usage by the smart outlets, so that I can be notified once the power draw drops below a certain level. For example, I plugged my dead Surface 3 into the outlet last night to start charging. When charging, it draws about 15W of power from the outlet (~.0.125A@120v). Once it has fully charged, it drops to roughly 0.3W (0.0025A@120V), trickle-charging the battery to keep it topped off. Since the Surface (and other devices) can take a long time to charge, I’d love to be notified as to when the power draw from the outlets drops below a certain level (under 1W, for example). This would tell me that my device is fully charged, and ready to go!

Is there any way to add monitoring to the smart outlets, or add notifications if the output fluctuates or reaches a certain high/low value? This would be extremely helpful, as some devices seem to take an eternity to charge (I’m looking at you, iPad 4!), and it’d be great to know when it’s done, rather than having to check it out periodically and see the charging level of the device.

Thanks!


(sidjohn1) #2

Well in the market place there is a section called energy management, it seams like a logical place to look for power related apps, and goodness the first one it called energy alerts and when i install it i see that that it will do alerts on power too high and too low. All sarcasm a side that was not hard to find.


(Edward Pope) #3

New user, as you know sometimes things are not instantly found as a new users. We have all been there at some point. Thanks for helping him @sidjohn1


(sidjohn1) #4

I completely agree in general, but if you already familiar with the marketplace as stated above that app was really in a logical spot.


(Steven) #5

While I appreciate the help, your sarcasm was completely unwarranted.

IIRC correctly, the old app used to allow you to perform additional actions and monitoring on a device, from within the specific device itself. Now that that’s no longer the case, you need to go to the marketplace to do so. This disconnect in logic between the device, and actions, isn’t necessarily the most user-friendly method to provide additional monitoring on a device.

In addition, the app in particular that you mention states “Get notified if you’re using too much energy”. One would assume, when looking at this, that does just that - too much energy. It says nothing about lower power usage. Once I installed it, it does provide notification for power usage below a threshold, but it also requires an upper limit as well. I just gave it an arbitrary high number just to get it configured, but it seemed a bit of a kludgy requirement to give it a high value, when I simply wanted to know when the devices connected to it were essentially turned off.

Again, thanks for pointing me to the app, but your tone was unnecessary. Furthermore, I’m not “familiar” with the marketplace. I know it’s there, but as stated in my post, I’ve not done anything with regards to downloading additional “apps” off of there.


(Steven) #6

As an update, the aforementioned app, which does work, has some issues that need tweaking,and don’t fully cover the use case I was hoping for.

First off, when the app notifies on energy usage below the desired threshold level, it seems to be (I assume) in the format of (ex., 3 W, or 3 kW). However, it seems to have an issue determining what to display for measurement when notifying an alert. As a result, I get “3 null”, for example. There doesn’t seem to be a way to further configure the output measurement display (say, 3000 W, instead of 3 kW, for example), so it just seems to be stuck on “null”.

That’s not a huge deal, and I can overlook that. One of the problems I am still running into, however, it the level at which I’m notified. I was hoping for a notification when the power draw of the connected device DROPS below a certain level (say, when it drops from a 15 W charging rate, down to below 2 W, to dictate that it’s done charging). Instead, I get notified every time the wattage draw changes, if it’s below the certain threshold level. As a result, I’ll get 20 or so notifications, each with a different level as the draw decreases down to a trickle (ex., “1.9 null”, “1.8 null”, “1.7 null”, etc.) Definitely a bit of an annoyance!

Anyone else have any other ideas of a better way to monitor power levels? Maybe something with a bit more configuration to better determine how to be notified of changes?

Thanks!


(Edward Pope) #7

I found something that is close. But, I do not currently see anything that does exactly what you need. It should be simple to modify, but I am having an operation tomorrow so I will not have a chance to do so for a while.

/**
  • 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: “Energy Saver”,
namespace: “smartthings”,
author: “SmartThings”,
description: “Turn things off if you’re using too much energy”,
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 Power Meter…”, 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 Off These Switches”, 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 of switches."
switches.off()
}
}


(Steven) #8

Good luck on your surgery tomorrow!

Yeah, I might have to look to see if I can tweak it somewhat. I believe the one you linked to is an older version, as it only tracks if power is above the threshold. I think this is the current one in the marketplace:

The relevant code is as follows:

def meterHandler(evt) {

def meterValue = evt.value as double

	if (!atomicState.lastValue) {
		atomicState.lastValue = meterValue
}

	def lastValue = atomicState.lastValue as double
	atomicState.lastValue = meterValue

	def aboveThresholdValue = aboveThreshold as int
	if (meterValue > aboveThresholdValue) {
		if (lastValue < aboveThresholdValue) { // only send notifications when crossing the threshold
		def msg = "${meter} reported ${evt.value} ${evt.unit} which is above your threshold of ${aboveThreshold}."
	    		sendMessage(msg)
    	} else {
		// log.debug "not sending notification for ${evt.description} because the threshold (${aboveThreshold}) has already been crossed"
    	}
	}


	def belowThresholdValue = belowThreshold as int
	if (meterValue < belowThresholdValue) {
		if (lastValue > belowThresholdValue) { // only send notifications when crossing the threshold
		def msg = "${meter} reported ${evt.value} ${evt.unit} which is below your threshold of ${belowThreshold}."
	    		sendMessage(msg)
    	} else {
		// log.debug "not sending notification for ${evt.description} because the threshold (${belowThreshold}) has already been crossed"
    	}
	}

}

There appears to be a logic issue when setting the lastValue as the meterValue, as this blows away the logic attempt to alert only when crossing the threshold.

I think I’ll just copy their app and do it myself locally, and make it work as intended.

Thanks for pointing me in the right direction!


(Ernie) #9

I think you could modify the laundry notification app by @bmmiller. I believe it is designed to only send one notification once the threshold is crossed. You could easily change the text from laundry monitor to whatever your use case is.

@theedpope good luck on your surgery.


(Steven) #10

So, I used the one that I linked to, and fixed the issue with it reporting “null” in the alerts. (There’s no such property of ${evt.unit}, so I just hardcoded “W”.

The logic seemed sound for how it tracked when it crossed the threshold levels, so I published it locally and tried it out, and it seemed to work completely as expected.

I see that it was committed two months ago, whereas the version in the market shows that it was last updated 6 months ago. I’m not sure if that means that the Github linked one is newer, or if it was just copied from somewhere else recently. But it seems to work flawlessly. So, that’s the one I’ll be using instead!


(Chris May) #11

Hi, I am trying to setup something similar to what you are doing, but I’m actually looking for alerts if my usage goes over a certain level.

When I select Energy Management-> Energy Alerts but I seem to be stuck there with it saying “When this power meter…” and clicking it does nothing. Are you able to click that and select your outlet?

I don’t have an in-wall outlet, or a smartthings branded plugin outlet.

I have this one:

I’m wondering if I had a different outlet than I do, if I’d be able to select something on this part of the setup on the app.


#12

I’m wanting to do something similar, but instead of being notified when power consumption changes, I want to be notified at a specific time. The purpose is to check if a device has really turned on. I have a device that needs to be turned on every day at 11:30am, but some times the event does not happen. So I want to be notified if the device is not powered on at 11:30am. I currently get a notification only when the switch turns on, but when things fail, I get no notifications.


(Bobby) #13

This app + uDTH + SHM can notify you when you want and you can see the activity on the dashboard too.

Other were successful with CoRE. I had mixed results, so I wrote my own app.


#14

I think I found a solution. Using the SmartRules app, I created a rule to check at 11:31 AM if the device is consuming less than 5W. That means the device must be off and the routine to turn it on failed. It then sends me a text to my phone alerting me. That way I can remotely turn on the device using the app. Works great!


(kurian) #15

I have connected a inverter in my home 220V). I need a alert when power goes and inverter starts and also need a alert when power returns.
In the first alert we can reduce the powerv usage to save the battery od the inverter and get more time
In the second alert we can go for the normal usage as it is from the main power
Can anybody help to make a simple method to get a beep alarm sound