need help
Thanks
blocky script not working
Moderator: leecollings
- jvdz
- Posts: 2441
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: blocky script not working
There is a logic error: Time can never be bigger than SunSet AND at the same time smaller than SunRise! This is impossible.
Jos
Jos
-
trixwood
Re: blocky script not working
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...
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...
Last edited by trixwood on Sunday 03 July 2016 1:24, edited 2 times in total.
Re: blocky script not working
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
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
-
trixwood
Re: blocky script not working
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!
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!
Who is online
Users browsing this forum: No registered users and 1 guest