Power Meter Outlet

Is there a power outlet that is just a power meter and not a switch? Basically this https://www.smartthings.com/products/smartthings-outlet-2017, but without being a switch. I want to monitor power consumption on a device that I do not want turned off.

Not really. There are “Home Energy Meters” (HEM) which measure current through induction in the wire, by they aren’t as accurate and require a split wire.

You could copy the Device Type Handler and disable the on()/off() commands (but that wouldn’t block the button on the device itself). And then the DTH would no longer be eligible for local execution.

I have a couple plugs with power metes that I just don’t switch them off. Like @tgauchat said if you want you can edit the on/off methods to do nothing. What’s this for? Freezer, fish tank?

1 Like
  1. I have some plug-in’s like you that I don’t want turned off - the fridge I explicitly command ON 2-3 times a day by mode changes, and I never intentionally turn it off. Also as suggested above, I revised the device type but to put the power meter on the default/main tile, so it is less likely that I will accidentally touch the switch tile.

  2. you could try device type/device handler “Simulated Power Meter” and webcore to drive it. This has worked well up to this point, though the “Simulated…” device types may be deprecated by SmartThings for my purpose - I am not a coding expert nor familiar with these standards. I just wanted the unit to be watts and this delivered.

This technique allows me to submeter an arbitrary group of physical or virtual/simulated power-reporting devices, so it is easy to summarize several power devices on one tile in ActionTiles (for example), keeping the dashboard small.

In the attached piston, I have limited the sampling of some of the power metering switches to lower the data consumption.

1 Like

I want to monitor when my sump pump runs using the power usage. I would never want my sump pump turned off, just notifications when it uses power.

What kind of plug do you have?

It might be as easy as installing a custom DH.

Edits line 15, change the name to “ZWave Meter Switch Disabled”

Then comment out lines…

156-161 and 165-170.

Then assign this DH to that device.

But this really depends on what switch / plug you have…

1 Like

Yeah, I have a couple that I use for monitoring.

Just write a Piston that says:

If switch changes to Off
Then
With Switch
Turn On

If switch is Off
Then
With Switch
Turn On

1 Like

Sorry to dig up an old thread here, it appears that Simulated Power Meter is no longer available in the default devices. Anyone have a working device handler for this?

maybe try “virtual power meter” or similar - nope.

Geez. Is smartthings losing power? Is it a metaphor, foreshadowing, what?

I think below is my crappy early solution that adapted a simulated temperature sensor for power readout on ActionTiles. I don’t think the units are watts (so it kinda sucks). No warranty and no support:

/**
  • Copyright 2014 SmartThings - ADAPTED SIMULATED-TEMP-SENSOR TO SIMULATED-POWER-METER
  • 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.

*/
metadata {
// Automatically generated. Make future change here.
definition (name: “Simulated Power Meter”, namespace: “ero4444”, author: “ero4444”) {
capability “Power Meter”
capability “Energy Meter”
capability “Sensor”

	command "up"
	command "down"
    command "setPower", ["number"]
}


// UI tile definitions
tiles {
	valueTile("power", "device.power", width: 2, height: 2) {
		state("power", label:'${currentValue}', unit:"F",
			backgroundColors:[
				[value: 31, color: "#153591"],
				[value: 44, color: "#1e9cbb"],
				[value: 59, color: "#90d2a7"],
				[value: 74, color: "#44b621"],
				[value: 84, color: "#f1d801"],
				[value: 95, color: "#d04e00"],
				[value: 96, color: "#bc2323"]
			]
		)
	}
	standardTile("up", "device.power", inactiveLabel: false, decoration: "flat") {
		state "default", label:'up', action:"up"
	}        
	standardTile("down", "device.power", inactiveLabel: false, decoration: "flat") {
		state "default", label:'down', action:"down"
	}
    main "power"
	details("power","up","down")
}

}

// Parse incoming device messages to generate events
def parse(String description) {
def pair = description.split(":")
createEvent(name: pair[0].trim(), value: pair[1].trim(), unit:“W”)
}

