Need help with this piston (my first)


#21

Untested:

I also improved your loop using formatDuration to display hours and minutes correctly.


#22

Thanks, I tested it out, all functions work! I really appreciate your help. Think Iā€™m finally done futzing with it. I gotta say, the programming interface is pretty slick - makes it impossible to write something that wonā€™t run. Just curious, what is the engine behind all of this?

Regarding the special treatment of the 10pm-6am time window, it occurred to me that if you open the door just before 10pm, and if finished opening after 10pm, you might not get the blinking lights. Is this true or is this run in a way that guarantees all clauses will be evaluated - ie, at 10pm if the piston is already running, it schedules it to run again so the @10pm part always gets run? Just in case I modified that line to run at 10:05pm but Iā€™m wondering if that is necessary.

Thanks again!


#23

Itā€™s all customā€¦ @ady624 created a brand new coding language lol.

But I suppose ultimately the ā€˜engineā€™ is still Smartthings, pistons are essentially translated into mini groovy apps and run on the ST cloud.


#24

You could duplicate the last block to run again at 22:05, highly unlikely youā€™ll be opening the door at both those times.

If you click the button at the top of the editor that looks like two arrows (pointing up and down) youā€™ll see a bunch of grips appear in the left margin.

These grips are used for drag-n-drop rearranging of your pistons, but if you hold Ctrl during the drag, it duplicates the block instead of moving it (copy instead of cut).


#25

Are you serious? Thatā€™s insane - that is a huge amount of work, and itā€™s a really impressive system!


#26

Cool, I found the drag-n-drop but didnā€™t know about the copy feature. Good to know!


#27

Even more so that he started with coRE and then developed webCoRE.


#28

I am, seriously, really impressed.


#29

This piston has two purposes:

  1. When Iā€™m home, remind me that I left the garage door open so Iā€™ll close it.
  2. When Iā€™m away, let me know when the garage door is open or closed.

As it stands now, Iā€™m getting way too many notifications of the garage door opening or closing WHEN I"M HOME. I donā€™t really need these - just the hourly reminders when itā€™s left open. How can I modify it so I only get text notifications of it opening or closing if my presence is ā€œAwayā€?


#30

Just add a restriction or extra condition to the open / close triggers.

IF Door is open
AND
SHM is armed
THEN
send notification


#31

Whatā€™s SHM? Really I just want it to be based on presence.


#32

Smart Home Monitor.

But you could replace that with a presence condition.


#33

OK yet another question about this piston ā€¦ I am installing HomeSeer switches and setting the status LEDā€™s. As I add new switches itā€™s kind of a pain to have to go in and update the switches this, and other, pistons operate on. Is it possible to make a group that consists of all the switches I have, and then have my pistons operate on the group? That way when I add a switch I would just need to add them to the group, rather than editing all the pistons.


#34

Yes, when editing a piston you can create a global variable via the right margin.

Make its type ā€˜deviceā€™ and add your group of devices there.

Then, instead of listing the devices in the piston, just reference the variable.

Global variables are viewable by all pistons and can be edited from any piston.


#35

Actually what about this ā€¦ could I make a piston that is triggered by some event, and make three global variables to control the three inputs to the switches - led #, color, and status (on/off/blink). then in this piston i could set the switches and just add them there. the other pistons where i want to set the ledā€™s, iā€™d set the three variables and then trigger the event. does this make sense?


#36

none at all lolā€¦

But are you aware that one piston can trigger another? And one piston can pass parameters ($args) to another.


#37

Yeah thatā€™s basically what I mean ā€¦ can you point me to an example of how to do this?