Aeon Labs Smart Energy Switch DSC06

Thanks, I’ll try it.

Lately I’m having a similar problem the the switch turns on or off maybe 1/4 of the time or less. I have a bunch of rules in Rule Machine turning it on and off throughout the day, and thought my problems were due to SmartThings’ scheduling issues, but lately, most of the rules are reliably running, but the switch is just ignoring them. Is this other people’s experience, and any idea if it’s another platform problem or an issue with this switch?

How far away from the hub is the switch? Maybe do a repair mesh. I had a reliability issue with one of my z-wave plugs (different brand), I added another plug between the hub and plug, repaired the mesh and no more issues.

It’s about 15 feet, unobstructed. I may try another repair mesh, but there’s only two other z-wave device in the house, so it’s not a complicated network. I wonder if the problem is that there’s too much other hardware around the hub - router, Pi, TV right above it. I may try spreading things out

I’d recommend that for sure. Once I got my zwave mesh expanded out, I was able to move my ST hub to a very secluded location away from any electronics, and out of sight.

I enjoy looking at the power consumption when the outlet is active, but when it is not active is still logs “Power Is 0 W” in the Activity Feed every minute. Is it possible for the device to log the wattage only when it changes (or when it is non-zero)?

Thanks!

Yes, you should be able to. Who’s device handler are you using? If you’re using the one above, we’ll need some help from James.

I’m using a similar device handler that sets the switch to only report when there’s a 5 watt or 10% change, and both of those are configurable. Look at post #80 above to see what it looks like and a link to the code. I’m using these devices for my washer, dryer, and a TV.

So far I have been using James’ version. I tried to add yours as another device handler and the IDE didn’t like it. Does that mean I have to delete the device and start over?

So I have not tried this code but it should not break anything…

You could add the line below in the MeterReport handler at line number 446

//Check if the value has changed my more than 5%, if so mark as a stateChange
map.isStateChange = ((cmd.scaledMeterValue - previousValue).abs() > (cmd.scaledMeterValue * 0.05))
map.displayed = map.isStateChange || (cmd.scaledMeterValue > 0)  //<=== Add this line

This should only display values in the log if it is changed or if it is greater than zero. That should eliminate all the reporting of the zero values.

Good luck.

Hi @kkfh,

It shouldn’t have caused you problems. You definitely don’t need to delete and start over for just a device handler. Were you having problems creating a new device handler? If so, look here for step by step instructions:

http://thingsthataresmart.wiki/index.php?title=Using_Custom_Code

Would you mind trying again?

https://raw.githubusercontent.com/constjs/SmartThings-Devices/master/aeon_smart_switch.device.groovy

Hi @jpansarasa,

Your patch works for me with minor mods:

//Check if the value has changed by a threshold, if so mark as a stateChange
map.isStateChange = ((cmd.scaledMeterValue - previousValue).abs() > deltaThreshold)
map.displayed = map.displayed && map.isStateChange

The issue was that the scaledMeterValue could be something like 0.00134 and in that case isStateChange is true even though it shouldn’t be and I still get an Activity Log unless I change the isStateChange update logic a bit.

Thanks!

Hi @johnconstantelo,

Thanks for the link. I simply cannot add a new device handler when there is an existing one (from @jpansarasa). But all I had to do was to paste over the old version of the code with yours and it works.

With your device handler, when the wattage is at zero, the switch status on my mobile looked strange (it shows some text instead of On vs Off).

I’ll play with that some more.

Are you using the same meta data name for both ? That is likely your issue.
When I want two version I usually name one adding -Beta
For example
definition (name: “My Aeon Metering Switch v2-BETA”, namespace: “jscgs350”, author: “SmartThings”) {

This also helps you identify the two versions when you are switching between them in the device manager of the ide.

Can you post a screenshot from your phone? Even though I just updated the code to allow you to change the icon, the new app format isn’t allowing it. Also, are you using Android?

FWIW, this is the error that I got @Ron. Adding -BETA didn’t seem to help.

Org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]

See attached shot @johnconstantelo. The status icon on the right doesn’t show On/Off. Instead it shows the text.
I’m using an iPhone.

@kkfh, that’s really weird. When you look at the device itself, do you see a value like this:

Here’s what I see when looking at a list of devices:

Yes, everything looks great inside the device itself. It’s just the device listing that looks wrong. Perhaps it is a bug in the iOS app?

@kkfh, ah maybe! I think I remember reading something similar. Give me a little bit to look into this.

@kkfh, Try this:

https://raw.githubusercontent.com/constjs/SmartThings-Devices/master/aeon_smart_switch.device.groovy

I made a small change so that the value isn’t seen as a string. Also after updating, please tap on the “Reset ALL” tile.