• 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
variable "label" not allowed in rules
#1
I tried to use the label option of one of my label devices in a rule. It gives me the error shown below. One can use the color option of label devices in rules without problems. Looking at the generic_label protocol, I realized that the difference between color and label is that color can only be a string and label can be both string and number.

I had a quick look at events.c to see where the error is reported and I guess that a "match2=1" is missing somewhere, possibly in the elsif at line 373?

Code:
[Dec 17 12:25:29:462237] pilight-daemon: ERROR: rule #62 invalid: variable "label" of device "duskdawnlabel" cannot be used in event rules
 
Reply
#2
The problem is that i haven't found a solution for 'casting' yet, so until then i disallowed the usage of the label device in the rule logic.
 
Reply
#3
OK, thanks. I understand.
Fortunately pilight provides more ways to achieve what I want Smile
 
Reply
#4
@curlymo
Will this be possible in the rewrite now?
That would save me a lot of complex rules with the terrarium.
Currently, I use some generic switches instead
(Scenes: Morning, Day, Evening, Night)
Terrarium:  RPi Model B Rev 2 / pilight 8.1.2 / stretch
Aquarium: RPi Model B Plus Rev 1.2 / pilight 8.0.6 / jessie
 
Reply
#5
Yes, for a while now. Should work in development also.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  [8.1.2] variables in rules -> error terrar 1 548 09-14-2018, 05:28 PM
Last Post: curlymo
  Rules wont work bdb 2 877 08-12-2018, 06:25 PM
Last Post: bdb
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,070 07-31-2018, 06:25 AM
Last Post: curlymo
  Strange behavior of rules currock 4 1,012 06-28-2018, 05:57 PM
Last Post: currock
  feature request: switching rules terrar 7 1,443 05-05-2018, 09:23 PM
Last Post: trader23
  invalid: trying to compare string variable "arctech_switch.unit" to an integer diman87 5 2,699 12-19-2017, 11:04 PM
Last Post: diman87
  DATE_FORMAT → invalid: trying to compare string variable "21:30:00" to an integer PekkaLahtela 6 4,310 12-22-2016, 09:49 AM
Last Post: wo_rasp
  using generic_switch as variable / presence detection by "ping" winterfluss 3 1,712 12-11-2016, 10:43 AM
Last Post: Niek
  option "all" not sent in rules muecke 5 2,186 07-01-2016, 11:37 AM
Last Post: Niek
  Rules make pilight freeze koos147 5 2,169 05-04-2016, 08:11 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)