varibles inside a notification? Topic is solved

Moderator: leecollings

Post Reply
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

varibles inside a notification?

Post 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 1183 times
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: varibles inside a notification?

Post by zicht »

--deleted double post --
Last edited by zicht on Monday 25 September 2017 14:56, edited 1 time in total.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: varibles inside a notification?

Post 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
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: varibles inside a notification?

Post by Evelen »

works ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest