Page 1 of 1

Ignore switch A when status switch B is off ?

Posted: Friday 01 January 2016 13:52
by Bram81
Hi,

Does anyone know whether it's possible to ignore a switch command for device A when device B has a certain status?
I've automated my curtains using an electric motor which rolls up or releases the curtain rope. A modified contact switch and a small magnet in the curtain tells me if the curtain is open or closed.

Now if the curtain is closed, but the switch 'close curtains' is pushed the motor will start running and end up opening the thing because the rope will be rolled up on a tube the wrong way.
To solve this, it would be nice if the switch 'Close curtains' could be ignored if the status of the curtain already is 'Closed' and for example print a warning.

I've looked into some lua examples, but haven't found anything similair other than ignoring multiple switch commands within a given time. Is there anyone who can help me get started?

Re: Ignore switch A when status switch B is off ?

Posted: Friday 01 January 2016 20:01
by mxpwr
You could create a virtual switch for closing the curtains instead.
Use a blockly event to check the status of the curtains when you trigger the virtual switch.

Re: Ignore switch A when status switch B is off ?

Posted: Sunday 03 January 2016 14:25
by Bram81
mxpwr wrote:You could create a virtual switch for closing the curtains instead.
Use a blockly event to check the status of the curtains when you trigger the virtual switch.
Hey, thanks for your reply. I actually tried the combination between a virtual switch and a blocky but it turned out that there was still a couple of seconds between switching and the time the blocky would kick in. Now what I did is letting a virtual switch trigger a lua which contains the actual closing command for the curtains if the status is Open and a command switching the dummy off immediately when the status is Closed. Problem solved! Thanx! I guess I was thinking of the solution in the wrong direction.. ;-)