habe ich nun drin, habe mich aber für die mail Methode entschieden, da ich dort mp4 Dateien senden kann.
danke
Java
import java.util.List
rule "Record MP4"
when
Item dummy_alarm changed to ON
then
mp4_file.sendCommand( new DateTimeType().toString ) //create a file with the timestamp as the filename.
recordmp4.sendCommand(10) // record 10 seconds
end
rule "Do something when recording finished"
when
//Item recordmp4 changed to 0
Item dummy_alarm changed to ON
then
Thread::sleep(30000)
var TimeStamp = mp4_file.state
logInfo("sendmail.rules", "Mp4 Aufnahme "+ TimeStamp.toString +".mp4 Datei ist fertig.")
val List<String> attachmentUrlList = newArrayList(
"file:///usr/share/openhab2/cameratmpfs/8015/"+ TimeStamp.toString +".mp4")
val mailActions = getActions("mail","mail:smtp:ab76cb96")
mailActions.sendHtmlMail("xxxx@gmail.com", "Email test", "<h1>SicherheitsKamera</h1>Haustür.", attachmentUrlList)
end
Alles anzeigen