• 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 for Raspbian Buster (raspberry pi 4) ? starob 31 7,139 2 hours ago
Last Post: PPacman
  pilight switch node in node-red framp 0 228 06-24-2020, 10:01 PM
Last Post: framp
  pilight-control TML 13 890 05-27-2020, 07:51 AM
Last Post: curlymo
  API Requests by HTTP from other devices fore use in pilight scootermacro 2 397 05-10-2020, 08:19 AM
Last Post: scootermacro
  After upgrading 7.0 to 8.1.5 my flamingo SF-501P switches stopped working. gerrit312 23 2,061 04-30-2020, 02:58 PM
Last Post: ayeyebrazov
  tfa30 temperature-offset not working wseifert 2 701 04-09-2020, 02:46 PM
Last Post: curlymo
  pilight-send seems successful but doesn't actually send RF signal ayeyebrazov 37 3,073 03-31-2020, 01:02 PM
Last Post: curlymo
  pilight 8.1.5 not working on Raspberry pi after reboot beejayf 4 839 03-08-2020, 12:14 AM
Last Post: beejayf
  Trigger a configured switch from other computer by CLI beejayf 3 335 02-24-2020, 07:17 PM
Last Post: beejayf
  pilight cpu usage possibly associated with noticeable sluggishness? hepcat72 4 892 01-28-2020, 08:02 PM
Last Post: hepcat72

Forum Jump:


Browsing: 1 Guest(s)