Page 1 of 1

Creating an Event - Variable Outcome

Posted: Thursday 10 November 2016 21:36
by Jzjr
Hi,

I have a door contact and a virtual switch within Domoticz. I am trying to create an event which starts a scene if the door opens while the virtual switch is off and does nothing if the door opens but the virtual switch is on.

So far I have tried using Blockly but haven't had any success so far.

I have tried:
Screen Shot 2016-11-10 at 20.31.41.png
Screen Shot 2016-11-10 at 20.31.41.png (23.72 KiB) Viewed 1296 times
I have also tried adding 'or else' if Door=Open + Goodbye(Virtual)=On
and left the 'Do' block empty.

At the moment I am looking for an implementation in Blockly - I have never used Lua before and would like a quick solution before I embark on the adventure of learning and writing a script in Lua.

If anyone has any suggestions it would be greatly appreciated.

Many thanks,
Fred.

Re: Creating an Event - Variable Outcome

Posted: Friday 11 November 2016 0:08
by Egregius
Use a simple if block instead of a if/else block

Re: Creating an Event - Variable Outcome

Posted: Friday 11 November 2016 7:08
by Derik
it's looks that some things are not implement in blockley
The thermostat is not working also...
perhaps you can write?

Re: Creating an Event - Variable Outcome

Posted: Friday 11 November 2016 7:32
by Jzjr
Thanks for your replies;

I have tried a single if block as in the above image, can it be made simpler?


Sent from my iPhone using Tapatalk

Re: RE: Re: Creating an Event - Variable Outcome

Posted: Friday 11 November 2016 8:07
by StanHD
Jzjr wrote:Thanks for your replies;

I have tried a single if block as in the above image, can it be made simpler?


Sent from my iPhone using Tapatalk
Yes, as @Egregius suggests, use the "If" block without the blue symbol.

Re: Creating an Event - Variable Outcome

Posted: Friday 11 November 2016 8:51
by Jzjr
Thanks for your replies, using the 'If' block without the symbol worked. I wasn't aware there was any difference unless using an 'else' statement.

Cheers all,
Fred.