i moved to openhab3 from 2.5 and upon starting i get this log for this only one rule :
[INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'alarm.rules', using it anyway:
This expression is not allowed in this context, since it doesn't cause any side effects.
never show that at openhab 2.5…this is my rule :
var Timer siren_timer = null
rule "intruder_alarm"
when
Item motion_sensors changed to ON
or
Item doors_windows_contacts changed to OPEN
then
if(Alarm_State.state==("Enabled")) {
Alarm.postUpdate("Enabled")
}
end
rule "Cleaning"
when
Item doors_windows_contacts changed from CLOSED to OPEN
then
if(Alarm_State.state==("Cleaning")) {
Alarm.postUpdate("Enabled")
}
end
rule "NGleak"
when
Item NGalarm changed to ON
then
Alarm_State.postUpdate("NGleak")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=toForeground&password=xxxxxxxxx")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=loadUrl&url=http://192.168.1.150:8080/habpanel/index.html%23/view/Alarm&password=xxxxxxxxxx")
gVolume.sendCommand(80)
say("Natural Gas leak detected please evacuate the house.")
Thread::sleep(5000)
gVolume.sendCommand(60)
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxI&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxxxx@gmail.com, xxxxxxxxx@yahoo.co.uk", "GAS LEAK!!!", "NATURAL GAS LEAK!")
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(7)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
All_Lights.sendCommand(ON)
end
rule "fire_alarm"
when
Item XiaomiMijiaHoneywellFireAlarmDetector_SmokeDetected changed to ON
then
Alarm_State.postUpdate("Fire")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=toForeground&password=xxxxxxxxxx")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=loadUrl&url=http://192.168.1.150:8080/habpanel/index.html%23/view/Alarm&password=xxxxxxxxx")
gVolume.sendCommand(80)
say("Fire,please evacuate the house with safety.")
Thread::sleep(5000)
gVolume.sendCommand(60)
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxxxxxxxx@gmail.com,xxxxxxxxxxxx@yahoo.co.uk", "FIRE!!!", "FIRE!FIRE!FIRE!")
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(7)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
All_Lights.sendCommand(ON)
end
rule "fire_warning"
when
Item XiaomiMijiaHoneywellFireAlarmDetector_ParticleDensity changed
then
if (XiaomiMijiaHoneywellFireAlarmDetector_ParticleDensity.state>=(40)) {
Alarm_State.postUpdate("Smoke")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=toForeground&password=xxxxxxxxxxxxxxx")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=loadUrl&url=http://192.168.1.150:8080/habpanel/index.html%23/view/Alarm&password=xxxxxxxxxx")
gVolume.sendCommand(80)
say("Too much smoke ,fire warning.")
Thread::sleep(5000)
gVolume.sendCommand(60)
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxI&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxxxx@gmail.com,xxxxxxxxxx@yahoo.co.uk", "FIREWARNING!!!", "TOO MUCH SMOKE")
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(1)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
}
end
rule "water_leak"
when
Item WaterLeakSensor1_LeakDetected changed from OFF to ON
or
Item WaterLeakSensor2_LeakDetected changed from OFF to ON
then
if (waterprotection.state==(ON)) {
Alarm_State.postUpdate("Water Leak")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=toForeground&password=xxxxxxxxx")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=loadUrl&url=http://192.168.1.150:8080/habpanel/index.html%23/view/Alarm&password=xxxxxxxxxx")
Tasmvalve.sendCommand(OFF)
All_Lights.sendCommand(ON)
gVolume.sendCommand(80)
say("Water leak detected.")
Thread::sleep(5000)
gVolume.sendCommand(60)
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxx&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxxx@gmail.com, xxxxxxxxx@yahoo.co.uk", "WATER LEAK!!!", "WATER LEAK DETECTED PLEASE CHECK IT OUT!")
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(7)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
}
else {
gVolume.sendCommand(80)
say("Water leak detected but the water protection is off.")
Thread::sleep(5000)
gVolume.sendCommand(60)
}
end
rule "home"
when
Item EntranceContact_OpenStatus changed from CLOSED to OPEN
or
Item MbedroomContact_OpenStatus changed from CLOSED to OPEN
or
Item KitchenContact_OpenStatus changed from CLOSED to OPEN
or
Item DiningRoomContact_OpenStatus changed from CLOSED to OPEN
or
Item LivingRoomContact_OpenStatus changed from CLOSED to OPEN
or
Item BedroomContact_OpenStatus changed from CLOSED to OPEN
then
if(Home_State.state==("Enabled")) {
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(10009)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
All_Lights.sendCommand(ON)
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxxxxxx@gmail.com,xxxxxxxxxxxx@yahoo.co.uk", "ALARM!!!", "ALARM IS ON ,CHECK IT OUT.")
}
end
rule "alarm"
when
Item Alarm changed to "Enabled"
then
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=toForeground&password=xxxxxxxxxx")
sendHttpGetRequest("http://192.168.1.30:2323/?cmd=loadUrl&url=http://192.168.1.150:8080/habpanel/index.html%23/view/Alarm&password=xxxxxxxxxx")
sendHttpGetRequest("https://autoremotejoaomgcd.appspot.com/sendmessage?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&message=alarm")
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("xxxxxxxxxx@gmail.com, xxxxxxxxx@yahoo.co.uk", "ALARM!!!", "ALARM IS ON ,CHECK IT OUT.")
XiaomiMiSmartHomeGateway_SoundVolume.sendCommand(100)
XiaomiMiSmartHomeGateway_SoundSelector.sendCommand(10005)
XiaomiMiSmartHomeGateway_Color.sendCommand(HSBType::RED)
XiaomiMiSmartHomeGateway_Brightness.sendCommand(100)
All_Lights.sendCommand(ON)
Siren.sendCommand(ON)
siren_timer = createTimer(now.plusMinutes(5)) [|
if(Alarm.state==("Enabled")) {
Siren.sendCommand(ON)
siren_timer.reschedule(now.plusMinutes(5))
}
else {
Siren.sendCommand{OFF}
if (siren_timer !== null) {
siren_timer.cancel
siren_timer = null
logInfo("sirenTimer", "setting siren_timer to null")
}
}
]
end
i cant find what is causing that warning…any ideas?