Page 1 of 1

Event on wrong time

Posted: Monday 24 June 2019 10:47
by dflandre
I have a problem with a blockly script. I send an order to open or close shutters at certain times. In my script, the opening is scheduled at 6:25 though the shutters are operated at 6:05!
For other movement commands, that's fine. I do not understand where the problem comes from. Can you help me ?
Sorry for en english, I use Google to translate.
David.

J'ai un soucis avec un script Blockly. J'envoie une commande d'ouverture ou de fermeture de volets à certaines heures. Dans mon script, l'ouverture est programmée à 6:25 pourtant les volets sont actionnée à 6:05 !
Pour les autre commandes de mouvements, c'est correct. je ne comprend pas d'où vient le soucis. Pouvez-vous m'aidez ?
David.

Re: Event on wrong time

Posted: Monday 24 June 2019 10:57
by waaren
dflandre wrote: Monday 24 June 2019 10:47 I have a problem with a blockly script. I send an order to open or close shutters at certain times. In my script, the opening is scheduled at 6:25 though the shutters are operated at 6:05!
I do not understand where the problem comes from. Can you help me ?
Did you check if no other timers / scripts could interfere with this ?

Re: Event on wrong time

Posted: Monday 24 June 2019 13:13
by dflandre
I've just checked it and I confirm there is nothing else.

Re: Event on wrong time

Posted: Monday 24 June 2019 13:33
by waaren
dflandre wrote: Monday 24 June 2019 13:13 I've just checked it and I confirm there is nothing else.
I cannot reproduce this on my test system. Could you add some log statements in the action areas so you will clearly see which of the if conditions triggered the action ?

Re: Event on wrong time

Posted: Monday 24 June 2019 14:39
by dflandre
I done it this way.
I'm waiting for the result.

Re: Event on wrong time

Posted: Tuesday 25 June 2019 8:28
by dflandre
Here is the continuation :
I changed the trigger time of the command in the script (6:25 -> 6:45).
The command is always activated at 6:05. In the log, we see that it comes from this script. The trace "Log volets 1" is found at 6:05.

Re: Event on wrong time

Posted: Tuesday 25 June 2019 10:38
by waaren
dflandre wrote: Tuesday 25 June 2019 8:28 Here is the continuation
Thx. I am going to set up some tests to analyze further. Can you please copy the exported Blockly and paste it here ? That will make it easier to simulate your setup.

Re: Event on wrong time

Posted: Tuesday 25 June 2019 10:58
by dflandre
waaren wrote: Tuesday 25 June 2019 10:38 Thx. I am going to set up some tests to analyze further. Can you please copy the exported Blockly and paste it here ? That will make it easier to simulate your setup.
Here the code.
Thx.

Re: Event on wrong time

Posted: Tuesday 25 June 2019 11:13
by waaren
dflandre wrote: Tuesday 25 June 2019 10:58 Here the code.
Thx.
Ok I setup the test environment and will report back as soon as I have some results.

Re: Event on wrong time

Posted: Wednesday 26 June 2019 8:22
by waaren
dflandre wrote: Monday 24 June 2019 10:47 I have a problem with a blockly script. I send an order to open or close shutters at certain times. In my script, the opening is scheduled at 6:25 though the shutters are operated at 6:05!
Found what is causing this !
The time condition in Blockly expects a time in the format of hh:mm and it turns out that Blockly is rather strict on this. So if you enter the times as 0:25 and 6:25 and the likes, the condition is evaluating to true at 0:05 and 6:05. If you enter the times with the leading zero, the if parts are evaluating to true at the expected times.
Logs from my Blockly tests below.

Code: Select all

2019-06-25 22:15:00.923  Status: Log volets 3.1 22:15
2019-06-25 22:16:01.193  Status: Log volets 3_2 22:16
2019-06-26 00:05:00.454  Status: Log volets_1.1 0:25
2019-06-26 00:26:08.131  Status: Log volets 1-2 00:26
2019-06-26 06:05:00.555  Status: Log volets 2.1 6:25
2019-06-26 06:26:00.417  Status: Log volets 2_2 06:26

Re: Event on wrong time

Posted: Thursday 27 June 2019 10:46
by dflandre
OK
Thank you for your help.
David.

Re: Event on wrong time

Posted: Monday 29 July 2019 8:21
by waaren
waaren wrote: Wednesday 26 June 2019 8:22
dflandre wrote: Monday 24 June 2019 10:47 I have a problem with a Blockly script. I send an order to open or close shutters at certain times. In my script, the opening is scheduled at 6:25 though the shutters are operated at 6:05!
The time condition in Blockly expects a time in the format of hh:mm and it turns out that Blockly is rather strict on this. So if you enter the times as 0:25 and 6:25 and the likes, the condition is evaluating to true at 0:05 and 6:05. If you enter the times with the leading zero, the if parts are evaluating to true at the expected times.
Solved in V4.11060 by @gizmocuz by patching www/app/events/blockly_xml_parser.js