• 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
rule with suneset and datetime gets an error
#1
Hallo,
I tried to use one of the example
Code:
"untergang": {
        "rule": "IF (sunriseset.sunset == DATE_FORMAT(DATE_ADD(datetime, +1 HOUR), \"%Y-%m-%d %H:%M:%S\", %H.%M)) THEN switch DEVICE Lamp2 TO on",
        "active": 1
    },
but i got an error telling me a format "%Y-%m-%d %H:%M:%S" is needed.
I don't find the coding error.

The example for datetime in the wiki uses still ntpserver and misses parm dst. How may I corrected that?

Thanks in advance
Raspberry B+  
Low-pass filter, Receiver RXB6, Sender I-XI
Version 7.0.178 (nightly version), Android App 6.0.4
 
Reply
#2
You are using "datetime" in the DATE_ADD function. You should use a datetime device here, which must not be named datetime. Device names cannot be the same as protocol names.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  ERROR: failed to read config. stack: 2 Stefan 6 385 02-03-2020, 09:37 PM
Last Post: curlymo
  Raspberry 4B installation error royw 3 469 12-05-2019, 10:58 AM
Last Post: royw
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 3 669 11-29-2019, 09:56 PM
Last Post: curlymo
  "FOR '2 MINUTE' FROM off" resulting in error hansrijn2 5 491 11-15-2019, 02:04 PM
Last Post: hansrijn2
  433gpio platform error after raspbian dist upgrade HuberDe 2 613 10-12-2019, 07:35 PM
Last Post: HuberDe
  GPIO input -> starting a rule scootermacro 1 445 06-09-2019, 07:40 AM
Last Post: curlymo
  error pilightsend, recieve and control hansipi 2 675 11-04-2018, 03:46 PM
Last Post: hansipi
  Set color of label from rule Ulrich.Arnold 2 793 03-11-2018, 01:15 PM
Last Post: Ulrich.Arnold
  Error with loading LPF firmware Rschnauzer 14 7,958 02-10-2018, 04:21 PM
Last Post: Rschnauzer
  generic_dimmer error / or not visible in 8.0.5 terrar 13 2,212 01-16-2018, 10:04 PM
Last Post: terrar

Forum Jump:


Browsing: 1 Guest(s)