lua user variable number in email
Posted: Saturday 18 June 2016 21:29
a have made 2 micro switches in my mailbox.
one for when the mailman puts something in, and one if i open it to empty it.
i have a counter in the lua script that counts the times the mailman puts something in.
and when i open the mailbox it resets the counter.
i completely "stole" the lua script becouse i am a biginner and i can modify a little but cant create my own.
i created a uservariable that counts the amount of mail
i receive an email when the mailman puts something in but i want the number in the mail as well,but i cant get it to work.
i want something like this: you have (number) pieces of mail
this is the script:
commandArray = {}
x = uservariables["postteller"] + 1
if (otherdevices['brievenbus'] == 'On') then
commandArray['Variable:postteller'] = tostring(x)
print (x)
commandArray['SendEmail']='post#er is post bezorgd#[email protected]'
end
if (otherdevices['brievenbus leeg'] == 'On') then
commandArray['Variable:postteller'] = tostring(0)
print ('brievenbus is geleegd, teller naar 0')
commandArray['SendEmail']='post#de brievenbus is geleegd, teller is gereset#[email protected]'
end
return commandArray
one for when the mailman puts something in, and one if i open it to empty it.
i have a counter in the lua script that counts the times the mailman puts something in.
and when i open the mailbox it resets the counter.
i completely "stole" the lua script becouse i am a biginner and i can modify a little but cant create my own.
i created a uservariable that counts the amount of mail
i receive an email when the mailman puts something in but i want the number in the mail as well,but i cant get it to work.
i want something like this: you have (number) pieces of mail
this is the script:
commandArray = {}
x = uservariables["postteller"] + 1
if (otherdevices['brievenbus'] == 'On') then
commandArray['Variable:postteller'] = tostring(x)
print (x)
commandArray['SendEmail']='post#er is post bezorgd#[email protected]'
end
if (otherdevices['brievenbus leeg'] == 'On') then
commandArray['Variable:postteller'] = tostring(0)
print ('brievenbus is geleegd, teller naar 0')
commandArray['SendEmail']='post#de brievenbus is geleegd, teller is gereset#[email protected]'
end
return commandArray