• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem switching device off after 20 minutes
#1
hey guys, I have a problem with a rule. I want to switch on a device when it is 12, 16 and 20 o'clock. Then the Device should switch off after 20 minutes.

This is my rule:

PHP Code:
IF ((datetime.hour == 12 OR datetime.hour == 16 OR datetime.hour == 20) AND datetime.minute == 0THEN switch DEVICE intertechno3 TO on FOR 20 MINUTE

The problem is, that the device switches on but not off.

Can you help me?


Thanks
 
Reply
#2
What does the log say. Also, include the seconds check or else it will trigger for 60 seconds.
 
Reply
#3
Try this please:
Code:
"IF (datetime.hour == 12 OR datetime.hour == 16 OR datetime.hour == 20) AND datetime.minute == 0 AND datetime.second == 0 AND intertechno3.state IS off THEN switch DEVICE intertechno3 TO on FOR 20 MINUTE"
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#4
Thank you very much.

Everything works great now!
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] On and Off for one device in one rule Oliver 3 449 10-28-2019, 06:55 PM
Last Post: Oliver
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,103 07-31-2018, 06:25 AM
Last Post: curlymo
  Rule with&without device. One working not the other... Tamadite 9 1,398 07-24-2018, 08:55 AM
Last Post: curlymo
  Problem FOR Alex 5 1,143 05-18-2018, 01:21 PM
Last Post: curlymo
  feature request: switching rules terrar 7 1,478 05-05-2018, 09:23 PM
Last Post: trader23
  Problem with executing bash script via rule/program dYna 1 1,041 02-15-2018, 09:06 PM
Last Post: dYna
  Always trigger event on any device state Phil 8 2,425 03-22-2017, 07:30 PM
Last Post: Phil
  Problem with a Rule for a One Button Switch martin-dj 1 1,348 03-06-2017, 12:01 PM
Last Post: pilino1234
  Sunriseset problem switches on at 0:00 kgulti 13 4,190 12-26-2016, 08:08 PM
Last Post: PekkaLahtela
  [Solved ]Turn off device at random time manmetdehamer 4 2,212 07-27-2016, 03:35 PM
Last Post: manmetdehamer

Forum Jump:


Browsing: 1 Guest(s)