• 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 #1 invalid: trying to compare string variable "datetime.hour" to an integer
#1
Hi, first try with rules. I must be missing something but after trying for an hour or so I still haven't got a clue. It looks to me datetime.hour is not recognized as a pilight system variable.

Error log excerpt:
Dec 12 22:22:49:307533] pilight-daemon: ERROR: rule #1 invalid: trying to compare string variable "datetime.hour" to an integer
[Dec 12 22:22:49:308504] pilight-daemon: INFO: rule #1 was parsed until: ... datetime.hour > 23 THEN switch DEVICE kerstboom TO off
[Dec 12 22:22:49:308984] pilight-daemon: INFO: rule #1 kerstboom-off was parsed in 0.000417 seconds

Rules excerpt:
"kerstboom": {
"protocol": [ "kaku_switch_old" ],
"id": [{
"id": 1,
"unit": 2
}],
"state": "on"
},
.
.
.
.
"rules": {
"kerstboom-off": {
"rule": "IF datetime.hour > 23 THEN switch DEVICE kerstboom TO off",
"active": 1
}
},

Thanks for your help.

Cheers, Michel
 
Reply
#2
Please start by posting in the right forum and by using code tags.
 
Reply
#3
What is the right forum: "core rogram"? Other?

I'm a novice, I looked up what code tags are but should it enclose also the log messages?

Thx
 
Reply
#4
The event sub-forum.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  GPIO input -> starting a rule scootermacro 1 196 06-09-2019, 07:40 AM
Last Post: curlymo
  Set color of label from rule Ulrich.Arnold 2 536 03-11-2018, 01:15 PM
Last Post: Ulrich.Arnold
  bmp180 id invalid Andre42 2 1,179 07-14-2017, 10:32 AM
Last Post: Andre42
  rule fails with ping state pinu 1 935 06-09-2017, 10:14 AM
Last Post: Niek
  pilight rule does not execute pinu 1 881 06-09-2017, 10:01 AM
Last Post: Niek
  Problem with a Switch rule viper2035 2 1,307 01-12-2017, 04:33 PM
Last Post: viper2035
  variable in program koos147 2 1,194 05-01-2016, 06:41 PM
Last Post: koos147
  [solved] GUI time 1 hour behind the real time OrTiN 1 1,058 03-23-2016, 11:32 AM
Last Post: OrTiN
  Rule reset status hazzard 42 11,320 03-20-2016, 07:50 PM
Last Post: jowe2460
  rule with suneset and datetime gets an error Rschnauzer 1 1,051 02-02-2016, 04:36 PM
Last Post: Niek

Forum Jump:


Browsing: 1 Guest(s)