Ignore switch A when status switch B is off ?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
Bram81
Posts: 22
Joined: Saturday 02 May 2015 11:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Utrecht, NL
Contact:

Ignore switch A when status switch B is off ?

Post 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?
mxpwr
Posts: 5
Joined: Sunday 19 July 2015 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Bram81
Posts: 22
Joined: Saturday 02 May 2015 11:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Utrecht, NL
Contact:

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

Post 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.. ;-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest