Page 3 of 36
Re: Blockly examples
Posted: Tuesday 07 January 2014 12:29
by alfred_j_kwak
Arkie wrote:Hello, i made this blockly event, but it's not working between the timetable, it's working every time of the day i'll open the door!
...
greetings
Maybe you should construct your logic little bit different "Schuurdeur" can only be 'Open' or 'Close'. Not 'Open in the middle of the night'
So If [[Schuurdeur = Open] AND [[Time>1:20] AND [Time<6:00]]] then something
I cant use blocky so I'm not sure.
-Jussi-
Re: Blockly examples
Posted: Tuesday 07 January 2014 15:40
by CopyCatz
you are structuring like:
if (schuurdeur = (open and ((time > ..) and (time < ..)))
i.e. you are checking to see if schuurdeur is equal to the rest of the statements
you should be structuring like:
if ((schuurdeur = open) and ((time > ..) and (time < ..)))
Re: Blockly examples
Posted: Tuesday 07 January 2014 20:41
by Arkie
Thanxs for your replies: i made a new one like u guys say (i think) but it's still not working.

- event 2.jpg (50.51 KiB) Viewed 12208 times
greetings
Re: Blockly examples
Posted: Tuesday 07 January 2014 22:05
by willie-p
Dear Arkie,
What kind of door sensor do you have? Some door sensors work within blocky with "on" instead of "open"
Perhaps you could try this.
Cheers,
Will
Re: Blockly examples
Posted: Tuesday 07 January 2014 23:35
by Arkie
I've also tried to change it to on and off, didn't work either. KAKU sensor
After trying various changes i think i now have the awnser for my problem
The times should be on the same day!!! So it should work with the blockly from my second message standing above!
But because i didn't want to wait till 1:20 to test it, i changed the time to 20.00 (so before midnight), with this time it didn't work, but when i change the 6:00 too 23.59 it works fine
On this last test the actual time was around 23:00.
Maybe a good point for modification!
Thanxs for the replies
Re: Blockly examples
Posted: Thursday 13 February 2014 14:15
by Slorf
Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.
Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.
Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom
Alex
Re: Blockly examples
Posted: Saturday 15 February 2014 19:58
by nigels0
Blockly to switch a light on between the hours of dusk to dawn via a contact switch on a door. The dusk to dawn code seems clunky to me, but it works...
Re: Blockly examples
Posted: Saturday 15 February 2014 20:18
by bizziebis
You could also use
IF ((Front Door Switch = Open) AND ((Time >= Sunset) OR (Time <= Sunrise)))
DO .....
Re: Blockly examples
Posted: Monday 17 February 2014 21:04
by ErikCramer
Slorf wrote:Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.
Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.
Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom
Alex
Alex, what kind of pir, hygro and CO2 sensors do you have?
Re: Blockly examples
Posted: Friday 21 February 2014 14:57
by Heisenberg
ErikCramer wrote:Slorf wrote:Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.
Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.
Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom
Alex
Alex, what kind of pir, hygro and CO2 sensors do you have?
I also would like to know how you implemented it. If possible could you post some pics of the wiring with the Kaku switch too? Thnx in advanced
Re: Blockly examples
Posted: Sunday 23 February 2014 20:40
by ErikCramer
I've created the folowing schema.
Its to turn on the light when its of and its = or after sunset.
When its = or after sunset it and its on. should turn off again.
But if i check my NMA i have about 30 msgs of it turning on

do i have some thing contradictary in it or a loop ?
If i look my self i dont see any thing wrong.
Re: Blockly examples
Posted: Sunday 23 February 2014 20:57
by bizziebis
You have to make something like
IF time => sunset OR =< sunrise AND switch 1 = off...
The way you made it now will cause it to infinite loop after sunset has passed.
Re: Blockly examples
Posted: Monday 24 February 2014 13:51
by ErikCramer
I found out the OR expression doesnt work has to be and also so i created the following (its not night yet but it turns of when its day so i think it works.)
If you'd like to ad to the equasion id like to be able to manualy turn it off every once in a while, is there an option for that ?
Re: Blockly examples
Posted: Monday 24 February 2014 16:41
by Heisenberg
bizziebis wrote:I've also added a KAKU switch to my mechanical ventilation. I didn't touch the perilex plug. I opened up the unit and directly attached the wires from the KAKU to the PCB of the ventilation system.
I made some blocky events to controll it all. It can be controlled manualy by virtual switches or automatically by measuring the humidity of the bathroom.
I'va also added an option to override the current settings. In case I get tired of the fan running full speed when my girlfriend is showering after a late shift
The events can be optimised and some things can be put together. But then I have to send multiple signals to just make one switch. And that's something I'm not willing to do because the RfxCom is interfering with my digital tv (RTL5 HD and SBS6 HD). So with the current events it's reduced to sending only the needed signals.
The override event is not optimised at all. But I almost never use it so I didn't bother to change it yet
Level 1:
Level 2:
Level 3:
Override:

bizziebis, care to share some pictures of your KAKU wiring solution attached to the PCB?
Re: Blockly examples
Posted: Monday 24 February 2014 19:21
by ErikCramer
gibbiem wrote:Hi, I have a question about the first and last post on this thread.
On the first, the person posted an example of a blocky where there is an 'if,do' command within and an 'if,do' command. How do you get Domoticz to create this?
On the last post, the example include an 'else,if' command, I also cant find this on my system.
Just updates to .918
Thanks
Hi see my picture.
There is the option if do and the else if if you press the + sign
In domotics its Setup > more options > events.
Guess with my blocky i did some thing wrong as its dark and the light is still off..

perhaps it would be nice if there would be a test option in the scripts..
Re: Blockly examples
Posted: Monday 24 February 2014 21:50
by simonrg
Your light will never turn on as there is no time when time is both greater than Sunset and less then Sunrise in numbers, for example Sunrise 6am, Sunset 6pm - so for example at 7pm - 7pm is greater than 6pm but not less than 6am - so light won't be tested.
You need to change the "and" in the first block to an "or" - so at 7pm - 7pm is greater than 6pm, 7pm is not less than 6am so will test light.
I seem to remember also that "or" blocks at the start of Blockly can cause problems, in which case you would swap the clauses round.
Re: Blockly examples
Posted: Wednesday 26 February 2014 13:02
by Slorf
Hi Eric, Heisenberg
I am using a cheap cresta themperature/hydro meter, the pir's are from ebay ( 2 euro's each, connected to a piface ), the airquality is measured using a voltcraft co-20 compatible usb stick.
Left all the original wiring inplace, used a platic box with a kaku 3500 switch ( you can switch 3 devices ) in it and a perilex socket.
This box is connected to 220v and the kaku 3500 is connected to the perilex socket, in this way I left all the original wiring in place ( incase I ever move )
Will make some pictures this weekend
Alex
Re: Blockly examples
Posted: Thursday 27 February 2014 22:20
by Andyyyy
Hi all,
could anyone help me with a script ?
I have a impulse relay in my floor, so i send with a "Push on button" a on signal for 1 second. Every time i send the "on" command the lamp changes between on and off.
so far so good but,
I like to use a switch in my bedroom for following scenario:
when i press "on" the push button should send the "on" command. (that work´s !! )
but when i press the "off" button the "on" command should send after 30 minutes. How can i make this ???
Andyyyy
Re: Blockly examples
Posted: Monday 24 March 2014 21:33
by KnarfOfSpam
So i am a bit deaf...using my 433mhz doorbell the lights flash on and off (even a spot in the garden) that there is somebody at the door. Doorlight stays on for 10 minutes. Great!

- Capture.JPG (93.05 KiB) Viewed 12607 times
Re: Blockly examples
Posted: Tuesday 25 March 2014 20:36
by Keptenkurk
Funny, i never knew that setting on / setting off within one block would actually be executed.
Trying to prove that this wouldn't work i found out it actually does!
/paul