• 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
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?

[Dec 17 12:25:29:462237] pilight-daemon: ERROR: rule #62 invalid: variable "label" of device "duskdawnlabel" cannot be used in event rules
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.
OK, thanks. I understand.
Fortunately pilight provides more ways to achieve what I want Smile
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
Yes, for a while now. Should work in development also.

Possibly Related Threads...
Thread Author Replies Views Last Post
  [8.1.2] variables in rules -> error terrar 1 793 09-14-2018, 05:28 PM
Last Post: curlymo
  Rules wont work bdb 2 1,124 08-12-2018, 06:25 PM
Last Post: bdb
  Can't switch Relay device by rules: Error switch.lua:77 wobbi 6 1,567 07-31-2018, 06:25 AM
Last Post: curlymo
  Strange behavior of rules currock 4 1,355 06-28-2018, 05:57 PM
Last Post: currock
  feature request: switching rules terrar 7 1,903 05-05-2018, 09:23 PM
Last Post: trader23
  invalid: trying to compare string variable "arctech_switch.unit" to an integer diman87 5 3,125 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 5,331 12-22-2016, 09:49 AM
Last Post: wo_rasp
  using generic_switch as variable / presence detection by "ping" winterfluss 3 2,037 12-11-2016, 10:43 AM
Last Post: Niek
  option "all" not sent in rules muecke 5 2,513 07-01-2016, 11:37 AM
Last Post: Niek
  Rules make pilight freeze koos147 5 2,606 05-04-2016, 08:11 PM
Last Post: curlymo

Forum Jump:

Browsing: 1 Guest(s)