Blockly examples

Must be cleaned all topics go to the right subforum
User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Blockly examples

Postby CopyCatz » Sunday 14 July 2013 13:35

Post your blockly examples here. Make a screenshot, upload to imgur or something and show it in your post for others to watch and learn.

User avatar
Jochen
Posts: 20
Joined: Saturday 13 July 2013 10:37
Target OS: -
Domoticz version:
Location: Germany / NRW
Contact:

Re: SCRIPS - EVENT MANAGEMENT SAMPLE

Postby Jochen » Sunday 14 July 2013 20:13

Turn on a Light when open a door
This example will turn on a light when
1. A door is opening
2. It is between 22:00 and 07:00
A notification will be send everytime the is opening (00:00 - 24:00)

dooropenlighton.PNG
dooropenlighton.PNG (13.43 KiB) Viewed 37722 times

PS: The device Garagentor is the door (Garagentor = Garagedoor), the light is light is Licht Garage (Light Garage)
I have not failed 1,000 times.
I have successfully discovered 1000 ways to NOT make a light bulb.
*Thomas Edison*

macaidwin
Posts: 56
Joined: Saturday 13 July 2013 9:36
Target OS: -
Domoticz version:
Location: Harderwijk
Contact:

home ventilation system

Postby macaidwin » Monday 15 July 2013 13:56

I made these 4 events for a home ventilation system. I used a kaku ACM-3500-3 switch to power a itho eco fan with perilex connector.
Image

Edit: This example has been evolved to a more complex situation, for various reasons. See: viewtopic.php?f=15&t=31&start=20#p1118
Last edited by macaidwin on Thursday 08 August 2013 16:07, edited 1 time in total.

User avatar
capman
Posts: 103
Joined: Friday 12 July 2013 20:48
Target OS: NAS (Synology & others)
Domoticz version: v.3.6277
Location: Belgium
Contact:

Re: Events: Blockly examples

Postby capman » Monday 15 July 2013 17:41

I made this event to switch my blinds with KAKU ASUN-650. They go down when the outside temperature is higher then the inside temperature of the livingroom , and this between 10 am and 6 pm.
Attachments
Blinds01.jpg
Blinds01.jpg (78.17 KiB) Viewed 37742 times

pierre4fun
Posts: 8
Joined: Friday 12 July 2013 13:39
Target OS: -
Domoticz version:
Location: Toulon France
Contact:

Re: Events: Blockly examples

Postby pierre4fun » Monday 15 July 2013 21:46

A test:
Attachments
Capture1.PNG
Capture1.PNG (19.53 KiB) Viewed 37702 times

jackisidore
Posts: 133
Joined: Friday 12 July 2013 15:52
Target OS: Raspberry Pi
Domoticz version:
Location: NL
Contact:

Re: Events: Blockly examples

Postby jackisidore » Monday 15 July 2013 21:51

macaidwin wrote:I made these 4 events for a home ventilation system. I used a kaku ACM-3500-3 switch to power a itho eco fan with perilex connector.


Thats interesting. What if all three perilex control lines are powered. Would/could it damage the fan?

bistoury
Posts: 158
Joined: Friday 12 July 2013 14:14
Target OS: -
Domoticz version:
Contact:

Re: Events: Blockly examples

Postby bistoury » Monday 15 July 2013 22:40

My first heating scenario.
I am afraid I will need to dig into LUA...

blocky_heating_19.jpg
blocky_heating_19.jpg (74.12 KiB) Viewed 37683 times

willie-p
Posts: 79
Joined: Friday 12 July 2013 14:19
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Events: Blockly examples

Postby willie-p » Monday 15 July 2013 23:24

This is my try:
Attachments
alarm.png
alarm.png (15.49 KiB) Viewed 37676 times

macaidwin
Posts: 56
Joined: Saturday 13 July 2013 9:36
Target OS: -
Domoticz version:
Location: Harderwijk
Contact:

Re: Events: Blockly examples

Postby macaidwin » Monday 15 July 2013 23:39

jackisidore wrote:
macaidwin wrote:I made these 4 events for a home ventilation system. I used a kaku ACM-3500-3 switch to power a itho eco fan with perilex connector.


Thats interesting. What if all three perilex control lines are powered. Would/could it damage the fan?


In my case, that is no problem. Normally you would power 1 or 1 and 2 or 1 and 3. 1 and 2 and 3 is no problem. I did not yet try only 2 and 3.

macaidwin
Posts: 56
Joined: Saturday 13 July 2013 9:36
Target OS: -
Domoticz version:
Location: Harderwijk
Contact:

