Help with my piston


#1

1) Give a description of the problem
My piston doesn’t launch when it should

2) What is the expected behavior?
The piston should be launch when my doors open

3) What is happening/not happening?
In the log, nothing happen

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)

Nothing happen at 16h45, when my wife arrived, it work when I arrive at 17h15
08/01/2018 à 17:16:49 +257ms
+5ms ╔Received event [Pier-Luc’s iPhone].presence = present with a delay of 117ms
+148ms ║RunTime Analysis CS > 25ms > PS > 58ms > PE > 66ms > CE
+150ms ║Runtime (41907 bytes) successfully initialized in 58ms (v0.2.101.20171227) (145ms)
+151ms ║╔Execution stage started
+162ms ║║Comparison (enum) present changes_to (string) present = true (0ms)
+163ms ║║Cancelling condition #2’s schedules…
+164ms ║║Condition #2 evaluated true (8ms)
+164ms ║║Cancelling condition #1’s schedules…
+165ms ║║Condition group #1 evaluated true (state changed) (10ms)
+174ms ║║Comparison (time) 62209424 is_between (time) 57600000 … (time) 66600000 = true (5ms)
+174ms ║║Time restriction check passed
+176ms ║║Cancelling condition #4’s schedules…
+176ms ║║Condition #4 evaluated true (9ms)
+185ms ║║Comparison (string) ACTIVE is_not (string) On = true (1ms)
+186ms ║║Condition #8 evaluated true (9ms)
+187ms ║║Cancelling condition #3’s schedules…
+187ms ║║Condition group #3 evaluated true (state changed) (21ms)
+189ms ║║Cancelling statement #6’s schedules…
+196ms ║║Skipped execution of physical command [Kitchen light].on([]) because it would make no change to the device. (4ms)
+197ms ║║Executed [Kitchen light].on (4ms)
+202ms ║║Skipped execution of physical command [Main Living Light].on([]) because it would make no change to the device. (3ms)
+203ms ║║Executed [Main Living Light].on (4ms)
+208ms ║║Skipped execution of physical command [Second living Light].on([]) because it would make no change to the device. (3ms)
+209ms ║║Executed [Second living Light].on (3ms)
+214ms ║║Skipped execution of physical command [Table light].on([]) because it would make no change to the device. (2ms)
+214ms ║║Executed [Table light].on (4ms)
+220ms ║║Skipped execution of physical command [Wall light].on([]) because it would make no change to the device. (4ms)
+221ms ║║Executed [Wall light].on (5ms)
+223ms ║╚Execution stage complete. (72ms)
+224ms ╚Event processed successfully (224ms)
08/01/2018 à 07:08:24 +739ms
+2ms ╔Received event [Pier-Luc’s iPhone].presence = not present with a delay of 120ms
+166ms ║RunTime Analysis CS > 22ms > PS > 64ms > PE > 80ms > CE
+168ms ║Runtime (41902 bytes) successfully initialized in 64ms (v0.2.101.20171227) (166ms)
+169ms ║╔Execution stage started
+180ms ║║Comparison (enum) not present changes_to (string) present = false (0ms)
+182ms ║║Cancelling condition #2’s schedules…
+182ms ║║Condition #2 evaluated false (8ms)
+338ms ║║Comparison (string) ONLINE is (string) Open = false (1ms)
+340ms ║║Comparison (string) ONLINE is (string) Open = false (1ms)
+342ms ║║Condition #5 evaluated false (158ms)
+342ms ║║Cancelling condition #1’s schedules…
+343ms ║║Condition group #1 evaluated false (state changed) (170ms)
+345ms ║╚Execution stage complete. (176ms)
+346ms ╚Event processed successfully (346ms)


Did Restore a piston using a backup code change today?
#2

I think you need to move the nested IF after then to an ELSE IF under the original IF. Same with the other nested IF. Move them out to the first IF.


#3

For what you’re trying to do you should not be using $status anywhere in this piston.

image

$status will hold values like “ACTIVE” or “OFFLINE”. It does not contain values like “Open” or “On”, so any tests against it are going to produce unintended results.

You need to redo this piston to use conditions that are more appropriate for the device you’re testing against. Things like “is open”, or “switch is on”, and so on.


#4

Also move the IF statement into their own IF’s.


#5

Thanks for the reply, I created a duplicate piston,

  1. 1 piston that get trigger when the celluphone presence change to present
  2. 1 pinton that get trigger when the door sensor contact change to open

will try it tomorrow

Is there a documentation about the type of accessories and the type of trigger/condition for them?
example : a door sensor must be use with contact when the door open/close and with status to validate if the sensor is online on smartthings

thanks


#6

This is a good one to start.

And then read through the examples section to see what others are doing. That’s how I got started.


#7

Just read the thread, great help

But is there a place to understand each possibilities for devices

example, a door sensor must be use with contact when the door open/close and with status to validate if the sensor is online on smartthings


#8

I don’t know if such docs exist for that. One thing you can do though is to play around with the On Events command which will tell you the various items that you can act upon for a given device.

For example, here’s the Events that can be grabbed from a basic contact sensor:

But here’s the same list from a Motion sensor that I have in my garage, as you can see it also has temperature and humidity settings on it as well.

So I don’t know if you’ll find a list exactly because each device can be so varied. But a good way to figure out what you can do is to just play around with a few devices and see hat’s available. And if you want to get really fancy you can even add in some “simulated” devices to mess around with.