Hi,
I want to implement a rule to do device monitoring. From my point of view code should be fine.
rule "Monitor Shellys Alarms"
when
Channel "shelly:shelly2-relay:559f55:device#alarm" triggered or // 6.81
Channel "shelly:shellydevice:25a73e:device#alarm" triggered or // 6.85
Channel "shelly:shelly25-roller:e59e36:device#alarm" triggered or // 6.83
Channel "shelly:shelly1pm:8caab505fcf4:device#alarm" triggered or // 6.70
Channel "shelly:shelly25-relay:6933fc:device#alarm" triggered or // 6.71
Channel "shelly:shelly25-relay:686ec1:device#alarm" triggered or // 6.72
Channel "shelly:shelly25-relay:68fcfb:device#alarm" triggered // 6.73
then
logInfo("Shelly", "Shelly Alarm event received")
val event = receivedEvent.getEvent()
val channel = receivedEvent.getChannel().asString
val item = ""
if (triggeringItem.label !== null) item = triggeringItem.label else item = triggeringItem.name
val message = "Alarm for device " + item + ": " + event + " (channel=" + channel + ")"
logInfo("Shelly", message)
val telegram = getActions("telegram","telegram:telegramBot:87bf68ae")
telegram.sendTelegram(message)
switch (event) {
case 'OVERTEMP',
case 'OVERPOWER',
case 'OVERLOAD',
case 'LOAD_ERROR',
case 'RESTARTED',
case 'LOW_BATTERY':
telegram.sendTelegram(message)
}
end
Whatever I try I get errors that the item is not found (triggeringItem) or getEvent() and getChannel() are not a member of receivedItem. I did some search in the forum found an issue indicating that was a problem in 2.5M1, but acc. to GitHub the issue has been solved.
Any hint? It drives we crazy