Page 1 of 1
blocky script not working
Posted: Saturday 02 July 2016 22:27
by rajbadri
- Screen Shot 2016-07-03 at 1.48.17 AM.png (34.29 KiB) Viewed 1746 times
need help
Thanks
Re: blocky script not working
Posted: Saturday 02 July 2016 22:55
by trixwood
But, what is not working?
need info
Thanks
Re: blocky script not working
Posted: Saturday 02 July 2016 22:59
by jvdz
There is a logic error: Time can never be bigger than SunSet AND at the same time smaller than SunRise! This is impossible.
Jos
Re: blocky script not working
Posted: Sunday 03 July 2016 0:34
by trixwood
So it should be "or" instead of "and"
making
door sensor = open and (Time > Sunset or Time < Sunrise)
btw on a sidenote when using the abstractions time and sunset, from a logic point of view it is totally correct to use "AND". Time does not reset at 00:00 (this is not groundhog day) just like 1+99 does not reset to 00 but result in 100, and in case of time representation the 1 in 100 is a brand new day!
That the abstraction translation and representation to actual numbers (like sunset to 06:34 AM, time to 03:22 AM stripping the day carrier) make things difficult and the ambiguous of how time is defined more so if you are not a programmer: does time include days, months and years or time for just one day. There in lies the problem.
Logically speaking: Sun is Down = Time < Sunrise and Time > Sunset
But yeah then time, it's all bout the forgotten days...
Time, abstractions and logic, all funny stuff...
Re: blocky script not working
Posted: Sunday 03 July 2016 0:36
by migwelly
Try to make you're blocky script like this :
If time is > then sunset and doorsensor = open
Set staircase lights = on for 1 minute
Else if
If time is > then sunrise and doorsensor = open
Set staircase lights = off
Verstuurd vanaf mijn SM-G935F met Tapatalk
Re: blocky script not working
Posted: Sunday 03 July 2016 1:13
by trixwood
That only make more code... and it will not work in the morning :-/
changing and to or is enough...
Just use:
if door sensor = open and (Time > Sunset or Time < Sunrise)
do set etc...
So you can enjoy your light for a minute when the sun is down and the door opens!
Re: blocky script not working
Posted: Sunday 03 July 2016 6:25
by rajbadri
Thanks