Motion Sensor Time Between SMS Alert


#1

1) Give a description of the problem
I am creating my 1st piston and want it to fire a SMS Message Alert between Midnight and 5AM if motion is detected

2) What is the expected behavior?
No errors on my code

3) What is happening/not happening?
Getting below error

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

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM)

4/9/2019, 12:09:41 PM +810ms
+1ms	╔Starting piston... (v0.3.10a.20190223)
+173ms	║╔Subscribing to devices...
+231ms	║║Subscribing to Motion Sensor.motion...
+319ms	║╚Finished subscribing (163ms)
+372ms	║Error calling comparison comp_is_between: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '1554836942000' with class 'java.lang.String' to class 'long'
+398ms	╚Piston successfully started (397ms)

#2

Redo it…

  • Use preset for time instead of ($time)
  • put the trigger first - motion changes
  • and remove that extra group within a group

If

motion sensor motion changes to active
And
Time is between 10pm and 5 am

Then
Do
Blah blah

I created one for you… use import code 49gjr then plug in your devices when prompted and add your phone number and alert message


#3

Thank you JKP - at this point I am working strictly via webCoRE workflow screens and I am struggling to gain an understanding of what the expression window is and how to use it. For example I tried many times to remove the $ before time and it wouldn’t let me. Not to mention when I start to write is between it automatically changes it to itbetween( shows you how little I know about development.


#4

I imported the piston you created and it makes total sense to me - hopefully I can go back and create this from the menu screen on my own and I think that will be a quantum leap in my understanding - I had not idea what a virtual device was until this week. Thank you again for getting this NewB pumped about what can be done within webCoRE