Re: Events: Blockly examples

Postby macaidwin » Monday 15 July 2013 23:41

bistoury wrote:My first heating scenario.
I am afraid I will need to dig into LUA...

blocky_heating_19.jpg


Is this working? In my opinion you can't start with 'and' directly after If.
'and' has to be between two options.

bistoury
Posts: 158
Joined: Friday 12 July 2013 14:14
Target OS: -
Domoticz version:
Contact:

Re: Events: Blockly examples

Postby bistoury » Monday 15 July 2013 23:57

yep, this works.

The only thing that was wrong was the temp condition (xxx = 17 instead of xxx <= 17).

In fact this condition do not start with a 'AND'. It is a standard condition "xxx AND xxx", but I display the statement using 'external input' (right-click on the green and statement).

I find it more readable : I have a temperature condition, then a scene condition (am I already heating @ 19° ?), and then I have my day and time conditions.

As for the moment I have no heating needs :) this script went to the trash

Hope this help.
Next time, I will try LUA scripting.

macaidwin
Posts: 56
Joined: Saturday 13 July 2013 9:36
Target OS: -
Domoticz version:
Location: Harderwijk
Contact:

Re: Events: Blockly examples

Postby macaidwin » Tuesday 16 July 2013 0:09

bistoury wrote:yep, this works.

The only thing that was wrong was the temp condition (xxx = 17 instead of xxx <= 17).

In fact this condition do not start with a 'AND'. It is a standard condition "xxx AND xxx", but I display the statement using 'external input' (right-click on the green and statement).

I find it more readable : I have a temperature condition, then a scene condition (am I already heating @ 19° ?), and then I have my day and time conditions.

As for the moment I have no heating needs :) this script went to the trash

Hope this help.
Next time, I will try LUA scripting.


Nice! Learned something new... thanks

User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Events: Blockly examples

Postby CopyCatz » Tuesday 16 July 2013 1:04

bistoury wrote:yep, this works..


Nice to see that a different notation also works :) Actually there is a lot more room for conditions if you work this way.

bistoury
Posts: 158
Joined: Friday 12 July 2013 14:14
Target OS: -
Domoticz version:
Contact:

Re: Events: Blockly examples

Postby bistoury » Tuesday 16 July 2013 7:49

I thing next step should be having an ELSE statement.
I know multiple IF is not your 1st target, but the ELSE one is a must have.

have a nice day,

bistoury.

gertjuhh

Re: SCRIPS - EVENT MANAGEMENT SAMPLE

Postby gertjuhh » Wednesday 24 July 2013 13:31

Jochen wrote:
dooropenlighton.PNG



How did you get that second "if-do" blocked nested?
Thats exactly what i need, but I seem unable to do so... (tested in Firefox 22.0 & Chrome 28.0.1500.72)

User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Blockly examples

Postby CopyCatz » Wednesday 24 July 2013 13:35

Currently only one if..do block is supported, that screen is from an older test version.

gertjuhh

Re: Blockly examples

Postby gertjuhh » Wednesday 24 July 2013 13:43

Is it going to be re-implemented?
That way the same logic doesn't need to be applied to multiple events.

User avatar
CopyCatz
Developer
Posts: 751
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Blockly examples

Postby CopyCatz » Wednesday 24 July 2013 13:57

It isn't. The idea is that the blockly interface is for users with little experience, who want simple events in the form of a single if..do that are stored individually. For more complex events use lua scripting, there you can implement any logic you want.

User avatar
Dynamic
Posts: 179
Joined: Friday 12 July 2013 14:50
Target OS: -
Domoticz version:
Location: Enschede
Contact:

Re: Blockly examples

Postby Dynamic » Friday 02 August 2013 15:05

I made this event to turn on the lights when there is movement outside the bedroom-doors (for example: someone comes out of his bedroom and is on his way to the bathroom or the stairs). In that case the lights are turned on at 100% (if it's before midnight) or at 20% if it's after midnight.

Need to test it tonigt... I'm not sure if the 'set overloop = level 20 % for 1 minute' will work.
Attachments
event-overloop.png
event-overloop.png (31.89 KiB) Viewed 36369 times

gibbiem
Posts: 6
Joined: Saturday 13 July 2013 3:36
Target OS: -
Domoticz version:
Contact:

Re: Blockly examples

Postby gibbiem » Sunday 04 August 2013 9:57

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


Return to “Scripts [cleaning in progress]”

Who is online

Users browsing this forum: No registered users and 4 guests