Page 34 of 36
Re: Blockly examples
Posted: Friday 17 January 2020 19:23
by Geitje
If there are false negatives you should increase number of pollings within one grace period. This can either be done by making grace period longer or polling period briefer, or both. Please refer to the iDetect topic.
Re: Blockly examples
Posted: Saturday 18 January 2020 7:18
by wouterlet
mpx2 wrote: ↑Sunday 24 November 2019 17:06
How to use Push off button in Blocky.
I have two on/off buttons which work. I have a remote with All Off button. This off button is "Type: Light/Switch, AC, Push Off Button" in Domoticz. If I press All Off on remote or Push Off button in Domoticz swhitches turn off but the state in Domoticz is still on.
How Can I use that Push Off button to whitch off also the switches in Domoticz? I have tries if that Push off Button is off, on, 1 and 0 but nothing happens.
Have a look in your log what status the switch gets when you push it. Then you know what status to use
Re: Blockly examples
Posted: Tuesday 21 January 2020 15:22
by Vladio
Franzie wrote: ↑Wednesday 15 January 2020 12:54
Hi there, need some help with Blockly.
I made a script that when Me and my wife (phones) leave the building all the switches must turn off.
That works fine, thanks to iDetect.
D70D53BD-CFFE-401A-9FE6-B7E8F2038C33.jpeg
But. Every evening my UniFi Switch "does not see" my phones for 2 or 3 seconds once or twice an evening and then it gets dark.
I tried to change the script so that there is a timer countdown 10 seconds and then check again if the phones are off but I don't know anymore how to make a timer which is counting off
Can someone help me please.
hi, I had the same problem and solved it like this
1. doing ping phone
2. if the phone is turned off after 60 seconds, then i left.

- 2020-01-21_17-16-55.png (23.92 KiB) Viewed 5561 times
Re: Blockly examples
Posted: Wednesday 29 January 2020 21:41
by Franzie
Vladio wrote: ↑Tuesday 21 January 2020 15:22
Franzie wrote: ↑Wednesday 15 January 2020 12:54
Hi there, need some help with Blockly.
I made a script that when Me and my wife (phones) leave the building all the switches must turn off.
That works fine, thanks to iDetect.
D70D53BD-CFFE-401A-9FE6-B7E8F2038C33.jpeg
But. Every evening my UniFi Switch "does not see" my phones for 2 or 3 seconds once or twice an evening and then it gets dark.
I tried to change the script so that there is a timer countdown 10 seconds and then check again if the phones are off but I don't know anymore how to make a timer which is counting off
Can someone help me please.
hi, I had the same problem and solved it like this
1. doing ping phone
2. if the phone is turned off after 60 seconds, then i left.
2020-01-21_17-16-55.png
Thank you Vlado. I changed the grace period to 60 seconds and poll to 15 and now no interrupts anymore!!
Re: Blockly examples
Posted: Saturday 04 April 2020 22:12
by marktn
Hi,
I need help with a blocky, if my sensor is under 50 i like to switch the water on.
Error in the log:
Code: Select all
EventSystem: Lua script error (Blockly), Name: Mi_FLora_email_binnen_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number
Re: Blockly examples
Posted: Thursday 28 May 2020 22:29
by wouterlet
marktn wrote: ↑Saturday 04 April 2020 22:12
Hi,
I need help with a blocky, if my sensor is under 50 i like to switch the water on.
Error in the log:
Code: Select all
EventSystem: Lua script error (Blockly), Name: Mi_FLora_email_binnen_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number
Please have a look on this thread. Especially the posts of Waaren.
https://www.domoticz.com/forum/viewtopi ... 62&t=32471
I think it won't be possible with Blockly and you need to switch to dzVents
Re: Blockly examples
Posted: Monday 20 July 2020 10:59
by Atis
How can I using in blockly the change time?
if the variable =1 a minute ago then be it XY = red
Re: Blockly examples
Posted: Sunday 23 August 2020 20:30
by jellex87
I have this script to trigger a group of blinds up and down with a condition. The condition is that the windows are closed. Therefore I have the DUMMY switch. The script works, but the problem is that the script also get triggered if the dummy switch changes state to off. That is unwanted! How can I realize that only when I trigger 'Rolluik BENEDEN" the group 'rolluiken beneden omhoog' gets activated.
Re: Blockly examples
Posted: Tuesday 22 September 2020 14:21
by jellex87
jellex87 wrote: ↑Sunday 23 August 2020 20:30
I have this script to trigger a group of blinds up and down with a condition. The condition is that the windows are closed. Therefore I have the DUMMY switch. The script works, but the problem is that the script also get triggered if the dummy switch changes state to off. That is unwanted! How can I realize that only when I trigger 'Rolluik BENEDEN" the group 'rolluiken beneden omhoog' gets activated.
somebody?
Re: Blockly examples
Posted: Tuesday 22 September 2020 16:27
by Ron
Maybe you should ad a third condition:
If Rolluiken BENEDEN = Closed and dummy raamcontact1 = off and rolluiken beneden omhoog = On
Do Set group Rolluiken beneden omhoog = Off
Enz.
Re: Blockly examples
Posted: Sunday 27 December 2020 14:57
by rolandtwilt
I am new so not yet experienced and would like the following;
I have two motion detectors that together must control a lamp, if sensor 1 switches on the lamp, sensor 2 must switch off the lamp and vice versa. Does anyone know how I can make this in Blocky? I've been searching for a while
Re: Blockly examples
Posted: Sunday 03 January 2021 8:37
by rolandtwilt
Friends; I got a DZ Vents and it works great, if someone wants to receive it please let me know!
Re: Blockly examples
Posted: Monday 04 January 2021 12:52
by jellex87
Can you drop it here?

Re: Blockly examples
Posted: Monday 15 February 2021 17:17
by rolandtwilt
i'm having problems with my blocky, i receive the following error: 2021-02-15 17: 09: 59.611 Error: EventSystem: Lua script error (Blockly), Name: floodlight garden_1 => [string "result = 0; weekday = os. date ('* t') ['wday']; ... "]: 1: 'then' expected near 'comparevariable'
Help?
Re: Blockly examples
Posted: Wednesday 24 February 2021 19:41
by glory50
I've had hard times to get to work a blockly script for my bathroom with the famous "not very controllable" but inexpensive Xiaomi PIR sensor SNZB-03. Today I suceeded thanks for all the examples and suggestions on Domoticz' forum! Thanks for all of you for it! That's why I share this simple script for all others. My goal was to achieve the situation when the movement in the room is over, the sensor starts to count 60 sec to give out "occupancy:false", then to decrease the lihght to some value to warn the person in the bathroom to make a move for the further light, and after some time to double warn with blinking light, on a case if he/she had slumbered on the bowl not to let him/her into the total darkness. The time slots at the beginning are temporary, as I don't have any light sensor yet but wanted to have a smooth light when going to toilet at night time. So, make any suggestement you like!

- Screenshot - 24.02.2021 , 19_12_57.png (65.7 KiB) Viewed 4213 times
Re: Blockly examples
Posted: Thursday 25 February 2021 21:31
by BennY
rolandtwilt wrote: ↑Monday 15 February 2021 17:17
i'm having problems with my blocky, i receive the following error: 2021-02-15 17: 09: 59.611 Error: EventSystem: Lua script error (Blockly), Name: floodlight garden_1 => [string "result = 0; weekday = os. date ('* t') ['wday']; ... "]: 1: 'then' expected near 'comparevariable'
Help?
you made
If (Item1 = ("On") and (Item2 = "On"))
Do something
Right:
If (Item1 = "On") and (Item2 = "On")
Do something
Re: Blockly examples
Posted: Sunday 28 February 2021 13:40
by rolandtwilt
1000 times thanks, I've been searching and trying for days, thanks again
Re: Blockly examples
Posted: Wednesday 03 March 2021 8:59
by rolandtwilt
and yet it doesn't work. The sensor works and the dummy switch (with timer) also works so that the lamp does not shine during the day. The lamp also works. But the script does not work. I don't understand, who can help me?

Re: Blockly examples
Posted: Wednesday 03 March 2021 22:11
by NickGPI
rolandtwilt wrote: ↑Wednesday 03 March 2021 8:59
and yet it doesn't work. The sensor works and the dummy switch (with timer) also works so that the lamp does not shine during the day. The lamp also works. But the script does not work. I don't understand, who can help me?
The problem you have now is that u are using a time block where u want to put the "1 minute". U have to use the logic block like in your previous post. So not the 00:01, but 1. I hope this makes sense for you.
Re: Blockly examples
Posted: Thursday 04 March 2021 13:36
by rolandtwilt
I understand what you mean and I have adjusted this. but unfortunately the script still doesn't work