Blockly examples

Moderator: leecollings

Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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.
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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
Vladio
Posts: 3
Joined: Tuesday 17 December 2019 9:06
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post 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 :oops:

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
2020-01-21_17-16-55.png (23.92 KiB) Viewed 5030 times
Franzie
Posts: 30
Joined: Wednesday 09 January 2019 17:10
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Nederland
Contact:

Re: Blockly examples

Post 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 :oops:

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!!
marktn
Posts: 233
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Blockly examples

Post 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
Attachments
firefox_2020-04-04_22-09-16.jpg
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.
wouterlet
Posts: 109
Joined: Tuesday 02 October 2018 20:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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
Atis
Posts: 37
Joined: Monday 30 March 2020 7:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by Atis »

How can I using in blockly the change time?

if the variable =1 a minute ago then be it XY = red
jellex87
Posts: 30
Joined: Tuesday 25 June 2019 13:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post 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.
Attachments
script raam 2.jpg
script raam 2.jpg (88.51 KiB) Viewed 4442 times
jellex87
Posts: 30
Joined: Tuesday 25 June 2019 13:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post 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?
Ron
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

Post 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.
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

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

Re: Blockly examples

Post by rolandtwilt »

Friends; I got a DZ Vents and it works great, if someone wants to receive it please let me know!
jellex87
Posts: 30
Joined: Tuesday 25 June 2019 13:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by jellex87 »

Can you drop it here? ;)
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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'

Image

Help?
glory50
Posts: 38
Joined: Thursday 07 June 2018 22:23
Target OS: Linux
Domoticz version: 2022.1
Location: Sud de France
Contact:

Re: Blockly examples

Post 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
Screenshot - 24.02.2021 , 19_12_57.png (65.7 KiB) Viewed 3682 times
BennY
Posts: 24
Joined: Tuesday 27 February 2018 8:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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'

Image

Help?
you made
If (Item1 = ("On") and (Item2 = "On"))
Do something


Right:
If (Item1 = "On") and (Item2 = "On")
Do something
Attachments
Unbenannt.jpg
Unbenannt.jpg (10.96 KiB) Viewed 3666 times
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by rolandtwilt »

1000 times thanks, I've been searching and trying for days, thanks again
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post 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?
Image

Image
NickGPI
Posts: 3
Joined: Monday 11 March 2019 11:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Blockly examples

Post 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?
Image

Image
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.
User avatar
rolandtwilt
Posts: 74
Joined: Monday 05 October 2020 18:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by rolandtwilt »

I understand what you mean and I have adjusted this. but unfortunately the script still doesn't work
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests