Aeon Labs Smart Energy Switch DSC06

Hi guys,

I’m just getting started with SmarThings programming.

I copy-pasted the latest github code into a new app I created on the IDE. After I click “Save” I get the following error:

“groovy.lang.MissingMethodException: No signature of method: script1437481580769299245021.metadata() is applicable for argument types: (script1437481580769299245021$_run_closure1) values: [script1437481580769299245021$_run_closure1@4b1d9c8f]
Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)”

The code is copy-pasted directly from github so I’m not sure what it’s complaining about.

Not sure what is going on. I just went to GitHub, cut-and-pasted the code into the ide and it worked for me. Did you copy the “raw” view of the code? (Click the “raw” button, select all, then paste into the ide).

James

Apologies. I’m very new to SmartThings development, although I am a programmer so I should have known better.

I didn’t realize the code has to be pasted into “My Device Types” (a new device had to be created). I thought the code would execute under “My Apps”.

We learn something new every day. Now it works perfectly. Thank you so much for saving me all the time it would take to write the code myself

Hi, @jpansarasa. I like the looks of this device type, and I’m trying it out with the Better Laundry Monitor app.

The device type appears to be mostly working, but I can’t access the configure panel from the mobile app. When I tap it, the iOS network activity in the status bar spins, then nothing happens. I think I was able to set them from the IDE, but I am not sure if maybe they’ve not taken effect or if there is just nothing new to be logged. I’m currently running a cycle on the washer, but it’s the first time I’ve done so with an energy monitor, so I don’t know what to expect.

There hasn’t been any activity in this thread for a few months, is it possible this is due to the recent SmartThings app update?

Also, I think by the time I had added the custom device type and switched my device to it, the device had already gone to inactive. From the Laundry Monitor thread, it seems like that can cause issues with it updating. Could that cause the problem with the configure panel?

To reactivate, it sounds like I just have to power the device off then back on again? I’ll give that a try when this load finishes. Will the custom device type then take care of keeping it active going forward?

I have the Aeon Labs DSC06106-ZWUS Z-Wave Smart Energy Switch. I assume that’s covered by this device type?

Thanks!

UPDATE:

I’ve answered most of my own questions, but not all. I did find that I could access the settings in the mobile app by going to “Edit Device”, so that helps. The Configure button still appears to do nothing. Is it supposed to bring up the same settings panel? Or is it doing something else that I don’t know about?

I did get the washer’s power monitor back to active by toggling the power button once the washer had finished the load. Now I’m on my second load. Hopefully I’ll get better results out of the Better Laundry Monitor app this time! I think the device being inactive on the last run probably made it not alert.

Edit: One other question. What does the “Respond to switch all?” setting mean? I can see the options, but I’m not really sure what “switch all” does in the first place. Is this something to do with the power strip version of the Aeon devices, rather than my single outlet model?

I was just replying to your previous post, glad to see things are working.

If you are talking about the “Configure” button , that updates the configuration of the device (it is a little useless since that gets called when you edit the preferences). I guess I should remove it. :smile:

I think people have used the “Better Laundry Monitor” app with this device type. I use the app I wrote “Yet Another Power Monitor” with my device type. It is essentially the same thing but I don’t have the extra bells and whistles @sudarkoff put in his app.

So there is a concept of “All switches on” where a group of different devices all perform in unison (like synchronized swimmers). This controls the behavior when this device is added to one of those groups. I don’t think SmartThings supports this feature yet but they might when you group devices in Rooms.

Yep, that’s the button I meant! The name is a little confusing, since my mind linked it to accessing the settings, rather than simply pushing them to the device. After figuring out where the settings were, though, I was starting to figure I must be missing something about that button.

I’ve started with Better Laundry Monitor, since it seemed most appropriate. I didn’t get a notification when the washer finished the last load, but I think that because the Aeon device was inactive during that load, that the smartapp wasn’t getting the updates necessary to alert. Hopefully I’ll have more success this time around. I also hooked up another Aeon device to the dryer.

Hmm. I still seem to be having trouble with the washer. My husband told me the washer is done, but I didn’t get a notification. Checking the logs under the device in the mobile app, it doesn’t appear to be getting updates automatically. It still showed power being used when the machine was off (and it’s not a fancy machine that uses any power when off). Tapping refresh on the device did update the power to 0. That was at 6:46pm and the previous log entry was at 6:35pm. There also aren’t many events in the log, despite having the report interval set to 1 minute. Any ideas?

