Add alert with Lua?

I want to be able to trigger/create an alert through UI7 alert function.
I found info on how to do this by http request [url=][/url]
But is there a way to add an alert through Lua code?

Most of the NON - Vera provided Notification plugins provide this ability.

You may want to look into something like Vera Alerts.

There is LUA code available that will send an EMail message (providing you have access to an email server that supports the SMTP protocol). Search for “send_email” for example of that code. And you can send email as a text (SMS) message if you want, using the vendor specific email address for your cell phone.

But as Richard said, Vera Alerts is the much easier way to go.