Blockly examples

Moderator: leecollings

User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Blockly examples

Post by thecosmicgate »

ThinkPad wrote:Some events that i created:

Detect if there is someone home
Almost all my other events are based on this one. This event will tell Domoticz if there is someone home or not.
This event is based on two virtual switches, where one is switched by a geofence app on iPhone, and the other by this script: http://www.domoticz.com/wiki/Presence_detection
Image
'IemandThuis' translates to 'SomeoneHome'

Switch on lights when we are home, and it is getting dark
This event turns on some lights when we are home, and it is starting to get dark. The variable is used so that the event is only triggered once. Otherwise it would trigger again when we turn off the lights by hand when we go to bed.
Image
The '15min_before_zononder' is a virtual switch that turns on 15 min before sunset, and off at 0:01

Turn on lights when we arrive home and it is dark outside
This event turns on some lights when we arrive home and it is dark outside. The variable is used so that the event is only triggered once. Otherwise it would trigger again when we turn off the lights by hand when we go to bed.
Image
First line ends with "IsDonker = On"

The "IsDonker" switch i use, is a virtual switch that is turned on/off by timers. It is turned on at sunset, and turned off at sunrise. This way it covers the whole 'dark' period of the evening/night. This is easy to use in events. By doing this my lights will never switch on accidentaly at daytime.

Unfortunately they are in Dutch, but i hope they are still useful for someone...
I use this someone home switch, but whe try to open the log the browser crashes.
Are there more people who use this blockly and having this log issue ?
Or maybe better , the solution ;)
It's nice to be important, but it's more important to be nice
Scooter ;)
djoeney
Posts: 15
Joined: Sunday 17 May 2015 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Blockly examples

Post by djoeney »

Hi,

I have followed a example from this forum only it doesn't work?

Image
Compute RPi 2 : Domoticz latest beta, Synology : Domoticz tested beta on failover system.
Peripherals RFXCOM - RFXtrx433, Z-Wave.Me ZME_UZB1 USB Stick,P1 cable on smartmeter, Logitech Harmony Hub, 3 IP camera's
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

Hi, welcome to this forum! :)

The 'IemandThuis = Off' part is not correct. Make it like this:

IemandThuis = Off AND [Anna = On OR Jeroen = On]
Same for the 'ELSE IF' line. The rest of it is correct.

So you have 1 AND block, and inside is:
- IemandThuis = Off
- [Anna = On OR Jeroen = On]

See this one: http://i.imgur.com/0lQrGcL.png i made (also shown a few posts above)
I am not active on this forum anymore.
djoeney
Posts: 15
Joined: Sunday 17 May 2015 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Blockly examples

Post by djoeney »

Hi ThinkPad,

What a warm welcome, thanks for the quick reply. This does the trick, now i can put off the radio in the morning when nobody is home:). Cant wait till my RFXtrx433E is delivered.
Compute RPi 2 : Domoticz latest beta, Synology : Domoticz tested beta on failover system.
Peripherals RFXCOM - RFXtrx433, Z-Wave.Me ZME_UZB1 USB Stick,P1 cable on smartmeter, Logitech Harmony Hub, 3 IP camera's
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

Hehe this is only the tip of the iceberg :twisted: I can guarantee you that you will spend a looooooooooot of time in configuring the most fantastic events and such :lol:

Have fun! ;)
I am not active on this forum anymore.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

I found this nice event which triggers a switch if movement is detected by a motion sensor. If no motion is detected anymore after 1 minute, the light will turn off.
If within that minute there is still motion, the light will stay on until no motion is detected anymore.

Works great!

