Introducing "Yet Another Power Monitor"


(James Pansarasa) #1

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:


Aeon Labs Smart Energy Switch DSC06
Laundry Monitor
#2

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


(James Pansarasa) #3

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).


(Brandon) #4

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.


(James Pansarasa) #5

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.


(James Pansarasa) #6

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.


(Brandon) #7

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.


(Michael Barry) #8

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.


(Paul Lehner) #9

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.


(James Pansarasa) #10

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


(Paul Lehner) #11

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.


(Paul Lehner) #12

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.


(James Pansarasa) #13

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?


(Paul Lehner) #14

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…


(James Pansarasa) #15

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


(Bernie H) #16

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


(Jjhamb) #17

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


(Bernie H) #18

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.


(Bernie H) #19

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


(Jjhamb) #20

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.