Blockly examples

Moderator: leecollings

HellStorm666
Posts: 4
Joined: Wednesday 24 June 2015 8:05
Target OS: Linux
Domoticz version: 4.11786
Location: Netherlands
Contact:

Re: Blockly examples

Post by HellStorm666 »

Why doesnt my event work?
It is active, And manualy checked the states of the switches and they are correct.
for example, Yesterday I came home at 21:45. The lights were off, that is correct, because we wheren't at home. But at the moment I am home, it should've turned on the lights.

Image
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD »

To start with, you do not have Logic Blocks on several of your devices. i.e. First Line:- "If aMobielR...."
What condition do you want to test, On - Off < > etc.?
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
HellStorm666
Posts: 4
Joined: Wednesday 24 June 2015 8:05
Target OS: Linux
Domoticz version: 4.11786
Location: Netherlands
Contact:

Re: Blockly examples

Post by HellStorm666 »

StanHD wrote:To start with, you do not have Logic Blocks on several of your devices. i.e. First Line:- "If aMobielR...."
What condition do you want to test, On - Off < > etc.?
Ohw, right.....
I guessed that on=true, off=false so no extra condition needed.

will change that.
Also simplified it with more events and less els-if in one event.
ea playing movies and controling the lights in a different event than turning the lights on.
lbouriez
Posts: 4
Joined: Thursday 20 November 2014 22:16
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by lbouriez »

I am looking to do an event who will notify me if the door is open more than 45sec (like I forget to close it).
With my HC2 I used GEA, an amazin scene who can do cofee, but in DomoticZ, I don't know how to do it with Blocky since I don't find any way to do a loop.
Any idea :) ?
pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: Blockly examples

Post by pj-r »

LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
lbouriez
Posts: 4
Joined: Thursday 20 November 2014 22:16
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by lbouriez »

Ok, thanks for the link.
I thought I could do it with Blocks :(
User avatar
Shaggie_NB
Posts: 25
Joined: Thursday 30 January 2014 20:46
Target OS: Windows
Domoticz version:
Location: Oss
Contact:

Re: Blockly examples

Post by Shaggie_NB »

http://www.domoticz.com/forum/viewtopic ... pir#p14415

I cannot understand why people always start with referring to LUA when people ask for a solution in blockly??? :?
Dlanor
Posts: 67
Joined: Sunday 22 March 2015 16:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: home ventilation system

Post by Dlanor »

macaidwin wrote:This is my working Blocky Event for my home ventilation system, level 1, 2, 3 and off.
Electrical scheme:
Image
As i read your scheme right on L is 230v?
Domoticz| Zigbee | SONOFF
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 »

I have a question. I have the following blockly event made for turning off my tv, mediabox and Horizon.

Image

The problem is the following; when away is set on, it will take 5 minuten before it turns off. But when Home is set within the 5 minutes, the media will turn off anyway. It looks like the event is not canceled. Is it something in my blockly event of is it perhaps a "bug"?
pj-r
Posts: 140
Joined: Wednesday 17 December 2014 17:30
Target OS: Linux
Domoticz version: V3.8650
Location: Jyväskylä, Finland
Contact:

Re: Blockly examples

Post by pj-r »

How do you think domoticz knows to cancel the timer you have set at "set off after..."? ;)

You need to "build" your own timer. So add "AwayTimer" variable or virtual switch to use as a flag.
Then just add bit more cases there(Havent tested but it should work this way):

Code: Select all

If Away = On and AwayTimer = Off and Media = On <-- case when you leave the house
 set AwayTimer = On After 5 minutes
Else if Away = On and AwayTimer = On and Media = On <-- case when timer time has passed and you are still away
 set AwayTimer = Off
 set Media = Off
Else if Away = Off and AwayTimer = On <-- case where you cancel the timer eg. return home within 5 minutes
 set AwayTimer = Off
 set Media = On <-- not sure if needed here
Else if Away = Off <-- case when you return to home
 set Media = On
Perhaps some "cancel timers of device xxx" block could help to make these more simple looking.
I think its the same with PIR. You could check the "smart pir script" from wiki.
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
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 »

Thanks @pj-r , I'll give it a try!!

Andrès
Adam
Posts: 3
Joined: Thursday 16 July 2015 11:25
Target OS: -
Domoticz version:
Location: Deutschland
Contact:

Re: Blockly examples

Post by Adam »

Hello there,

is there perhaps someone who could help me with the building blocks in German? :oops:

Adam
BarryT
Posts: 367
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Re: Blockly examples

Post by BarryT »

dressie wrote:I have a question. I have the following blockly event made for turning off my tv, mediabox and Horizon.

Image

The problem is the following; when away is set on, it will take 5 minuten before it turns off. But when Home is set within the 5 minutes, the media will turn off anyway. It looks like the event is not canceled. Is it something in my blockly event of is it perhaps a "bug"?
I've done the same here..
Maybe you can learn from this blocky?

G'Luck.
test.png
test.png (52.73 KiB) Viewed 4913 times
Note, the time function to stay ON between 18.00 and 23.50 is for recording programs @ the horizon box :-)
Yury
Posts: 4
Joined: Sunday 13 September 2015 16:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by Yury »

Please Help.

I do not understand variables comparison. Whenever I use user variables like Time, Integer or String in IF statement it does not work.
This event supposed to occur every minute. but not.

var.PNG
var.PNG (70.32 KiB) Viewed 4815 times
var3.PNG
var3.PNG (30.54 KiB) Viewed 4815 times
Docc
Posts: 22
Joined: Saturday 02 May 2015 8:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Sweden
Contact:

Re: Blockly examples

Post by Docc »

Can someone please help me understand why this is not working..? :-S
FanCtrl.png
FanCtrl.png (17.89 KiB) Viewed 4781 times
It is a simple fan control. Fan should go on if outside temp is lower than inside temp and goes off if not, but the fan stays off :-(
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Blockly examples

Post by Minglarn »

À short question.

Is it possible to use LUX as a comparing in Blocky?
Trying to determine if lights should be on or off based on lux.
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD »

@Minglarn, Yes you can use:-

If Lux < x
Do set Switch On

This works:-

Image
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
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 »

But be sure to have some margin.

<150 lux = On
> 200 lux = Off

Otherwise (with the on/off comparison value close to eachother) your lights might go acting very nervous if a cloud flies by, switching your lights on, and off very soon after.
I am not active on this forum anymore.
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Blockly examples

Post by Minglarn »

Cant get this to work. The actual value for "LUX Hallen" is 67.
But no reaction to this blocky..
Using: v2.311..

Skärmklipp.JPG
Skärmklipp.JPG (30.54 KiB) Viewed 4739 times
As the abowe did not work I tryed a dummy swich and now it works...
Using this blocky:
Attachments
Skärmklipp2.JPG
Skärmklipp2.JPG (54.28 KiB) Viewed 4734 times
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
User avatar
Minglarn
Posts: 214
Joined: Friday 21 August 2015 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version: v3.8153
Location: Stockholm / Sweden
Contact:

Re: Blockly examples

Post by Minglarn »

OKey need some help here...
I Want this blocky to be active ony between time from morgning 06:00 and after midnight 00:30 . How do I make the time comparison?
Would this work?
3.JPG
3.JPG (17.59 KiB) Viewed 4721 times
When you eliminate the impossible, whatever remains, however improbable, must be the truth.” -Spock in Star Trek VI
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests