Blockly examples

Must be cleaned all topics go to the right subforum
User avatar
StanHD
Posts: 531
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: RE: Re: Blockly examples

Post by StanHD » Monday 30 January 2017 19:52

tozzke wrote:Sunset/rise have to be linked into the Time-blockly
Image
I think the "and" should be an "or" due to the 00:00 end of day within Domoticz.
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

tozzke
Posts: 115
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke » Monday 30 January 2017 21:29

true, I was too focussed on the correct position of the blocks :)

tjabas
Posts: 149
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas » Sunday 05 February 2017 13:19

fläkt.PNG
fläkt.PNG (7.53 KiB) Viewed 1875 times
Hi!

i have made a blocky like this:[img]
fläkt.PNG
fläkt.PNG (7.53 KiB) Viewed 1875 times
[/img]

it contols my bathroom fan, it works good but i can see in the log that it send an off command every minute when it goes below 49%
i dont know if it matters if the rfx sends an off command every minute, but it sure doesnt need to do that, how can i make the blocky so the rfx sends just one or a couple of off commands after the moisture % goes below 49%?

another stupid question is, is it called blocky or blockly?

User avatar
PeGe
Posts: 28
Joined: Tuesday 31 January 2017 15:21
Target OS: Raspberry Pi
Domoticz version: V3.6328
Location: Sollentuna, Sweden
Contact:

Re: Blockly examples

Post by PeGe » Sunday 05 February 2017 13:31

To avoid that unnecessary load, just include an AND in your condition, checking if 'Toalett fläkt' = On.

Like this:

if 'Toalett nere' < 49 AND 'Toalett fläkt' = On

/P-G

tjabas
Posts: 149
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas » Sunday 05 February 2017 13:48

ofcourse , why didnt i think of that :)
i have fixed it now and im going to test it.
thanks.

AimoPaukku
Posts: 15
Joined: Saturday 28 January 2017 10:35
Target OS: Raspberry Pi
Domoticz version: Latest
Contact:

Re: Blockly examples

Post by AimoPaukku » Friday 31 March 2017 22:24

Hi...

How can i create this IF event?

IF it is cold outside(<10c I have virtual weatherstation) and any door(i can do doors or package) is left open for a 5min or more. Ignore if less.

Then I want a message (can do this part)

tozzke
Posts: 115
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke » Saturday 01 April 2017 1:25

AimoPaukku wrote:Hi...

How can i create this IF event?

IF it is cold outside(<10c I have virtual weatherstation) and any door(i can do doors or package) is left open for a 5min or more. Ignore if less.

Then I want a message (can do this part)
I'd say that this should do the trick:

Image

Change my 'TESTknop1 = On' into your 'temp < 10', my 'TESTknop2 = On' into your 'Doors = Open', my 'var TESTlamp1' into a variable to your liking, my switch 'TESTlamp1' into a dummy switch to your liking, my 'TESTknop1 = Off' into your 'Doors = Closed', my 'Write to log "WARNING!!!!! DOORS OPEN!!!!"' into your notification and my 10 seconds into your desired time in seconds.

The dummy switch 'TESTlamp1' is necessary because of the fact that Domoticz/Blockly won't allow you to change the very variable which you also use in the if-statement.

the log:

Code: Select all

2017-04-01 01:03:33.339 User: Admin initiated a switch command (123/TESTknop1/On)
2017-04-01 01:03:33.340 (TESTknop1) Lighting 2 (TESTknop1)
2017-04-01 01:03:35.427 User: Admin initiated a switch command (124/TESTknop2/On)
2017-04-01 01:03:35.457 EventSystem: Event triggered: TEST - 1-4-2017 - AimoPaukku Domoticz forum Blockly samples_1
2017-04-01 01:03:35.460 var TESTlamp1 = 1
2017-04-01 01:03:35.460 var TESTlamp1 = 2 after 10 seconds
2017-04-01 01:03:35.428 (TESTknop2) Lighting 2 (TESTknop2)
2017-04-01 01:03:35.746 (TESTlamp1) Lighting 1 (TESTlamp1)
2017-04-01 01:03:39.447 User: Admin initiated a switch command (124/TESTknop2/Off)
2017-04-01 01:03:39.478 EventSystem: Event triggered: TEST - 1-4-2017 - AimoPaukku Domoticz forum Blockly samples_3
2017-04-01 01:03:39.480 var TESTlamp1 = 0
2017-04-01 01:03:39.448 (TESTknop2) Lighting 2 (TESTknop2)
2017-04-01 01:03:39.775 (TESTlamp1) Lighting 1 (TESTlamp1)
2017-04-01 01:03:46.743 Set UserVariable TESTlamp1 = 2
2017-04-01 01:03:50.066 User: Admin initiated a switch command (124/TESTknop2/On)
2017-04-01 01:03:50.095 EventSystem: Event triggered: TEST - 1-4-2017 - AimoPaukku Domoticz forum Blockly samples_2
2017-04-01 01:03:50.097 WARNING!!!!! DOORS OPEN!!!!
2017-04-01 01:03:50.067 (TESTknop2) Lighting 2 (TESTknop2)
2017-04-01 01:03:50.371 (TESTlamp1) Lighting 1 (TESTlamp1)
2017-04-01 01:03:50.761 Set UserVariable TESTlamp1 = 0
2017-04-01 01:04:20.292 User: Admin initiated a switch command (124/TESTknop2/Off)
2017-04-01 01:04:20.293 (TESTknop2) Lighting 2 (TESTknop2)
2017-04-01 01:04:21.116 User: Admin initiated a switch command (123/TESTknop1/Off)
2017-04-01 01:04:21.117 (TESTknop1) Lighting 2 (TESTknop1)
PS: in lua it would be easier :p
In lua you can put the time condition in the if instead of in the output

anno
Posts: 35
Joined: Wednesday 01 March 2017 14:00
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by anno » Wednesday 05 April 2017 0:57

this is working only not all the time. for example this evening the tuin lights didn't turn off after 5 min. Why?
Attachments
blocky 1 tuin2.jpg
blocky 1 tuin2.jpg (326.63 KiB) Viewed 1478 times

Nautilus
Posts: 637
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Blockly examples

Post by Nautilus » Wednesday 05 April 2017 7:40

anno wrote:this is working only not all the time. for example this evening the tuin lights didn't turn off after 5 min. Why?
Depending of the lamp type, I've noticed "Off AFTER 5" works sometimes a lot better than "On FOR 5". It possibly has something to do with the states that are available for the lamp type. Basic On/Off works (maybe) well also with "On FOR XX" whereas dimming / RGB etc. bulbs need to use "Off AFTER XX"?

So I would change the first command to just "On" and then add a second command to each condition with "Off AFTER 5" :)

anno
Posts: 35
Joined: Wednesday 01 March 2017 14:00
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by anno » Wednesday 05 April 2017 10:18

Nautilus wrote:
anno wrote:this is working only not all the time. for example this evening the tuin lights didn't turn off after 5 min. Why?
Depending of the lamp type, I've noticed "Off AFTER 5" works sometimes a lot better than "On FOR 5". It possibly has something to do with the states that are available for the lamp type. Basic On/Off works (maybe) well also with "On FOR XX" whereas dimming / RGB etc. bulbs need to use "Off AFTER XX"?

So I would change the first command to just "On" and then add a second command to each condition with "Off AFTER 5" :)
Thanks you, i will try it

tozzke
Posts: 115
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke » Wednesday 05 April 2017 17:48

anno wrote:this is working only not all the time. for example this evening the tuin lights didn't turn off after 5 min. Why?
'On for x minutes' means that after the set time, it goes back to the previous setting.
If the light is already on (or rather... not off) it turns the light on again but after 5 minutes it goes to the previous state which was already on.
So probably the time the light didn't go off, it was already on when a sensor detected motion.

So you'll have to add the condition 'and Tuinverlichting = Off' to all if's or use the suggestion made by Nautilus

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Tuesday 18 April 2017 23:36

I made this script to bring the nest thermostat to 18 degrees when the window is opened.
the script works fine (open url"http://192.168.1.xxx:8080/json.htm?type ... &svalue=18")
How can run the script when the window is left open for more than five minutes? When x is open for more than 5 minutes, do....
Image

Caribou
Posts: 14
Joined: Thursday 20 April 2017 17:35
Target OS: Linux
Domoticz version:
Location: Bordeaux
Contact:

Re: Blockly examples

Post by Caribou » Thursday 20 April 2017 18:27

Hi,
I'm a newbie with domoticz and beginning to play with events.
Could you please tell me what am I missing with this blocky scenario:
Image
My goal is to receive an email alert when a motion is detected between specific hours (next I will try to improve it, by receving only an email for the first motion of each day).

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

Re: Blockly examples

Post by StanHD » Thursday 20 April 2017 18:41

Caribou wrote:Hi,
I'm a newbie with domoticz and beginning to play with events.
Could you please tell me what am I missing with this blocky scenario:
Image
My goal is to receive an email alert when a motion is detected between specific hours (next I will try to improve it, by receving only an email for the first motion of each day).
If you only have an "If" but not an "Else If" then you should use the block without the blue "gear" symbol. ;)
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Wednesday 26 April 2017 17:21

videodrome wrote:I made this script to bring the nest thermostat to 18 degrees when the window is opened.
the script works fine (open url"http://192.168.1.xxx:8080/json.htm?type ... &svalue=18")
How can run the script when the window is left open for more than five minutes? When x is open for more than 5 minutes, do....
Image
anyone could help me?

four2six
Posts: 65
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Post by four2six » Wednesday 26 April 2017 17:43

quick idea: have a virtual switch, turn that switch on when the window opens and make it turn off after 5 minutes. when it turns off, open the url.

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Monday 01 May 2017 1:02

four2six wrote:quick idea: have a virtual switch, turn that switch on when the window opens and make it turn off after 5 minutes. when it turns off, open the url.
Thanx for the idea: now it works. The nest thermostat will be set to 18 degrees if the door remains open for at least 5 minutes, otherwise it will remain at the set temperature. "Finestra"is the virtual sensor
Image

four2six
Posts: 65
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Post by four2six » Monday 01 May 2017 11:48

better than what i said, well done :-)

Letalis
Posts: 11
Joined: Monday 28 November 2016 22:21
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Letalis » Friday 26 May 2017 19:25

Tried to find a solution. But when I use blocky to lower my blind and notify me it sends multiple notifications.. I got like a notification every one minute or so.

Can you get blocky to only send notification once?

four2six
Posts: 65
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Post by four2six » Saturday 27 May 2017 6:35

can you post the blockly?

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests