Page 23 of 36

Re: RE: Re: Blockly examples

Posted: Monday 30 January 2017 18:52
by StanHD
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. Image

Re: Blockly examples

Posted: Monday 30 January 2017 20:29
by tozzke
true, I was too focussed on the correct position of the blocks :)

Re: Blockly examples

Posted: Sunday 05 February 2017 12:19
by tjabas
fläkt.PNG
fläkt.PNG (7.53 KiB) Viewed 5669 times
Hi!

i have made a blocky like this:[img]
fläkt.PNG
fläkt.PNG (7.53 KiB) Viewed 5669 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?

Re: Blockly examples

Posted: Sunday 05 February 2017 12:31
by PeGe
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

Re: Blockly examples

Posted: Sunday 05 February 2017 12:48
by tjabas
ofcourse , why didnt i think of that :)
i have fixed it now and im going to test it.
thanks.

Re: Blockly examples

Posted: Friday 31 March 2017 22:24
by AimoPaukku
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)

Re: Blockly examples

Posted: Saturday 01 April 2017 1:25
by tozzke
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

Re: Blockly examples

Posted: Wednesday 05 April 2017 0:57
by anno
this is working only not all the time. for example this evening the tuin lights didn't turn off after 5 min. Why?

Re: Blockly examples

Posted: Wednesday 05 April 2017 7:40
by Nautilus
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" :)

Re: Blockly examples

Posted: Wednesday 05 April 2017 10:18
by anno
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

Re: Blockly examples

Posted: Wednesday 05 April 2017 17:48
by tozzke
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

Re: Blockly examples

Posted: Tuesday 18 April 2017 23:36
by videodrome
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

Re: Blockly examples

Posted: Thursday 20 April 2017 18:27
by Caribou
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).

Re: Blockly examples

Posted: Thursday 20 April 2017 18:41
by StanHD
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. ;)

Re: Blockly examples

Posted: Wednesday 26 April 2017 17:21
by videodrome
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?

Re: Blockly examples

Posted: Wednesday 26 April 2017 17:43
by four2six
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.

Re: Blockly examples

Posted: Monday 01 May 2017 1:02
by videodrome
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

Re: Blockly examples

Posted: Monday 01 May 2017 11:48
by four2six
better than what i said, well done :-)

Re: Blockly examples

Posted: Friday 26 May 2017 19:25
by Letalis
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?

Re: Blockly examples

Posted: Saturday 27 May 2017 6:35
by four2six
can you post the blockly?