What do i wrong with this rule

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

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

#1 Post by ManS-H » 22 Mar 2021, 19:34

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

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 » 22 Mar 2021, 20:03

ManS-H wrote: 22 Mar 2021, 19:34 What do i wrong?
You could have placed this in the ESPEasy part of the forum :lol:
ManS-H wrote: 22 Mar 2021, 19:34 This is not working:
On PIR#Motion do // Motion detected:
if %systime% > %Sunset% // After 18:48 Sunset
ESPEasy currently has a limitation that while parsing the IF line, it will only replace 1 % variable at a time, so the %sunrise%/%sunset% values are not inserted where you would expect them.
/Ton (PayPal.me)

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

Re: What do i wrong with this rule

#3 Post by ManS-H » 23 Mar 2021, 10:13

I made a new request in the correct forum. :D
Ath wrote: 22 Mar 2021, 20:03
ManS-H wrote: 22 Mar 2021, 19:34 What do i wrong?
You could have placed this in the ESPEasy part of the forum :lol:
ManS-H wrote: 22 Mar 2021, 19:34 This is not working:
On PIR#Motion do // Motion detected:
if %systime% > %Sunset% // After 18:48 Sunset
ESPEasy currently has a limitation that while parsing the IF line, it will only replace 1 % variable at a time, so the %sunrise%/%sunset% values are not inserted where you would expect them.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests