Include variable values in email notifications

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
paul402
Posts: 105
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Include variable values in email notifications

Post by paul402 »

Script below works fine and sends the mail BUT

Code: Select all

return {
	active = true, 
	on = {
		timer = {'every minute'}
	},	
	execute = function(domoticz)
	    local cellar_Hall_RH = domoticz.devices('FR_02 Cellar Hall')
	    if (cellar_Hall_RH.humidity >= 40 ) then
	        domoticz.notify('RH in Cellar Hallway Notification!', 'Current value is ' , domoticz.PRIORITY_NORMAL)
	    end
	end
}
I can't find anything in the docs or forum on how to append the actual values. I tried a few things like {(cellar_Hall_RH.humidity)} but I'm just getting errors. Point me in the right direction please.
SweetPants

Re: Include variable values in email notifications

Post by SweetPants »

It's standard LUA

Try: domoticz.notify('RH in Cellar Hallway Notification!', 'Current value is ' .. cellar_Hall_RH.humidity, domoticz.PRIORITY_NORMAL)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: Include variable values in email notifications

Post by dannybloe »

Yes, that's basic string manipulation with Lua. This is a good source to get started.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest