• 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
[Solved] On and Off for one device in one rule
#1
Hello everyone

I have a problem with the configuration of a role.
I want to turn on a device in a role and turn it off after a while in the same rule. Turning it on works, but does not turn off unfortunately. I have created three different rules (see examples). pilight runs with all examples. But all three examples do not turn off the device.

Code:
example 1
        "Wasserzirkulation": {
            "rule": "IF Zeit.second == 00 AND Zeit.minute == 15 AND (Zeit.hour == 07 OR Zeit.hour == 13) THEN switch DEVICE coac344 TO on FOR 15 . ' MINUTE'",
            "active": 1
        },

example 2
        "Wasserzirkulation": {
            "rule": "IF Zeit.second == 00 AND Zeit.minute == 15 AND (Zeit.hour == 07 OR Zeit.hour == 13) THEN switch DEVICE coac344 TO on AND switch DEVICE coac344 TO off AFTER '15 Minute'",
            "active": 1
        },

example 3
        "Wasserzirkulation": {
            "rule": "IF Zeit.second == 00 AND Zeit.minute == 15 AND (Zeit.hour == 07 OR Zeit.hour == 13) THEN switch DEVICE coac344 TO on AND switch DEVICE coac344 TO off AFTER 15 . ' Minute'",
            "active": 1
        },
Thanks for help.
Oliver
 
Reply
#2
Have you tried:
Code:
switch DEVICE coac344 TO on FROM off  FOR '15 MINUTE'
 
Reply
#3
(10-17-2019, 06:09 PM)curlymo Wrote: Have you tried:
Code:
switch DEVICE coac344 TO on FROM off  FOR '15 MINUTE'

No. I will test it.
Thanks
 
Reply
#4
(10-17-2019, 06:09 PM)curlymo Wrote: Have you tried:
Code:
switch DEVICE coac344 TO on FROM off  FOR '15 MINUTE'

Unfortunately, the code does not work either. The device coac344 will not turn on.
But I found the thread "pilight/Eventing/Problem switching device off after 20 minutes". Terrar writes: "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 MINUTES "
I adjusted the back part for me.
"... AND coac344.state IS off THEN switch DEVICE coac344 TO on FOR '15 MINUTE'".
This works since 4 days.

Thank you for your time.
And thank you Terrar.

Oliver
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Exclude Weekend from a rule PT-Biker 1 38 12-08-2019, 10:22 AM
Last Post: curlymo
  Rule triggers twice Thorben653 12 174 12-05-2019, 12:53 PM
Last Post: Thorben653
  [solved] sunset rule doesn't work fleisch 4 296 10-26-2019, 07:05 AM
Last Post: fleisch
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 951 07-31-2018, 06:25 AM
Last Post: curlymo
  Rule with&without device. One working not the other... Tamadite 9 1,148 07-24-2018, 08:55 AM
Last Post: curlymo
  rule executed once at start up segalion 3 640 07-12-2018, 05:28 PM
Last Post: curlymo
  Problem with executing bash script via rule/program dYna 1 938 02-15-2018, 09:06 PM
Last Post: dYna
  Rule Sunset works, Sunrise not apartmedia 1 1,112 12-05-2017, 07:09 PM
Last Post: apartmedia
  Always trigger event on any device state Phil 8 2,190 03-22-2017, 07:30 PM
Last Post: Phil
  Problem with a Rule for a One Button Switch martin-dj 1 1,268 03-06-2017, 12:01 PM
Last Post: pilino1234

Forum Jump:


Browsing: 1 Guest(s)