Problem getting rules to work, need help

I have Temperature sensor that read temp in defferent place in my house.
they are connected on a WEMOS D1 Mini

Item is created and it’s a String. I use JSONPATH to strip the string and only catch the Temperature number to display in my OpenHab site map.

I’ve search alot to find a way to watch the TEMP and when it reach 25c I want to power up my A/C Unit.
for the IRSend I work manually so on that i’m ok.
the only problem that I have problem to get the rule to work.
here is my code:

rule “temp AC Auto”
Item Wifi_Sensor_3_Temp changed
if (Wifi_Sensor_3_TEMP.state.toString.contains (“25”)) {
val mqttActions = getActions(“mqtt”, “mqtt:broker:966221120f”)
mqttActions.publishMQTT(“cmnd/WiFi_Sensor_1/IRSend”, “{“Protocol”:“LG”,“Bits”:28,“Data”:“0x8800729”,“DataLSB”:“0x1001E094”,“Repeat”:0}”)

But even with many changes or try, I still get this error in openhab.log
2021-05-18 09:10:08.400 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘Default-4’ failed: The name ‘Wifi_Sensor_3_TEMP’ cannot be resolved to an item or type; line 85, column 5, length 18 in Default

Any suggestion or help ?

The error tells you that the item Wifi_Sensor_3_TEMP is not known. In the trigger you use the item name like Wifi_Sensor_3_Temp (note the lower case in Temp). Check your spellings in the rule.

You’ll probably find it easier to work with if you extract your temperature vale to a Number type Item to begin with.

1 Like

Man… hahaha… it was case sensitive!!!.. hahahaha … fix the TEMP to Temp and work flawless…
damn. sorry for this noob issue, at least all my code was good. now, when I reach 25c my IRSend power Up my A/C Unit.

thank you for the input, i feel stupid, the issue was just in front of me :slight_smile: