Page 1 of 1

varibles inside a notification?

Posted: Sunday 24 September 2017 18:40
by Evelen
okey, so I got this to work:

Code: Select all

commandArray = {}
if ("1" == "1") then
    print("testing")
    commandArray['SendNotification']='subject#body#2'
end
return commandArray
but I want to add subject, body and priority as variables
like:

Code: Select all

local msg_subject = "Kjøleskap"
local msg_body = "Det er for varmt"
local msg_pri = "1"
But when I paste the variable it just writes out the text, can't find a way to include the variables
Any ide?
21982000_10154664220201739_296226295_o.png
21982000_10154664220201739_296226295_o.png (207.36 KiB) Viewed 1205 times

Re: varibles inside a notification?

Posted: Monday 25 September 2017 14:55
by zicht
--deleted double post --

Re: varibles inside a notification?

Posted: Monday 25 September 2017 14:55
by zicht
extracted from :
http://www.domoticz.com/wiki/Events

Code: Select all

commandArray['SendNotification']='subject#body#0'
so the word body is a string, you var needs to be a string, you need to concatuate it in the command ..

Code: Select all

bodytext="something nice"
commandArray['SendNotification']='subject#'..bodytext..'#0'
Hope this puts you in the right direction

Re: varibles inside a notification?

Posted: Monday 25 September 2017 21:08
by Evelen
works ;)