• 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
  pilight cpu usage possibly associated with noticeable sluggishness? hepcat72 1 8 1 hour ago
Last Post: curlymo
  apt.pilight.org stable Release' is not signed. thomasol 2 164 01-23-2020, 11:34 PM
Last Post: thomasol
  pilight and SIGNALduino cc1101 Caleus 0 91 01-19-2020, 09:13 AM
Last Post: Caleus
  After upgrading 7.0 to 8.1.5 my flamingo SF-501P switches stopped working. gerrit312 11 369 01-16-2020, 10:57 AM
Last Post: curlymo
  filter stopped working after update to pilight 8.1.5 zlin50 19 510 01-03-2020, 02:15 PM
Last Post: curlymo
Question [Solved] Openweathermap with pilight 7.0-40 doesn't work Seebueb 2 131 01-01-2020, 06:45 PM
Last Post: Seebueb
  8.1.5 quietly stops working hepcat72 4 211 12-23-2019, 03:24 PM
Last Post: hepcat72
  [Solved] Strange receive problem with 433Mhz Receiver and pilight 8.1.5 vanillaice30 15 655 12-18-2019, 11:09 AM
Last Post: vanillaice30
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 3 314 11-29-2019, 09:56 PM
Last Post: curlymo
  pilight crashing randomly PatiB 7 498 11-16-2019, 10:50 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)