Page 1 of 1
Blocky triggers with condition
Posted: Thursday 04 February 2016 14:28
by Slinkos
Hi, I have the following issue. In the blocky shown in the attachment I have 2 conditions. Kodi = ON and Donker = ON. So now when either of those 2 switches are changing to "ON" the event is triggered. But that's actually not what I want. What I want is that the event only is triggered when the Kodi switch changes to "ON", but only under the condition that the switch Donker is also "ON".
Is this possible with blocky events, or am I going to need a script for this?
Re: Blocky triggers with condition
Posted: Thursday 04 February 2016 15:38
by radem205
You have to delete the first "and" condition, so you only have the condition "kodi = On and Donker = On".
Re: Blocky triggers with condition
Posted: Thursday 04 February 2016 17:06
by Slinkos
No that has nothing to do with it. That first "and" statement wasn't even there, I just added it add an extra switch as a workarround for my problem. I just left it out the screenshot. The problem is that the event will always be triggered when one of the switches changes, but I only want it to be triggered when Kodi changes his value. The donker switch has to be a condition.
Re: Blocky triggers with condition
Posted: Thursday 04 February 2016 17:11
by Slinkos
This is the complete screenshot. I added the iPhone 6 switch (which means that I am at home) as a workarround.
Re: Blocky triggers with condition
Posted: Thursday 04 February 2016 18:59
by tozzke
I think this does what you want:
Add variables called something like 'kodi_daylight' and 'kodi_dark' (this last one is nog even necessary) which you set something like this:
Code: Select all
If [Kodi = Off] and [[var kodi_dark = 1] or [var kodi_daylight = 1]]
Do [Set var kodi_daylight = 0]
[Set var kodi_dark = 0]
Else if [Kodi = On] and [Donker = Off] and [var kodi_daylight = 0]
Do [Set var kodi_daylight = 1]
Else if [Kodi = On] and [Donker = On] and [var kodi_dark = 0]
Do [Set var kodi_dark = 1]
Else if [Kodi = On] and [Donker = On] and [var kodi_dark = 1] and [var kodi_daylight = 0] and [Woonkamer normale verlichting = Off]
Do [Set Woonkamer normale verlichting = On]
or shorter:
Code: Select all
If [Kodi = Off] and [var kodi_daylight = 1]
Do [Set var kodi_daylight = 0]
Else if [Kodi = On] and [Donker = Off] and [var kodi_daylight = 0]
Do [Set var kodi_daylight = 1]
Else if [Kodi = On] and [Donker = On] and [var kodi_daylight = 0] and [Woonkamer normale verlichting = Off]
Do [Set Woonkamer normale verlichting = On]