Hello OH2 Community,
i want to monitor our sewage treatment plant. It is controlled with a PLC which uses a TCP/Modbus interface. Transmitting and recieving the data via Modbus works fine, but unfortunatly i have problems with recieving mails from openhab, which are dynamicaly generated. I used this help: Samples Rules · openhab/openhab1-addons Wiki · GitHub
Here a snipet of my messages.rules
val string mailText =“”
rule “send Mail for sewage treatment”
when
Item error_sewage changed
then
mailText = “”
if(error_sewage.state >= 1){
if(error_pressure>=1){
mailText = mailText + “Pressure error text… blalbalbal\n”}
if(error_time >=1){
mailText = mailText + “Time Error text… blablabla.\n”
}
}
sendMail(mailTo,“Error sewage plant”,“Hello, \n the sewage plant has following errors:\n\n” + mailText)}
end