I have a strange error with pushover that only occurs after a reboot. The error remains until I make whatever small change to the rule and save it again. Even adding a comment clears the error.
This is my rule:
var alarmOn = false
var Timer tBlink = null // Timer for light flashing
var int iBlink = 0 // counter for light flashing
var actions = getActions("pushover", "pushover:pushover-account:account")
val thuis = 1
val afwezig = 2
val slapen = 3
// The rule AlarmOnOff is triggered whenever the alarmarea is changed. If the alarm area is set to anything other then "Thuis" it will switch on the alarm
// after a 20 second delay time. Within this delay time the alarm can be switched of, if not the house is armed.
rule "AlarmOnOff"
when
Item AlarmArea changed
then
switch(AlarmArea.state){
case (thuis):{
Sirene.sendCommand(OFF)
//AlarmWarningBeep.sendCommand(OFF)
alarmOn = false
gLampen.sendCommand(OFF)
actions.sendHtmlMessage("Alarm Tuoro uitgeschakeld", "openHAB")
if(tBlink !== null ) {
tBlink.cancel()
tBlink = null
}
}
case(afwezig):{
actions.sendHtmlMessage("Alarm Tuoro bijna ingeschakeld: Afwezig", "openHAB")
iBlink = 0
tBlink = createTimer(now,[|
iBlink++
if(iBlink < 20) {
BvnWnkmrLmp.sendCommand(if(BvnWnkmrLmp.state != ON) ON else OFF)
tBlink.reschedule(now.plusSeconds(1))
} else {
alarmOn = true
actions.sendHtmlMessage("Alarm Tuoro ingeschakeld: Afwezig", "openHAB")
tBlink = null
}
])
}
case(slapen):{
actions.sendHtmlMessage("Alarm Tuoro bijna ingeschakeld: Slapen", "openHAB")
iBlink = 0
tBlink = createTimer(now,[|
iBlink++
if(iBlink < 20) {
BvnWnkmrLmp.sendCommand(if(BvnWnkmrLmp.state != ON) ON else OFF)
tBlink.reschedule(now.plusSeconds(1))
} else {
alarmOn = true
actions.sendHtmlMessage("Alarm Tuoro ingeschakeld: Slapen", "openHAB")
tBlink = null
}
])
}
}
end
// Rule Alarm activated when any one of the items of gAlarm changes to on. If alarm area != thuis the alarm is activated
rule "AlarmActivated"
when
Item gAlarm changed to ON
then
if (((AlarmArea.state == slapen) && (gAlarmSlapen.state == ON)) || ((AlarmArea.state == afwezig) && (gAlarmAfwezig.state == ON))) {
gLampen.sendCommand(ON)
//Sirene.sendCommand(ON)
actions.sendHtmlMessage("Alarm Tuoro " +LastMotion.state, "openHAB")
}
end
// If the any of the items og gAlarmDelayes goes to on the alarm is suspended for x seconds to allow for disarming the alarm.
rule "Delayed alarm activated"
when
Item gAlarmDelayed changed to ON
then
if (alarmOn && Sirene.state == OFF) { // if Sirene is already ON no need to sound the beeper again
iBlink = 0 // set initial counter
tBlink = createTimer(now,[| // create a timer which is executed immediately
iBlink++
if(iBlink < 20) {
BvnWnkmrLmp.sendCommand(if(BvnWnkmrLmp.state != ON) ON else OFF)
tBlink.reschedule(now.plusSeconds(1))
} else {
//Sirene.sendCommand(ON)
actions.sendHtmlMessage("Alarm Tuoro " +LastMotion.state, "openHAB")
tBlink = null
}
])
}
end
rule "No Internet"
when
Item InternetConnected changed to OFF
then
actions.sendHtmlMessage("Alarm Tuoro Lost internet connection","openHAB")
//BvnWnkmrRouterPower.sendCommand(OFF)
end
rule "Internet Restored"
when
Item InternetConnected changed to ON
then
actions.sendHtmlMessage("Alarm Tuoro internet connection restored","openHAB")
//BvnWnkmrRouterPower.sendCommand(OFF)
end
rule "Camera detected Person"
when
Item Person changed to ON
then
if (((AlarmArea.state == slapen) && (gAlarmSlapen.state == ON)) || ((AlarmArea.state == afwezig) && (gAlarmAfwezig.state == ON))){
if ((BtnVrdrLichtnivo.state as Number) < 40) {
BtnOprtLmpGrt.sendCommand(ON)
}
actions.sendHtmlMessage("Alarm Tuoro Persoon alarm","openHAB")
}
end
rule "Camera detected Intrusion"
when
Item Intrusion changed to ON
then
if (((AlarmArea.state == slapen) && (gAlarmSlapen.state == ON)) || ((AlarmArea.state == afwezig) && (gAlarmAfwezig.state == ON))){
if ((BtnVrdrLichtnivo.state as Number) < 40) {
BtnOprtLmpGrt.sendCommand(ON)
}
actions.sendHtmlMessage("Alarm Tuoro Intrusie alarm","openHAB")
}
end
This is the error I get in my openhab log file directly after the reboot.
2022-08-21 10:46:07.725 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Alarm.rules'
2022-08-21 10:46:10.885 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'Alarm.rules', using it anyway:
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
The field Tmp_AlarmRules.actions refers to the missing type Object
When I trigger the rule so a pushover message should be send nothing happens no message is send and this error apears in the openhab log file:
2022-08-21 11:35:19.849 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'Alarm-1' failed: null in Alarm
Now I edit the rule file by just typing a space on an empty line and saving the rule file again. After this the rule loads with no errors and the pushover messages are being delivered as requested.
2022-08-21 11:49:04.670 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Alarm.rules'
I have to repeat this after every reboot to get pushover to work what am I doing wrong here.
It’s not a huge problem but anoing to have to edit the file after every reboot.
Kind Regards,
Will van Gemert