Rule "state.toString.contains not"


(Hartmut Schwensen) #1

Hi,
Can anybody help me please with my formula before my wife gets mad:

rule "Yeelight Timer"
when
	Item zwave_device_af1cbe4f_node10_sensor_binary changed 
	
then
	if
(
	(zwave_device_af1cbe4f_node10_sensor_binary.state == ON) 
	&& (dark.state == ON) ||
	weatherunderground_weather_local_current_conditions.state.toString.contains = ("Gewitter") ||
	weatherunderground_weather_local_current_conditions.state.toString.contains = ("Bedeckt")
)
		{ do something ...

I have a virtual dark switch that is triggered based on the sun elevation. Nevertheless the lights should also be switched on when it is dark during the daytime. As there are a lot different stages for the conditions I struggle to find a solution that is “not sunny”. Mainly because I did not find a solution for “state.toString.contains not”.

I really appreciate your support and look forward to make it better.

Regards,
Hartmut


(Vincent Regaud) #2
rule "Yeelight Timer"
when
	Item zwave_device_af1cbe4f_node10_sensor_binary changed 
	
then
	if
(
	(zwave_device_af1cbe4f_node10_sensor_binary.state == ON) 
	&& (dark.state == ON) ||
	weatherunderground_weather_local_current_conditions.state.toString.contains("Gewitter") ||
	weatherunderground_weather_local_current_conditions.state.toString.contains("Bedeckt")
)
		{ do something ...

(Hartmut Schwensen) #3

Thanks - looks like that it works. Is there any solution for “contains not” in order not to add multiple values?


(Vincent Regaud) #4