• 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
How do you compare A generic_label value?
#1
Can you compare A Generic_label string value containing spaces? If so, how?

This code is not working:

Code:
IF WoonkamerVerlichting.state == on AND WoonkamerLichtScene.label == Tv kijken THEN
 
Reply
#2
Using quotes.
 
Reply
#3
Thanks, that was it using quotes like this:

Code:
IF WoonkamerVerlichting.state == on AND WoonkamerLichtScene.label == 'Tv kijken'

Please add it to the manual Smile
 
Reply
#4
Feel free. The manual is open source on github Smile

It is decribed in the manual, but maybe not super clear. So you can also give me some suggestions for improvement:
https://manual.pilight.org/eventing/syntax.html
 
Reply
#5
A related question, is it possible to set a label value combining three strings?

Like

Code:
label DEVICE tempLabel TO 'Voordeur geopend om ' . DATE_FORMAT(currentdatetime, %c) . ' en dan nog wat text'

Or using the value of A generic label setting A different generic label like 

Code:
label DEVICE tempLabel TO 'Voordeur geopend om ' . DATE_FORMAT(currentdatetime, %c) . differentlabel.label
 
Reply
#6
What happened when you tried? Smile
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)