Blockly examples
Moderator: leecollings
-
- Posts: 170
- Joined: Monday 22 January 2018 21:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
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.
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
Zwave, Zigate, RFlink etc.
-
- Posts: 109
- Joined: Tuesday 02 October 2018 20:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Have a look in your log what status the switch gets when you push it. Then you know what status to usempx2 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.
-
- Posts: 3
- Joined: Tuesday 17 December 2019 9:06
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Blockly examples
hi, I had the same problem and solved it like thisFranzie 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.
1. doing ping phone
2. if the phone is turned off after 60 seconds, then i left.
-
- Posts: 30
- Joined: Wednesday 09 January 2019 17:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.1
- Location: Nederland
- Contact:
Re: Blockly examples
Thank you Vlado. I changed the grace period to 60 seconds and poll to 15 and now no interrupts anymore!!Vladio wrote: ↑Tuesday 21 January 2020 15:22hi, I had the same problem and solved it like thisFranzie 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.
1. doing ping phone
2. if the phone is turned off after 60 seconds, then i left.
2020-01-21_17-16-55.png
Re: Blockly examples
Hi,
I need help with a blocky, if my sensor is under 50 i like to switch the water on.
Error in the log:
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
- Attachments
-
- firefox_2020-04-04_22-09-16.jpg (51.77 KiB) Viewed 4798 times
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
-
- Posts: 109
- Joined: Tuesday 02 October 2018 20:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Please have a look on this thread. Especially the posts of Waaren. https://www.domoticz.com/forum/viewtopi ... 62&t=32471marktn 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
I think it won't be possible with Blockly and you need to switch to dzVents
-
- Posts: 37
- Joined: Monday 30 March 2020 7:30
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Blockly examples
How can I using in blockly the change time?
if the variable =1 a minute ago then be it XY = red
if the variable =1 a minute ago then be it XY = red
-
- Posts: 30
- Joined: Tuesday 25 June 2019 13:18
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Blockly examples
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.
- Attachments
-
- script raam 2.jpg (88.51 KiB) Viewed 4442 times
-
- Posts: 30
- Joined: Tuesday 25 June 2019 13:18
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Blockly examples
somebody?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.
-
- Posts: 82
- Joined: Friday 27 December 2013 23:29
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2.2284
- Location: Nederland, Den Bosch
- Contact:
Re: Blockly examples
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.
If Rolluiken BENEDEN = Closed and dummy raamcontact1 = off and rolluiken beneden omhoog = On
Do Set group Rolluiken beneden omhoog = Off
Enz.
- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
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
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
- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Friends; I got a DZ Vents and it works great, if someone wants to receive it please let me know!
-
- Posts: 30
- Joined: Tuesday 25 June 2019 13:18
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Blockly examples
Can you drop it here? 

- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
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?

Help?
-
- Posts: 38
- Joined: Thursday 07 June 2018 22:23
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Sud de France
- Contact:
Re: Blockly examples
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!
-
- Posts: 24
- Joined: Tuesday 27 February 2018 8:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
you maderolandtwilt 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?
If (Item1 = ("On") and (Item2 = "On"))
Do something
Right:
If (Item1 = "On") and (Item2 = "On")
Do something
- Attachments
-
- Unbenannt.jpg (10.96 KiB) Viewed 3666 times
- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
1000 times thanks, I've been searching and trying for days, thanks again
- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
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?



-
- Posts: 3
- Joined: Monday 11 March 2019 11:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9700
- Contact:
Re: Blockly examples
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.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?
![]()
![]()
- rolandtwilt
- Posts: 74
- Joined: Monday 05 October 2020 18:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
I understand what you mean and I have adjusted this. but unfortunately the script still doesn't work
Who is online
Users browsing this forum: No registered users and 0 guests