How to send a sensor value in email?

I have an Aeon 4 in 1 sensor. I’d like to see what the light level is at sunset each day. i want that value as reference to use it to turn on a light based on the light level. So, I am tryign to figure out how to send an email each day at sunset that includes the value. Any ideas?

Thanks,

Tony-Memphis

Here is what i use to send the exterior temperature. (In my example it is device # 43).

  • Create a scene that runs every day at sunset
  • Include the following code in the “Luup” tab:
  • Of course you want to populate the variables SMTP_SERVER, USER_SENDING, USER_RECEIVING, along with the device number with your own values

[code] local SMTP_SERVER = “your.smtpserver.com
local SMTP_PORT = “25”
local USER_SENDING = “sender@yourname.com
local USER_RECEIVING = “email@recipient.com
local TempExt = luup.variable_get(“urn:upnp-org:serviceId:TemperatureSensor1”, “CurrentTemperature”, 43) – Device 43 is exterior temperature sensor

local smtp = require(“socket.smtp”)

local from = USER_SENDING
local rcpt = {USER_RECEIVING}
local subject_out = “Message from Vera”

local message_out = “Exterior temperature is”…TempExt…" Degre celcius"

local mesgt = {
headers = {
to = USER_RECEIVING,
from = from,
subject = subject_out
},
body = message_out
}

local r, e = smtp.send{ from = from,
rcpt = rcpt,
source = smtp.message(mesgt),
server = SMTP_SERVER,
port = SMTP_PORT
}[/code]

Thanks!! I’ll give this a try…