
Ich habe mir diese Rule zusammengebastelt
Code: Alles auswählen
var Timer mVolume = null
var Timer tVolume = null
rule "Türklingel wurde gedrückt"
when
Channel "mqtt:topic:MQTTBroker:Klingelknopf:Klingelknopfgedrueckt" triggered
then
val String strMessage = "Es hat geklingelt"
val imageUrl = "http://192.168.2.179:8080/ipcamera/XXXXXXX/ipcamera.jpg"
val telegramAction = getActions("telegram","telegram:telegramBot:XXXXXXXX")
telegramAction.sendTelegram(strMessage)
telegramAction.sendTelegramPhoto(imageUrl, "Bild von der Türklingel")
sendHttpGetRequest("https://api.callmebot.com/whatsapp.php?source=openHAB&phone=XXXXXXXXX&apikey=XXXXXXX&text=" + java.net.URLEncoder::encode(strMessage, 'UTF-8'))
sendHttpGetRequest("https://api.callmebot.com/whatsapp.php?source=openHAB&phone=XXXXXXXXX&apikey=XXXXXX&text=" + java.net.URLEncoder::encode(imageUrl, 'UTF-8'))
GoogleHomeMinni_Lautstarke.sendCommand(80)
say(strMessage, "voicerss:deDE")
mVolume = createTimer(now.plusSeconds(10), [|
GoogleHomeMinni_Lautstarke.sendCommand(50)
])
end]

Code: Alles auswählen
rule "Alarmvideo CamE"
when
Item Cam_Einfahrt_Cell_Motion_Alarm changed or
Item Cam_Einfahrt_Motion_Alarm changed
then
if (Alarmschalter.state == ON) {
val telegramAction = getActions("telegram", "telegram:telegramBot:XXXXXXXX")
if (Cam_Einfahrt_Cell_Motion_Alarm.state == ON && Cam_Einfahrt_Motion_Alarm.state == ON) {
val String videoUrl = "http://192.168.2.179:8080/ipcamera/XXXXXXX/ipcamera.mjpeg"
telegramAction.sendTelegram("Bewegung in der Einfahrt erkannt! ")
telegramAction.sendTelegramVideo(videoUrl, "Video von der KameraE")
} else if (Cam_Einfahrt_Cell_Motion_Alarm.state == OFF && Cam_Einfahrt_Motion_Alarm.state == OFF) {
telegramAction.sendTelegram("Bewegung beendet! Video gestoppt.")
}
} else {
return;
}
end
