Logic Machine Forum
Trouble sending KNX value by email - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Trouble sending KNX value by email (/showthread.php?tid=4754)



Trouble sending KNX value by email - PacoUmea - 07.05.2023

Hi, I'm very new to the world of LM and scripting.

Im trying to use the LM in a building were we're running KNX and Modbus. I was hoping to get the LM to send a email when i get a error/alarm in any part of the building.
I've set up using the example script (https://openrb.com/example-sending-email-from-lm2/) and i get it so send an email but the value i get is 'nil'

"KNX object 1/2/2 value is: nil"

Tested adding 'res, err'
Code:
res, err = mail('mail@mail.nu', 'Alert', 'KNX object 1/2/2 value is: ' .. tostring(value))
log(res, err)

And got this result, telling me nothing Big Grin

Code:
email_alarm 07.05.2023 21:41:14
* arg: 1
  * number: 1
* arg: 2
  * nil



RE: Trouble sending KNX value by email - Erwin van der Zwart - 07.05.2023

You are missing as first line: value = event.getvalue()


RE: Trouble sending KNX value by email - PacoUmea - 08.05.2023

(07.05.2023, 21:58)Erwin van der Zwart Wrote: You are missing as first line: value = event.getvalue()

Thank you!