• 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
  433gpio platform error after raspbian dist upgrade HuberDe 2 34 10-12-2019, 07:35 PM
Last Post: HuberDe
  GPIO input -> starting a rule scootermacro 1 196 06-09-2019, 07:40 AM
Last Post: curlymo
  error pilightsend, recieve and control hansipi 2 451 11-04-2018, 03:46 PM
Last Post: hansipi
  Set color of label from rule Ulrich.Arnold 2 534 03-11-2018, 01:15 PM
Last Post: Ulrich.Arnold
  Error with loading LPF firmware Rschnauzer 14 6,949 02-10-2018, 04:21 PM
Last Post: Rschnauzer
  generic_dimmer error / or not visible in 8.0.5 terrar 13 1,548 01-16-2018, 10:04 PM
Last Post: terrar
  pilight does no longer start because of hardware error stratege-0815 2 1,003 12-27-2017, 11:16 PM
Last Post: stratege-0815
  ERROR: uv_custom_poll_cb: bad file descriptor Gisto 6 1,523 12-19-2017, 03:03 PM
Last Post: Gisto
  [Solved] Error manual compiling Thuurke 2 1,184 09-02-2017, 05:06 PM
Last Post: Thuurke
  rule fails with ping state pinu 1 935 06-09-2017, 10:14 AM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)