Laundry Monitor Issue


#1

1) Give a description of the problem
Piston is not running correctly

2) What is the expected behavior?
Push a message when the dryer goes to 0 Watts

3) What is happening/not happening?
No push message sent

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

‘Dryer 0 Watts’ is how it reports on the Aeotec HEM on each power clamp.

I tested this by setting a variable in another piston to the output

0 doesn’t seem to work, as well as matching a variable to what I have it set to.

I’m guessing the strings aren’t matching although I have tried all types of expressions


#2

Got any logs?


#3
+0ms ╔Received event [Home].execute = 70.186.xxx.xxx with a delay of 96ms
+98ms ║RunTime Analysis CS > 19ms > PS > 60ms > PE > 20ms > CE
+100ms ║Runtime (38693 bytes) successfully initialized in 60ms (v0.3.000.20180224) (99ms)
+101ms ║╔Execution stage started
+110ms ║║Comparison (dynamic) Dryer 0 Watts is (dynamic) Dryer
+110ms ║║0
+110ms ║║Watts = false (1ms)
+112ms ║║Condition #4 evaluated false (4ms)
+113ms ║║Condition group #1 evaluated false (state did not change) (6ms)
+115ms ║╚Execution stage complete. (13ms)
+116ms ╚Event processed successfully (116ms)

#4

That looks odd, does it really come in in 3 different lines or is it just formatting after you copied it?

+110ms ║║Comparison (dynamic) Dryer 0 Watts is (dynamic) Dryer


#5

I figured part of it out. I was not using integers.

But it still won’t execute:

3/6/2018, 1:28:14 PM +612ms
+1ms ╔Received event [Home].execute = 70.186. with a delay of 94ms
+101ms ║RunTime Analysis CS > 16ms > PS > 50ms > PE > 35ms > CE
+104ms ║Runtime (38853 bytes) successfully initialized in 50ms (v0.3.000.20180224) (103ms)
+105ms ║╔Execution stage started
+127ms ║║Comparison (string) Dryer
+127ms ║║0
+127ms ║║Watts stays (integer) 0 = false (2ms)
+129ms ║║Cancelling any timed trigger schedules for condition 4
+129ms ║║Cancelling statement #4’s schedules…
+130ms ║║Condition #4 evaluated false (20ms)
+131ms ║║Condition group #1 evaluated false (state did not change) (22ms)
+133ms ║╚Execution stage complete. (28ms)
+134ms ╚Event processed successfully (134ms)


#6

This is the part that doesn’t look right (to me anyway) from the log you posted.

image

Edit: I created a simple test piston.

|+99ms|║╔Execution stage started|
|+116ms|║║Comparison (dynamic) Dryer 0 Watts is_equal_to (string) Dryer 0 Watts = true (2ms)|
|+118ms|║║Condition #5 evaluated true (7ms)|

#7

That certainly does match but if I use a physical device, it doesn’t work. That is what’s driving me crazy


#8

What does the output look like in the IDE for the Dryer 0 Watts?

Edit: Also, if you type this in the piston’s evaluation console, what do you get for the output.

Enter this as an Expression: [deviceName:powerTwo]

Example output: (expression) [Laundry Washer:power] »»» (decimal) 1


#9

(expression) [deviceName:powerTwo] »»» Evaluation error: Invalid device variable deviceName

I presume I was wrong with using devicename it should be Washer/Dryer right?


#10

Sorry, substitute your actual device for deviceName


#11

(expression) [Washer/Dryer:powerTwo] »»» (string) Dryer 0 Watts


#12

Changed your variable to a string and tested using powerTwo still doesn’t match.

3/6/2018, 2:09:13 PM +293ms
+1ms ╔Received event [Home].time = 1520370553706 with a delay of -413ms
+144ms ║RunTime Analysis CS > 15ms > PS > 85ms > PE > 43ms > CE
+146ms ║Runtime (38728 bytes) successfully initialized in 85ms (v0.3.000.20180224) (144ms)
+147ms ║╔Execution stage started
+177ms ║║Comparison (string) Dryer
+177ms ║║0
+178ms ║║Watts is (string) Dryer 0 Watts = false (1ms)
+179ms ║║Condition #5 evaluated false (19ms)
+181ms ║║Condition group #2 evaluated false (state did not change) (21ms)
+184ms ║╚Execution stage complete. (37ms)
+186ms ║Setting up scheduled job for Tue, Mar 6 2018 @ 2:10:13 PM MST (in 60.228s)
+199ms ╚Event processed successfully (199ms)


#13

What about this one…

(dryer == [Washer/Dryer:powerTwo] ? 'yes' : 'no' )


#14

(expression) (dryer == [Washer/Dryer:powerTwo] ? ‘yes’ : ‘no’ ) »»» Evaluation error: Variable dryer not found


#15

Is your variable dryer still defined in the piston?


#16

dryerStatus is what you had…

(expression) (dryerStatus == [Washer/Dryer:powerTwo] ? ‘yes’ : ‘no’ ) »»» (string) no


#17

Yep, you probably saw my reply before I was able to correct the variable name.


#18

Should I just use variables for this?

I already have it set up for dryerwatts as a global and that’s its own piston that just updates it.


#19

Please post green snapshot of your latest piston version just so I know what we’re working with.


#20

Actual piston this time.
Still doesn’t go true: