What do i wrong with this rule [Solved]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

What do i wrong with this rule [Solved]

#1 Post by ManS-H » 23 Mar 2021, 10:11

New request, now in the correct forum. :D

What do i wrong?
This rule is working:
On PIR#Motion do // Motion detected:
if %systime% > 18:48 // After 18:48 Sunset
gpio,12,1 // Lamp on
timerSet 1,60 // start timer
endif

if %systime% < 6:30 // Before 6:30 Sunrise
gpio,12,1 // Lamp on
timerSet 1,60 // start timer//
endif
endOn

On Rules#Timer=1 do
gpio,12,0 // Lamp off
endOn

This is not working:
On PIR#Motion do // Motion detected:
if %systime% > %Sunset% // After 18:48 Sunset
gpio,12,1 // Lamp on
timerSet 1,60 // start timer
endif

if %systime% < %Sunrise% // Before 6:30 Sunrise
gpio,12,1 // Lamp on
timerSet 1,60 // start timer//
endif
endOn

On Rules#Timer=1 do
gpio,12,0 // Lamp off
endOn
Last edited by ManS-H on 23 Mar 2021, 20:13, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: What do i wrong with this rule

#2 Post by Ath » 23 Mar 2021, 11:13

Answer is the same :)
See: viewtopic.php?f=23&t=8432#p51421
And similar issue: viewtopic.php?f=6&t=5415
/Ton (PayPal.me)

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: What do i wrong with this rule

#3 Post by iron » 23 Mar 2021, 13:17

This works for me :

Code: Select all

  if %systime% > %sunset% or %systime% < %sunrise%
       LongPulse,4,1,%eventvalue1%
  endif
-D

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

What do i wrong with this rule [Solved]

#4 Post by ManS-H » 23 Mar 2021, 19:44

iron wrote: 23 Mar 2021, 13:17 This works for me :

Code: Select all

  if %systime% > %sunset% or %systime% < %sunrise%
       LongPulse,4,1,%eventvalue1%
  endif
Thanks, it works also for me so the problem is solved.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests