All
I have an extremly simple rule which sends an alert when one of my devices is not reachable. This rule gets triggered when an item of a group changes to ON or OFF. In the rule I loop through all items and check which item has state OFF.
The rule seems not reliable and very often I get an timeout error:
2021-03-10 07:29:38.800 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'CheckDevices' failed: Total timeout 10000 ms elapsed
When I manualy run the rule, it’s always working fine.
triggers:
- id: "1"
configuration:
groupName: Network_DevicesStatus
state: OFF
previousState: ON
type: core.GroupStateChangeTrigger
- id: "2"
configuration:
groupName: Network_DevicesStatus
state: ON
previousState: OFF
type: core.GroupStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "3"
configuration:
type: application/vnd.openhab.dsl.rule
script: >-
logInfo("Network.Status", "Devices Group: " +
Network_DevicesStatus.state.toString)
val StringBuilder message = new StringBuilder
if (Network_DevicesStatus.state == OFF) {
Network_DevicesStatus.members.forEach[
status | if (status.state == OFF) {
message.append(status.label + " is offline\n")
}
]
}
else {
message.append("All devices online\n")
}
logInfo("Network.Status", message.toString)
val actions = getActions("pushover", "pushover:pushover-account:default")
actions.sendMessage(message.toString, "Device status")
logInfo("Network.Status", "Pushover sent")
type: script.ScriptAction