That sounds like it might be related to the Sets functionality that’s supposed to be coming to the app, from what I’ve read. In any case, good to know!

I had a couple questions about the logging, too. What does the “display power events” setting apply to? Both the power in W and the energy in kWh? Or just one of those? Same question for the “report interval”. At one point, it seemed like the dryer was updating the activity log with energy every minute, but not power.

Thanks for your help!

I ended up removing the energy monitor that was hooked up to the washer from SmartThings completely, then adding it back. That seems to have cleared up the problem with it not updating. This time, a lot less time elapsed between adding the device and changing the device type. I’m not sure if that made the difference or not.

I also tried a different monitor app. I think Better Laundry Monitor was throwing an exception at the point where it was supposed to be sending the notification, according to the debug logs. In any case, between those two changes, I was able to get notifications upon completion of both washer and dryer loads!

I’d still appreciate an answer to my question about the logs, just to better my understanding of what is going on with these energy monitors.

Also, I’m not sure, but there might be a bug in your device type. It seems that if I go into the device settings on the mobile app, then tap Done, it resets the report interval value. Unless I actually change that value before hitting done.

That controls if the changes in power or energy are displayed in the events for the device. There are some 3rd party tools that monitor the events display for changes. It is not necessary to display those events for apps to work in SmartThings.

So the device is configured to report changes when the power changes by 5 watts or 5%. This is why it may report at non-linear intervals.

I have no control over that behavior. That is the SmartThings app. I would file a bug report.

Will do, thanks. Any particular details I should tell them? It’s only that one field that’s a problem, all the others seem fine. Is it a different field type or data type than the rest?

The behavior you are describing is that the current value is not set in the control when you select Edit on the device. If you turn on debugging in the device type and look in the developer ide at the log, you should see the values passed to the configure() method. That will tell you if it retains a previously set value or not.

Did a little testing. Basically, it seems that if I touch the report interval field at all, even if I don’t change the value, it’s fine. But if I just go into the Edit page then tap Done without touching the report interval field at all, then it sends a null value for that variable. (Just FYI. I’ll still report to ST.)

updated(disableOnOff: false(false), reportInterval: null, displayEvents: true, switchAll: Disabled, debugOutput: true(true))

Thanks for debugging!
Good thing I guard against the reportInterval being null in the code.

Just an FYI, if you look at the code reportInterval is one of the preferences near the top of the file in the metadata section

preferences {
    input "reportInterval", "number", 
        title: "Report Interval", 
        description: "The time interval in minutes for sending device reports", 
        defaultValue: 1, 
        required: false, 
        displayDuringSetup: true

It is used only in the configure method to send the value (converted to seconds) to the device

/**
 *  configure - Configures the parameters of the device
 *
 *  Required for the "Configuration" capability
 */
def configure() {
    //Get the values from the preferences section
    def reportIntervalSecs = 60;
    if (reportInterval) {
        reportIntervalSecs = 60 * reportInterval.toInteger()
    }

James

That’s a good thing for keeping the code running smoothly!

I just need to remember to touch that field when going into the device settings if I want to retain the value I set instead of the default. But it’s definitely good that it will continue to work, even if it’s with the default interval!

I have a few of the Aeon Labs Smart Energy Switches - DSC06 and have added this as a device type sucessfully. Thanks for the hard work! I understand that this switch can also function to report Temperature as one of its values.

I have the On/Off capabilities and also the current power usage and total KWPh usage working within the Mobile App on Android and would be insterested in using the temperature sensor as well so I can monitor the temperature in the area where the switch is installed.

Any way to add this ?

What lead you to believe this device report temp ?

I don’t believe the DSC06 reports temperature. I have the engineering spec for this device and it doesn’t list temperature as a reporting option.

This device does not report temperature. The Aeon Labs Heavy Duty Smart Switch does have a temperature sensor but it is on the motherboard and not accurate for room temperature.

Mucho Thanks for the clairification! You gents are correct. I reviewed the specifications again and you are correct. No temperature monitoring. :blush:

Not sure if it matters here, but the standard device type “z wave metering switch” is now working for me (energy reporting, etc.). Which means it should be supported for local control, no more custom device type.

Edit: I see the devicetype has some nice features, so either is good, but I’m sticking with standard for now since I only need the switch and energy reporting, no fancy stuff at the moment. :slight_smile:

1 Like