Problem with power logging for smartplug


#1

1) Give a description of the problem
I’m working on an end of cycle notification for my washing machine, using power consumption as a trigger. Trying to log my power use during a few cycles to establish a baseline. I created a basic piston to log to a fuel stream, but it errors out. I added a 2nd command to write to console with the info, which also errors out.

The device I’m trying to log is a Peanut Smart Plug, which has been updated to the current firmware for power monitoring, which works inside the ST app.

2) What is the expected behaviour?
Fuel Stream and log entries showing power use.

3) What is happening/not happening?
Errors out in both fuel stream and log.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
9/10/2019, 1:53:32 PM +122ms
+1ms ╔Received event [Washing Machine Plug].power = 165.0877393647 with a delay of 44ms
+54ms ║RunTime Analysis CS > 13ms > PS > 30ms > PE > 11ms > CE
+56ms ║Runtime (36712 bytes) successfully initialized in 30ms (v0.3.10f.20190822) (55ms)
+57ms ║╔Execution stage started
+62ms ║║Cancelling statement #3’s schedules…
+67ms ║║null
+69ms ║║Error executing virtual command [].log: (1ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.165.0877393647() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+83ms ║║Executed virtual command writeToFuelStream (7ms)
+85ms ║╚Execution stage complete. (28ms)
+87ms ╚Event processed successfully (86ms)
9/10/2019, 1:53:24 PM +137ms
+2ms ╔Received event [Washing Machine Plug].power = 8.0848655929 with a delay of 72ms
+78ms ║RunTime Analysis CS > 18ms > PS > 42ms > PE > 18ms > CE
+80ms ║Runtime (36710 bytes) successfully initialized in 42ms (v0.3.10f.20190822) (77ms)
+81ms ║╔Execution stage started
+87ms ║║Cancelling statement #3’s schedules…
+92ms ║║null
+94ms ║║Error executing virtual command [].log: (2ms) groovy.lang.MissingMethodException: No signature of method: physicalgraph.sandbox.TruncatingLoggingListener.8.0848655929() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl, null) values: [║║ null, null]
+115ms ║║Executed virtual command writeToFuelStream (14ms)
+117ms ║╚Execution stage complete. (36ms)
+119ms ╚Event processed successfully (118ms)
9/10/2019, 1:53:19 PM +136ms
+1ms ╔Starting piston… (v0.3.10f.20190822)
+93ms ║╔Subscribing to devices…
+99ms ║║Subscribing to Washing Machine Plug.power…
+154ms ║╚Finished subscribing (64ms)
+176ms ╚Piston successfully started (176ms)


#2

My peanut plug is dumb but curious what you get in the IDE live logging when it reports power.


#3

Here’s a sampling of what live logging shows:

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:48 PM: debug powerValues is 243.0675720188

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:48 PM: debug description is read attr - raw: EA91010B040A0B0529DA03, dni: EA91, endpoint: 01, cluster: 0B04, size: 10, attrId: 050b, result: success, encoding: 29, value: 03da

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:47 PM: debug Current 3.7592125778

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:47 PM: debug Desc Map: [raw:EA91010B040A0805210508, dni:EA91, endpoint:01, cluster:0B04, size:10, attrId:0508, result:success, encoding:21, value:0805, isValidForDataType:true, clusterInt:2820, attrInt:1288]

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:47 PM: debug description is read attr - raw: EA91010B040A0805210508, dni: EA91, endpoint: 01, cluster: 0B04, size: 10, attrId: 0508, result: success, encoding: 21, value: 0805

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:44 PM: debug powerValues is 176.8238345802

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:44 PM: debug description is read attr - raw: EA91010B040A0B0529A403, dni: EA91, endpoint: 01, cluster: 0B04, size: 10, attrId: 050b, result: success, encoding: 29, value: 03a4

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:42 PM: debug Current 3.5523002440

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:42 PM: debug Desc Map: [raw:EA91010B040A0805219407, dni:EA91, endpoint:01, cluster:0B04, size:10, attrId:0508, result:success, encoding:21, value:0794, isValidForDataType:true, clusterInt:2820, attrInt:1288]

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:42 PM: debug description is read attr - raw: EA91010B040A0805219407, dni: EA91, endpoint: 01, cluster: 0B04, size: 10, attrId: 0508, result: success, encoding: 21, value: 0794

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:41 PM: debug powerValues is 117.3609521550

[4b233eed-482f-4c44-ae7d-e6356b6e82ea](https://graph-na04-useast2.api.smartthings.com/ide/logs#4b233eed-482f-4c44-ae7d-e6356b6e82ea) 2:06:41 PM: debug description is read attr - raw: EA91010B040A0B0529A602, dni: EA91, endpoint: 01, cluster: 0B04, size: 10, attrId: 050b, result: success, encoding: 29, value: 02a6

#4

Is powerValues available as an attribute in webCoRE when you’re creating conditions for the device?


#5

No it isn’t… Here are my options… I think they’re all the standard options…


#6

I’m leaning towards a possible issue with the device handler. I will have to check what I use on mine when I get to a PC.


#7

I was thinking along those same lines. I checked and there is an update to the Device Handler, so I installed it. Nothing changed in Webcore, and the live logs still report the same way.


#8

On a related topic, what did you use to update the peanut plug to enable power monitoring? Maybe it’s worth updating the two I have.


#9

I grabbed a used Almond+ router off Amazon for $50ish. I was planning on updating it and returning the router, but I have about 8 Peanut plugs now, so I think it might be was worth a few bucks to be able to continuously update them and have full functionality.

On a side note, when I re-paired them to ST, they were recognized using the names I had originally given (and rooms they were assigned to) on ST. My one automation I had set up (a simple timer to turn on my phone charger every night… I use Tasker to turn it off when it reaches 85% to extend battery longevity) didn’t require any interaction to work again. That was a pleasant surprise.


#10

Bumping. @eibyer, any chance you were able to look through your device handler?


#11

I forgot about this. I just looked and my device is using a stock ST driver (Securifi Walnut). If there’s a thread on ST discussing this, maybe it would worth checking if they’re able to use to log power provided by the new device handler.


#12

No worries. Thanks for checking. I posted in the DTH thread on ST and I’ll report any findings back.

For the moment, I have an automation working using the new ST app, but I figure this is a good entry point into using WebCoRE, so I’d still like to figure it out for the learning experience.


#13

Apparently I had something sketchy/stupid in my piston setup. I tried again today and it’s working perfectly. I changed the trigger to a simple comparison and fixed my fuel stream’s operators so they’d actually record. Everything is working well now.