[SOLVED] Error rule unknown variable or command '&&'

I have an error in this rule "Unknown variable or command ‘&&’ in line 8, column 7, length 33. Some help?

var Number st_state = 1

rule "open_store_salon"
	when
		Item Lux_01 received update
	then
		var Number Lux_avg = Lux_01.averageSince(now.minusMinutes(5))
		if ((st_state = 0) && (Lux_avg > 350) && (Lux_avg < 450)) {
			st_state = 1
			sendTelegram("abc", "open")
					
		}
		else if ((st_state = 1) && (Lux_avg < 50)) {
			st_state = 0
			sendTelegram("abc", "close")
		}
end

if ( X == Y )
not
if ( X = Y )

note the double equals operator

You have to use == for equation

if ((st_state == 0) && (Lux_avg > 350) && (Lux_avg < 450))
               ^
...
if ((st_state == 1) && (Lux_avg < 50))
               ^

Maybe this is useful:
http://www.eclipse.org/xtend/documentation/203_xtend_expressions.html#operators

Thank so much. :sweat_smile: