blocky script not working

Moderator: leecollings

Post Reply
rajbadri
Posts: 4
Joined: Friday 04 September 2015 5:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: India
Contact:

blocky script not working

Post by rajbadri »

Screen Shot 2016-07-03 at 1.48.17 AM.png
Screen Shot 2016-07-03 at 1.48.17 AM.png (34.29 KiB) Viewed 1743 times
need help


Thanks
trixwood

Re: blocky script not working

Post by trixwood »

But, what is not working?

need info

Thanks
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: blocky script not working

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
trixwood

Re: blocky script not working

Post 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...
Last edited by trixwood on Sunday 03 July 2016 1:24, edited 2 times in total.
migwelly
Posts: 18
Joined: Friday 03 July 2015 22:55
Target OS: -
Domoticz version:
Contact:

Re: blocky script not working

Post 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
trixwood

Re: blocky script not working

Post 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!
rajbadri
Posts: 4
Joined: Friday 04 September 2015 5:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: India
Contact:

Re: blocky script not working

Post by rajbadri »

Thanks :D
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests