Webcore Newbie Light Control Issue


#1

1) Give a description of the problem
I am having issues with the wait command. It doesn’t seem to trigger as planned.

2) What is the expected behavior?
After sunset, when the front door is opened, the front door light activates. Then when door is shut, it waits 30 secs then turns off.

3) What is happening/not happening?
Light activating as planned, but not switching off.
4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

Sorry complete Webcore newbie and computer luddite so probably making some glaring mistake. I have read up on some similar issues on forum but to be honest seem well out my depth! Any clues as to where I am going wrong, and any suggestions for some basic webcore reading to get up to speed would be much appreciated.

I have managed to programme up basic pistons for auto lighting around the house which are working, but this wait command has me stumped. Many thanks


#2

The issue is when the door closes, webCoRE defaults to cancelling the Wait timer. Click on the with on line 40, click the cog icon and for the Task Cancellation Policy, set it to Never Cancel.

Also, the code can be simplified but that can be taken up later. Need to get the piston working first.


#3

I think line 37-46 in the picture above will never run.
(If contact changes to closed cannot happen if contact changed to open)

I would make those two IF statements separate.

This method will reset the 30 seconds if you re-open the door.
(once the door remains closed for 30 seconds in a row, it turns off the light)