Image
Credits go to bizziebis: http://www.domoticz.com/forum/viewtopic ... pir#p14415
Add another (dummy) switch which will switch off after 1 minute (it's a setting of the switch) and call it for example 1 Min Timer (in my example)
Every time the PIR detects motion the timer will be activated again and starts counting down from 60 seconds. Until the last movement is detected, then the light will go off.
I am not active on this forum anymore.
spudgunman
Posts: 32
Joined: Tuesday 26 May 2015 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Seattle WA, USA
Contact:

Re: Blockly examples

Post by spudgunman »

That's great! I am working on making lights turn on around the house when you walk in to rooms automatically. Thanks
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: SCRIPS - EVENT MANAGEMENT SAMPLE

Post by dressie »

Jochen wrote: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
PS: The device Garagentor is the door (Garagentor = Garagedoor), the light is light is Licht Garage (Light Garage)
How did you get the double IF /DO option?
User avatar
havnegata
Posts: 114
Joined: Wednesday 10 September 2014 11:05
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10162
Location: Norway
Contact:

Re: Blockly examples

Post by havnegata »

This is exactly what I want, but where is this setting for the countdown timer?
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly examples

Post by dressie »

Hello!

I'm new to Domoticz and pretty happy with it! Slowly I'm having Domoticz take over tasks from Homewizard, but I can't seem to figure this "simple" one out. Do you guy know what's going wrong?
The light goes on when the door opens, but it does it for 24hours and not according the set Sunset-Sunrise time. Already did my research in this form, copied many examples but with no success.

Image
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

IF [Frontdoor = Open] AND [Time > Sunset] OR [Time < Sunrise]
DO SET .....

The nesting of the elements (with the AND/OR parts) is not correct.

Build it like this:
Image
I am not active on this forum anymore.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly examples

Post by dressie »

ThinkPad wrote:IF [Frontdoor = Open] AND [Time > Sunset] OR [Time < Sunrise]
DO SET .....

The nesting of the elements (with the AND/OR parts) is not correct.
How would I be able to solve this one? I haven't figured out the "inline" and "outline" inputs.
I simply want: IF the frondoor opens, and it's between Sunset and Sunrise, turn on the hall-light.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

I have updated my post with a screenshot. Pay attention to the boxes around items in the screenshot (the brackets in my text written event)
I am not active on this forum anymore.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly examples

Post by dressie »

ThinkPad wrote:I have updated my post with a screenshot. Pay attention to the boxes around items in the screenshot (the brackets in my text written event)
I start to see it now! Thanks! Just trying to figure out how to make these sepperate "event" between the brackets.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly examples

Post by dressie »

Perhaps my Google-skills arn't that great, but I can't seem to find a blockly example of doorbel = send snapshot to email? :?:
This is the last function that's still being done by my HomeWizard :?
Luuc_a
Posts: 24
Joined: Tuesday 16 July 2013 10:12
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Blockly examples

Post by Luuc_a »

You van do this without a blocky. Go to Settings -> More options -> Camera. Select the camera and at the bottom select the doorbell and click on add.

When you've done this and go to switches then to your doorbell you'll see a camera icon.
leoncornelissen
Posts: 24
Joined: Monday 27 April 2015 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8258
Location: Netherlands
Contact:

Re: Blockly examples

Post by leoncornelissen »

I created two events to switch on the fan if the humidity is too high but the events won't trigger. Do I need to set something special in the configuration?
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: Blockly examples

Post by dressie »

Luuc_a wrote:You van do this without a blocky. Go to Settings -> More options -> Camera. Select the camera and at the bottom select the doorbell and click on add.

When you've done this and go to switches then to your doorbell you'll see a camera icon.
Thanks! It was that simple!
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by ThinkPad »

leoncornelissen wrote:I created two events to switch on the fan if the humidity is too high but the events won't trigger. Do I need to set something special in the configuration?
No.
Probably there is an error in your event. If you post it here maybe we can help.
I am not active on this forum anymore.
leoncornelissen
Posts: 24
Joined: Monday 27 April 2015 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8258
Location: Netherlands
Contact:

Re: Blockly examples

Post by leoncornelissen »

I stopped the block service and started it again. Now it works fine. Still limited in functionality but more reason to learn lua
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest