Blockly Help: When are blocks executed and help with scenario
Posted: Monday 11 March 2019 16:50
Hey there,
I'm new to the forum and have spent some fair amount of time trying to configure (multiple) blockly events,
some for test, some for real scenario's but i fail to see why certain things don't work as expected.
I've created 2 test Blockly's to test some of the inner workings,
SetDayVar: to set a uservariable to a certain value based on what day it is. (to simplify another blockly lateron)
Only executed once a day on certain time, to prevent repetition.
GetDayVar: to see if i can use the uservariable in if statements to make it work.
Included the log from the test time frame.
On 09:18:00 GetDayVar executes with only 1 log: 2 (The output the variable itself, rule1)
On 09:18:06 i Manual change the UserVar to 1, 3 entries in the log (Rule2,4&5), But i'm Missing the first one, rule1
On 09:19:00 a normal run occurs and just prints 1 thing, 1 from rule1 (why doesn't it print rule2,4&5 like above??)
On 09:24:09 i made a change to SetDayVar to trigger at a certain time, to change the value to 2 by the system again
On 09:25:00 both rules1 from GetDayVar and SetDayVar are executed (but not the remaining 5 from GetDayVar)
2 next events i manually change the UserVariable to 3 and to 2, witch tiggers the rules3,4,5,&6 BUT not rule1!
How does this work in Blockly, because it looks like i cant GET the value of an UserVariable after it has been set,
it seems that you are unable to work with later on..
Maybe this is again some limitation of Blockly, but this limits in the thing i want to accomplish with a little more complicated blockly light setting.
That brings me to problem2, or how to accomplish the next thing (Example: DailyOn)
On Some days i want lights to turn with SunSet but not before 18:00 (because i wont be home then..)
On the other days i want the lights to turn on with SunSet,
And in the end Turn all the lights off when its a certain time.
i Noticed (in testing) that >= SunSet and >= SunRise is always true, so this wont work correct .. ever.
Using = SunSet you only have 1 time a day the event triggers, but during the winter SunSet is as early as 16:30 but i wont be home until after 18:00,
so i dont need my lights to be on during that Period of time. In my scenario i think i need to use the AND statement for this one.
On the other note, i maybe want some lightning in the Summer even before SunSet and there i guess i can use if=Sunset OR time>21:30.
Long story, but anyone with some hints or clues?
Thnx in advance.
Edit 16:53: I don't have actual hardware at this moment, I’m currently using dummy's to test certain scenarios before i buy some stuff that won't work as i suspected it should work.
I'm new to the forum and have spent some fair amount of time trying to configure (multiple) blockly events,
some for test, some for real scenario's but i fail to see why certain things don't work as expected.
I've created 2 test Blockly's to test some of the inner workings,
SetDayVar: to set a uservariable to a certain value based on what day it is. (to simplify another blockly lateron)
Only executed once a day on certain time, to prevent repetition.
GetDayVar: to see if i can use the uservariable in if statements to make it work.
Included the log from the test time frame.
- Spoiler: show
On 09:18:00 GetDayVar executes with only 1 log: 2 (The output the variable itself, rule1)
On 09:18:06 i Manual change the UserVar to 1, 3 entries in the log (Rule2,4&5), But i'm Missing the first one, rule1
On 09:19:00 a normal run occurs and just prints 1 thing, 1 from rule1 (why doesn't it print rule2,4&5 like above??)
On 09:24:09 i made a change to SetDayVar to trigger at a certain time, to change the value to 2 by the system again
On 09:25:00 both rules1 from GetDayVar and SetDayVar are executed (but not the remaining 5 from GetDayVar)
2 next events i manually change the UserVariable to 3 and to 2, witch tiggers the rules3,4,5,&6 BUT not rule1!
How does this work in Blockly, because it looks like i cant GET the value of an UserVariable after it has been set,
it seems that you are unable to work with later on..
Maybe this is again some limitation of Blockly, but this limits in the thing i want to accomplish with a little more complicated blockly light setting.
That brings me to problem2, or how to accomplish the next thing (Example: DailyOn)
On Some days i want lights to turn with SunSet but not before 18:00 (because i wont be home then..)
On the other days i want the lights to turn on with SunSet,
And in the end Turn all the lights off when its a certain time.
i Noticed (in testing) that >= SunSet and >= SunRise is always true, so this wont work correct .. ever.
Using = SunSet you only have 1 time a day the event triggers, but during the winter SunSet is as early as 16:30 but i wont be home until after 18:00,
so i dont need my lights to be on during that Period of time. In my scenario i think i need to use the AND statement for this one.
On the other note, i maybe want some lightning in the Summer even before SunSet and there i guess i can use if=Sunset OR time>21:30.
Long story, but anyone with some hints or clues?
Thnx in advance.
Edit 16:53: I don't have actual hardware at this moment, I’m currently using dummy's to test certain scenarios before i buy some stuff that won't work as i suspected it should work.