Page 1 of 1

Include variable values in email notifications

Posted: Sunday 17 December 2017 8:47
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.

Re: Include variable values in email notifications

Posted: Sunday 17 December 2017 12:41
by SweetPants
It's standard LUA

Try: domoticz.notify('RH in Cellar Hallway Notification!', 'Current value is ' .. cellar_Hall_RH.humidity, domoticz.PRIORITY_NORMAL)

Re: Include variable values in email notifications

Posted: Tuesday 19 December 2017 7:25
by dannybloe
Yes, that's basic string manipulation with Lua. This is a good source to get started.