Help with piston - SHM


#1

1) Give a description of the problem
I want the smart home monitor to change from armed away to armed stay, when my robot vacuum starts cleaning. When it is done and returns to the charger I want it to change to armed away again.

2) What is the expected behavior?

*3) What is happening/not happening?
I can make it change to armed stay but not back to armed away.
I tried a simple solution and later tried with a repeater and a wait function. No luck.
(I am new at making pistons)

**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 SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

I’d be interested to see logs for when the robot changes to charging mode.


#3

Thanks for the reply! Actually, today I tested the simple version again, and now it works! I guess it must have been some connection issue yesterday.
Thanks anyway!


#4

I take it your vacuum doesent randomly run when you are home? SHM will arm randomly otherwise.


#5

You are right, I split the piston up into two parts to get rid of that problem. I guess you could make a loop, but I don’t know what the maximum runtime of a loop is?

!


#6

Max execution time of any ST event is 20 seconds, but if you have include waits in a loop that are longer than 3 seconds, webCoRE stops and scedules a wake up, so a loop could theoretically be indefinite.

Of course in the ST world events fail here and there so the loop would eventually stop unless re-triggered.


#7

Interesting, then if I add a “while” loop and a wait command of 4 seconds, I could make it work. I will try that. How does webcore know when to “wake up”? If I make a loop with an if command saying, when the vacuum status changes, would it then automatically keep checking and wake up?


#8

That wouldn’t be a loop… an IF statement just subscribes to events to a specified device attribute. ST pings the piston when the event occurs.

A loop would be:

IF
something happens
THEN
Repeat
do something
wait 4 seconds
UNTIL
something else happens