Page 1 of 1

Complex light setting

Posted: Sunday 22 January 2017 12:53
by avdl72
Can someone please help me with the following?

My outdoor light turns on at 30% when Sunset is triggered and turns off when sunrise is triggered.
Now I want the outdoor light turned to 100% for 1 minute when the doorbel is pressed and after 1 minute turn back to 30%.

I have already tried a lot but te last step (back to 30%) is not working yet and I have no idea how to do this.

Re: Complex light setting

Posted: Sunday 22 January 2017 13:38
by tozzke
I'm assuming the 'Doorbell' is the kind which turns on (according to Domoticz) for a short period of time when pressed and turns off when released

Then this should pretty much do the trick:

If [Time >= Sunset] or [Time <= Sunrise] and [Doorbell = Off] and [Outdoor light = Off]
Do [Set [Outdoor light = Level 30%]]
Else if [Time >= Sunset] or [Time <= Sunrise] and [Doorbell = On]
Do [Set [Outdoor light = level 100%]
Do [Set [Outdoor light = level 30% After 60 seconds]
Else if [Time >= Sunrise] and [Time <= Sunset] and [Outdoor light ≠ Off]
Do [Set [Outdoor light] = Off]]

You might want to add a variable to prevent retriggering of certain lines

Re: RE: Complex light setting

Posted: Sunday 22 January 2017 13:56
by jjnj
avdl72 wrote:Can someone please help me with the following?

My outdoor light turns on at 30% when Sunset is triggered and turns off when sunrise is triggered.
Now I want the outdoor light turned to 100% for 1 minute when the doorbel is pressed and after 1 minute turn back to 30%.

I have already tried a lot but te last step (back to 30%) is not working yet and I have no idea how to do this.
Check the donoticz settings, there is a setting on how the doorbell should react.

Re: Complex light setting

Posted: Saturday 28 January 2017 17:56
by avdl72
tozzke wrote:I'm assuming the 'Doorbell' is the kind which turns on (according to Domoticz) for a short period of time when pressed and turns off when released

Then this should pretty much do the trick:
Thank you.
The following did the job:
Image

What did you mean with variables?

Re: Complex light setting

Posted: Monday 30 January 2017 15:15
by tozzke
avdl72 wrote:
tozzke wrote:I'm assuming the 'Doorbell' is the kind which turns on (according to Domoticz) for a short period of time when pressed and turns off when released

Then this should pretty much do the trick:
Thank you.
The following did the job:
Image

What did you mean with variables?
check your log when it's between sunset and sunrise. You'll probably see a few lines stating this blockly is triggered because I think the 'Deurbelknop' will be 'On' for a few seconds. This means that your second line of this blockly will trigger multiple times (as long as that 'Deurbelknop' is 'On') because the result of this statement is true.
If you add a variable e.g. 'Deurbelknop_buitenlamp' and add that to the blockly, it won't trigger multiple times.
The seconds line will be something like this:

Code: Select all

Else if [Time >= [Sunset]] or [Time <= [Sunrise]] and [[Deurbelknop] = [On]] and [[Var Deurbelknop_buitenlamp] = [0]]
Do [Set [Buitenlamp] = [Level (%) 100]]
Do [Set Var [Deurbelknop_buitenlamp] = [1]]
Do [Set Var [Deurbelknop_buitenlamp] = [0] After [5*] seconds]
* Depends on how long the 'Deurbelknop' stays 'On' when pressed

[edit]
You can forget what I typed. Blockly won't let you check a variable in the 'if' statement and change that same variable in the output so this won't work
[/edit]

Re: Complex light setting

Posted: Wednesday 01 February 2017 13:48
by avdl72
Okay, thx anyway.