Introducing "Yet Another Power Monitor"

I wrote a SmartApp to monitor an Aeon Labs DSC06106-ZWUS - Z-Wave Smart Energy Switch. Originally I used the SmartApp from @sudarkoff which worked great until the hub marked the smart switch as inactive. I was speaking with @jabbera and his solution to this problem was to use the Pollster application from @geko to keep the switch active. This works well but it hurts my software architect sensibilities :wink:

So I wrote an application borrowing from both authors that combines Georgeā€™s monitor (without all of his fancy add ons - which are kinda cool) with Gekoā€™s use of the poll() method on a schedule to keep the switch active.

You can download the code here:

1 Like

Does this app allow the input of the electricity cost in our area to calculate the cost to run each appliance?

Cost metering was not the intent of the application. I use it to send a message when the power meter senses that a cycle of usage as ended.

It looks like someone has added a device type over in this thread Adding kwh cost to Aeon Labs Smart Switch, but it looks like it is a work in progress. The basic device reports energy in kilowatt-hours (kWh), so it should be simple math to figure out cost (assuming you do not have time-of-day pricing for electricity).

1 Like

Can you explain more what you mean by the hub marking the device as inactive? Iā€™m using these exact same devices with my own device type (referenced in the post by @sudarkoff ) and I donā€™t have a need to automatically poll them using Pollster. I only am really caring about instantaneous wattage though which updates every few minutes on its own.

For what itā€™s worth though, I do utilize Pollster for a few non-supported switches and it works great for what it is.

So my meter switch is on my washing machine. The washing machine in my house is used infrequently (once a week on Saturdays or Sundays). Since I had no application that polls the switch frequently, I would see itā€™s status turn to INACTIVE in the SmartThings Device List from the web interface. The instant I would turn off/on the device using the Android App, it would return to an ACTIVE state, and start reporting again. If I failed to do this step before using the washing machine, I would not see the activity reported by the SmartApp to the hub. But eventually, it would return to the INACTIVE state.

After talking with another user, he mentioned that polling the switch using Pollster would keep it in ACTIVE state (I guess the hub is supposed to poll the device on a schedule but something is amiss there). It just seemed like a kludge to install another SmartApp to make another one work. So this app polls like Pollster, and monitors like the Laundry Monitor.

One other thing, my Aeon Labs DSC06106-ZWUS - Z-Wave Smart Energy Switch is installed just as a ā€œZ-Wave Metering Switchā€. I did not write my own device type, just used on that was already available. Maybe that is the difference. I tried to keep it simple and not write a SmartApp and a DeviceType.

Thatā€™s interesting. I have a bunch of devices that are listed as INACTIVE and it doesnā€™t appear to have any negative effects anywhere. I essentially ignore the boolean status. You can ā€œgo intoā€ the device and see when the last activity was, which Iā€™m guessing is a better indicator of when it last communicated. Must be something with these devices that makes it unique and fail then? I also have two of these tied to our washer and dryer, continually reporting 0 (or 1 as one of my machines bottoms out at 1) when not in use. For what it is worth, spot checking my two right now does list them both as ACTIVE. I tend to agree with the problem likely being in the device type youā€™re using. I created my own because I was having issues with that device type which very likely might be the issues youā€™re seeing now. We just solved the problem in different ways.

All that being said, if this is working for you than great! Set it up and walk away very slowlyā€¦so you donā€™t scare it.

I have the same issue. These switches do not report their status for me. Iā€™ve installed pollster to alleviate the issue. This would be a one stop shop for me.

Iā€™m having an issue with this device, no matter which device type I use. It is not reporting the energy levels at all. I can hit refresh and it displays the energy level, but it doesnā€™t show up in the Device events. Iā€™m trying to use Laundry Monitor to notify when my laundry is done, but its never registering any events. Anyone see this issue? Iā€™m worried there might be an issue with the actual device I received.

Edit- Iā€™ve tried this device type and the default Z Wave Energy Switch type, along with Pollster in every configuration possible. I can see in the Device Events that pollster is polling, but no data is coming back. I have no issues with the actual mechanical switch, that works absolutely fine.

Are you talking about the Aeon Labs DSC06106-ZWUS - Z-Wave Smart Energy Switch? I wrote a new device type for the it and you can find it in over here:

Here are the steps that fix the device type (and make this app a little less useful since you donā€™t have to poll)

  1. Go to the IDE - https://graph.api.smartthings.com
  2. Click on ā€œMy Device Typesā€ along the top of the page
  3. Click on the green ā€œ+ New SmartDeviceā€ button near the upper right hand corner
  4. Click on the ā€œFrom Codeā€ tab
  5. Paste the code in from GitHub from the other thread and click the blue ā€œCreateā€ button on the bottom
  6. Click on the ā€œSaveā€ button
  7. Click ā€œPublishā€ and select ā€œFor Meā€
  8. Click on the ā€œMy Devicesā€ along the top of the page
  9. Select your Smart Energy switch from the Device List and click on the display name link
  10. Click on the ā€œEditā€ button at the bottom of the page
  11. Select the device type you just published - ā€œAeon Labs Smart Energy Switchā€ from the drop down list under ā€œTypeā€
  12. Click the ā€œUpdateā€ button on the bottom of the page

Hope that helps

Yes, I understand how to create the device type, I used your device type, and it is still not sending the energy level to the device events. Both your device type and the default type are not showing up in the log.

Sorry I originally intended to post this under the thread @jpansarasa started on the device type, not this energy monitor, but the problems Iā€™m having apply to both conversations I guess.

If you turn on debugging in the preferences, you should see a logging when you press the ā€œrefreshā€ button in the phone app. You should also see periodic logging from the device if debugging is turned on.

I hate to give the ā€œHave you turned it off and on againā€ answer but did you try removing the device and adding it back?

I turned on debugging, and Iā€™m still not seeing any events in the log. I did disconnect it from the network and reconnect, nothing betterā€¦

Letā€™s follow up on the thread about the device type, since it is not about the SmartApp

Trying to get this to work on V2hub and after setting up all the options and hitting done. It crashes th Smartthings app. :frowning:

Do you have changing colour in tile background?? If yes comment out the background color code and try the device.

I donā€™t see anything in the smart app code referencing background color. I didnā€™t modify the app just copy and pasted it over from my V1 hub.

This seems to be broken on the V2 hub. Can you confirm whether it works or needs updating? Thanks.

I had this issue with device type code an Im on V1. If the device type has tiles that change color, the app crashes on android phones.