Hi All,
New to (the absolutely amazing) WebCoRE and I have some question for which I can’t find an answer. I saved them up so as not to be a complete PITA. General ones first:
Can you add comments to a piston? I see a comment block is added automatically to the top of a newly created piston but I’m not sure if/how to add them later in the code for clarity.
Can I rename a Piston? I tried to use the Duplicate feature. It worked for a smaller piston but I only get a new, empty piston when I try to duplicate a longer piston.
I see a toggle in the IDE for allowing drag and drop but can’t figure out how to do it. Ideally, I’d like to drag and drop an individual line or a block of code. Is that possible?
Can you insert a new line of code into an existing block?
When I try to import a piston, I’m told there is no way to do that yet. Can you copy and paste from other pistons? I’d love to examine what others have done so I can learn how to create complex pistons.
Is there any way to trigger a piston using Alexa?
Now for more specific questions:
I have a piston that gets triggered when either of two contact sensors changes from a closed state and the Mode is Night. A ton of stuff then happens. I would like to determine which of the two contact sensors was opened and include it in the SMS message that gets sent. I thought I’d just query that status of both sensors, determine which one was open or very recently opened, and use a variable in the SMS. Unfortunately, I have no idea how to query a device and get its current or very recent status. Help, please.
My penultimate question is about latency. The aforementioned piston that reacts when one of two sensors changes from a closed state turns on 19 lights, flashes some between red and white, flashes some on and off, sets some to various levels, and pretty much blows up the house (not literally, I hope). The piston is long and it seems that it’s taking a long time for some events to occur. Thinking that synchronous blocks wait to finish before the code moves on, I changed each block to async. Will that help or am I misunderstanding how that works? Are there any best practices for maintaining performance?
Lastly, is there documentation that would answer my questions? If so, I apologize for adding static to the community and, in the future, will consult the documentation before posting a ton of questions.