• 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
pilight 8.1 and switch with date and time not working
#1
Hi,

actually I'm trying to switch a plug with date and time.
I've copied the rule from the pilight manual:

https://manual.pilight.org/eventing/examples/time.html

So my rules look like:

Code:
"rules": {
                "Stehlampe-Treppe": {
                        "rule": "IF DATE_FORMAT(currentdatetime, %H.%M%S) == 16.0000 THEN switch DEVICE stecker5 TO on AFTER RANDOM(0, 90) . ' MINUTE' FOR RANDOM(5, 15) . ' MINUTE'",
                        "active": 1
                                    }
        },

But when I try to start pilght, I get this error:

Code:
Job for pilight.service failed.

So what is wrong with the manual?
Or is it really my code?
I only changed the start time and the device.

Need help please!

Thanks a lot!
 
Reply
#2
Also read the other manual pages:
https://manual.pilight.org/faq.html#pili...tely-exits
 
Reply
#3
Sorry, I don't understand what you mean.
Without my rules everything is working.

But when I use the rules, posted in the manual, pilight doesn't start up.

That is the problem.

Now a made a debug ;-)

Following error:

Code:
[Jun 30 15:25:22:859186] pilight-daemon: ERROR:
... %H.%M%S) == 16.0000 THEN switch DEVICE stecker5 TO on AFTER RANDOM(0, 90) ...
                        ^ unexpected symbol, expected a condition
[Jun 30 15:25:22:859855] pilight-daemon: INFO: rule #1 Stehlampe-Treppe was parsed in 0.002598 seconds
 
Reply
#4
(06-30-2018, 04:10 PM)Pikeman Wrote: Sorry, I don't understand what you mean.
Without my rules everything is working.

But when I use the rules, posted in the manual, pilight doesn't start up.

That is the problem.

Now a made a debug ;-)

Following error:

Code:
[Jun 30 15:25:22:859186] pilight-daemon: ERROR:
... %H.%M%S) == 16.0000 THEN switch DEVICE stecker5 TO on AFTER RANDOM(0, 90) ...
                        ^ unexpected symbol, expected a condition
[Jun 30 15:25:22:859855] pilight-daemon: INFO: rule #1 Stehlampe-Treppe was parsed in 0.002598 seconds

The current Version does not accept the dot in a Nummer. Try formating without the dot and  compare to 160000

Uli
 
Reply
#5
That's correct!
Without the point it is working.

But the error is listed in the manual.
That is very bad!!

One other question please:

How should the rule look like for switch on at 16:00 and switch off at 01:00.
Can I make this with one rule?
At the moment I have two rules for this.

Thanks for an example.
 
Reply
#6
The manual is open source, feel free to fix it. Everybody can make mistakes. Even i do.
 
Reply
#7
This is not against you!!
Of course nobody is perfect!

But I can't fix something in the manual.
Sorry.
 
Reply
#8
Maybe not calling it "very bad" would make the message nicer Wink
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Starting pilight on boot: "cannot bind to the SSDP multicast network" pilino1234 3 143 08-31-2019, 10:41 PM
Last Post: curlymo
Tongue pilight 8.1.5-1-gc0a175e0 Chrashes fleisch 4 321 08-17-2019, 01:04 PM
Last Post: curlymo
  pilight for Raspbian Buster (raspberry pi 4) ? starob 29 1,967 07-15-2019, 08:45 PM
Last Post: curlymo
  pilight-receive Filteroption not working Alex 2 449 07-14-2019, 08:35 AM
Last Post: Alex
  pilight usb nano format conversion ettman8 2 330 07-14-2019, 08:32 AM
Last Post: curlymo
  pilight 8.1.4 crashes after some hours Ulrich.Arnold 47 2,299 06-29-2019, 08:58 PM
Last Post: curlymo
  Raspberry PI, gpio-ir-tx and pilight not starting lordslash 5 693 06-11-2019, 05:19 PM
Last Post: curlymo
  pilight fails starting on boot Alex 5 606 06-09-2019, 06:02 PM
Last Post: curlymo
  Google Assistant coupled to pilight hansrijn2 4 1,071 05-29-2019, 06:54 PM
Last Post: curlymo
  pilight-send does not stop (terminate) va13 3 587 05-15-2019, 06:06 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)