def setLevel(value) {
sendEvent(name:“power”, value: value)
}

def up() {
def ts = device.currentState(“power”)
def value = ts ? ts.integerValue + 1 : 72
sendEvent(name:“power”, value: value)
}

def down() {
def ts = device.currentState(“power”)
def value = ts ? ts.integerValue - 1 : 72
sendEvent(name:“power”, value: value)
}

def setPower(value) {
sendEvent(name:“power”, value: value)
}

THE END

Thank You!!

So I did end up getting it to work yesterday using the simulated temperature sensor, but it showed the degree mark next it. I had originally gone down the road of trying to edit the simulated temperature sensor, but I didn’t know what I was doing, so it didn’t work. Your device handler held the key to get it to show up in Watts! Thank you soooo much.

(why is pre-formatted text tool so finicky?)
Here is what worked for me(perhaps helping someone down the road), using the Simulated Temperature Sensor as a template, I changed the capability based on what you posted, and included the Health Check as well. I then replaced temperature with power and Temperature with Power. I also changed unit to W from F, and the default integer to 0 from 72.

/**
 *  Copyright 2014 SmartThings - ADAPTED SIMULATED-TEMP-SENSOR TO SIMULATED-POWER-METER
 *
 *  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.
 *
 */
metadata {
    // Automatically generated. Make future change here.
    definition (name: "Simulated Power Meter", namespace: "dj", author: "dj") {
        capability "Power Meter"
        capability "Energy Meter"
        capability "Sensor"
        capability "Health Check"

        command "up"
        command "down"
        command "setPower", ["number"]
    }

    // UI tile definitions
    tiles {
        valueTile("power", "device.power", width: 2, height: 2) {
            state("power", label:'${currentValue}', unit:"F",
                backgroundColors:[
                    [value: 31, color: "#153591"],
                    [value: 44, color: "#1e9cbb"],
                    [value: 59, color: "#90d2a7"],
                    [value: 74, color: "#44b621"],
                    [value: 84, color: "#f1d801"],
                    [value: 95, color: "#d04e00"],
                    [value: 96, color: "#bc2323"]
                ]
            )
        }
        standardTile("up", "device.power", inactiveLabel: false, decoration: "flat") {
            state "default", label:'up', action:"up"
        }
        standardTile("down", "device.power", inactiveLabel: false, decoration: "flat") {
            state "default", label:'down', action:"down"
        }
        main "power"
        details("power","up","down")
    }
}

// Parse incoming device messages to generate events
def parse(String description) {
    def pair = description.split(":")
    createEvent(name: pair[0].trim(), value: pair[1].trim(), unit:"W")
}

def installed() {
    initialize()
}

def updated() {
    initialize()
}

def initialize() {
    sendEvent(name: "DeviceWatch-DeviceStatus", value: "online")
    sendEvent(name: "healthStatus", value: "online")
    sendEvent(name: "DeviceWatch-Enroll", value: [protocol: "cloud", scheme:"untracked"].encodeAsJson(), displayed: false)
    if (!device.currentState("power")) {
        setPower(getPower())
    }
}

def setLevel(value, rate = null) {
    setPower(value)
}

def up() {
    setPower(getPower() + 1)
}

def down() {
    setPower(getPower() - 1)
}

def setPower(value) {
    sendEvent(name:"power", value: value)
}

private getPower() {
    def ts = device.currentState("power")
    Integer value = ts ? ts.integerValue : 0
    return value
}
2 Likes

OMG that was hard to copy-paste. Now I’ve got low blood sugar. Really - somewhere the double-quotes got translated to Microsoft’s subtle and unique OPEN-double-quote and CLOSE-double-quote.
and couldn’t find missing close-brackets.

I need a nap - what is the RIGHT way to post program listing?

It does look ok - Thanks.

Use triple back-quotes on a line by itself, before and after the code block:

image

Result:

private getPower() {
   def ts = device.currentState("power")
   Integer value = ts ? ts.integerValue : 0
   return value
}
1 Like

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.