blockly script, but the time option does not work ?
Moderator: leecollings
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
blockly script, but the time option does not work ?
Hi all,
i'am not really handy with Blockly (yet) and i hope maybe u can help me with a blockly script But it dus not work ?, or better it works to good. becourse i dussent matter when i open the door i wil allways get a push message and e-mail
what am I doing wrong ?
Tnx
-A
i'am not really handy with Blockly (yet) and i hope maybe u can help me with a blockly script But it dus not work ?, or better it works to good. becourse i dussent matter when i open the door i wil allways get a push message and e-mail
what am I doing wrong ?
Tnx
-A
- Denny64
- Posts: 53
- Joined: Friday 03 February 2017 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.1
- Location: Italy
- Contact:
Re: blockly script, but the time option does not work ?
First of all you don't need to use two IF statements.
IF voordeur = Open AND Time > 22:30 AND Time < 07:00
To prevent Domoticz sending repeating messages, with blockly you must use a user variable. Make one and call it "Door" using "Open" and "Closed" like string.
Now you can blockly in this way:
IF voordeur = Open AND Door = Closed AND Time > 22:30 AND Time < 07:00
DO Door = Open
Send camera snapshot...
Send notification with subject...
Else IF voordeur = Closed AND Door = Open AND Time > 22:30 AND Time < 07:00
Do Door = Closed
IF voordeur = Open AND Time > 22:30 AND Time < 07:00
To prevent Domoticz sending repeating messages, with blockly you must use a user variable. Make one and call it "Door" using "Open" and "Closed" like string.
Now you can blockly in this way:
IF voordeur = Open AND Door = Closed AND Time > 22:30 AND Time < 07:00
DO Door = Open
Send camera snapshot...
Send notification with subject...
Else IF voordeur = Closed AND Door = Open AND Time > 22:30 AND Time < 07:00
Do Door = Closed
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: blockly script, but the time option does not work ?
Because the day ends at midnight and then resets , your time statement should contain "Or", not "And".
Example: Time >21:00 Or Time <07:00
Example: Time >21:00 Or Time <07:00
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
- Denny64
- Posts: 53
- Joined: Friday 03 February 2017 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.1
- Location: Italy
- Contact:
Re: blockly script, but the time option does not work ?
Of course, I forget it...
But this does not solve the recursive sending message until the door is closed.
But this does not solve the recursive sending message until the door is closed.
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: blockly script, but the time option does not work ?
he Guy's
firt tnx for the time to think this over, is this what you mean ?. it seem to me a bit overdone ?, but oke iám een noob in Blockly
-A
firt tnx for the time to think this over, is this what you mean ?. it seem to me a bit overdone ?, but oke iám een noob in Blockly
-A
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: blockly script, but the time option does not work ?
I have never successfully nested "If" blocks. I don't think that will work. Try re-writing as per @Denny64 above using a single "If - Else If".
Have a look at some blockly examples on the forum. You will see how to structure the blocks. Although it has its limitations I have around 40 blockly scripts running successfully for years now. You will soon get the hang of it.
Have a look at some blockly examples on the forum. You will see how to structure the blocks. Although it has its limitations I have around 40 blockly scripts running successfully for years now. You will soon get the hang of it.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: blockly script, but the time option does not work ?
Hi "stan",StanHD wrote: ↑Saturday 16 June 2018 13:02 I have never successfully nested "If" blocks. I don't think that will work. Try re-writing as per @Denny64 above using a single "If - Else If".
Have a look at some blockly examples on the forum. You will see how to structure the blocks. Although it has its limitations I have around 40 blockly scripts running successfully for years now. You will soon get the hang of it.
this blockly script is working, maybe you or other got some tips or changes ?
-A
- Denny64
- Posts: 53
- Joined: Friday 03 February 2017 11:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.1
- Location: Italy
- Contact:
Re: blockly script, but the time option does not work ?
This is the right blockly to avoid recursive message:
Don't forget to create a user variable called "Door".
Don't forget to create a user variable called "Door".
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: blockly script, but the time option does not work ?
i really dont understand it anymore,
i made: so i tested it yesterday, change the first time to 17:30 open the door and yes i get a push message and e-mail .
so i change the time back to 22:30 and open the door again, yes no message so the time is working, so far so fine .....
at 22:30 i open the door YES again a message zo the time settings are really working (so I thought) ... next morning on 07:00 i open the door.
and again a push message and a email. I thought ok so thats working.... but today on 12:00 a clock my girlfriend get home opens the door.
and i get a message huh ?..... why thats not posible ...
so i really dont know it anymore, i made about 10 differents blockly setups and everytime as I thought yes thats the right one its not.
what i'am doing wrong ?.
i made: so i tested it yesterday, change the first time to 17:30 open the door and yes i get a push message and e-mail .
so i change the time back to 22:30 and open the door again, yes no message so the time is working, so far so fine .....
at 22:30 i open the door YES again a message zo the time settings are really working (so I thought) ... next morning on 07:00 i open the door.
and again a push message and a email. I thought ok so thats working.... but today on 12:00 a clock my girlfriend get home opens the door.
and i get a message huh ?..... why thats not posible ...
so i really dont know it anymore, i made about 10 differents blockly setups and everytime as I thought yes thats the right one its not.
what i'am doing wrong ?.
-
- Posts: 46
- Joined: Friday 12 February 2016 20:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.4834
- Contact:
Re: blockly script, but the time option does not work ?
Hi TheCub3,
your blockly is wrong.
use < instead of >
Kind regards
Cobra045
your blockly is wrong.
use < instead of >
Kind regards
Cobra045
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: blockly script, but the time option does not work ?
hi all,
Just dit a test, but still the same issue Blockly is now: and i opened the door at 19:17 and i got a push message and a e-mail, i dont know why but i cant get the time settings working.
what i'am i doing wrong, i dont know it anymore.
-A
Re: blockly script, but the time option does not work ?
Try simplifying your blockly. The “if else/if” block without an else/if usualy doesn’t work. And the second “and” won’t work, because time cannot be “> 22:30 AND < 08:00”. Create a blockly for the first period (>22:30 and <23:59), then create a second blockly for the second period (>00:00 and <08:00).
-
- Posts: 30
- Joined: Saturday 24 February 2018 18:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: blockly script, but the time option does not work ?
tnx i wil try that, i just made and this works indeed, i wil made a second one voor the night tnx i wil let you know if this worksmrf68 wrote: ↑Wednesday 20 June 2018 19:35 Try simplifying your blockly. The “if else/if” block without an else/if usualy doesn’t work. And the second “and” won’t work, because time cannot be “> 22:30 AND < 08:00”. Create a blockly for the first period (>22:30 and <23:59), then create a second blockly for the second period (>00:00 and <08:00).
Who is online
Users browsing this forum: No registered users and 1 guest