Why don't my variables variate?


#1

1) Give a description of the problem
Everything works well except I cannot get the $currentEventDevice command to populate the actual device name in the arrival message.

2) What is the expected behavior?
Return [Presence Sensor 1] in lieu of $currentEventDevice in arrival message.

3) What is happening/not happening?
THe command executes and I get the push notification, but I get the $currentEventDevice variable, not my expected [Presense Sensor 1].

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach any logs (From ST IDE and by turning logging level to Full)

Any help is appreciated!


#2

You need to concatenate the variable to the text, at the moment you are telling it to literally print the text “$currentEventDevice” which it is doing.

Try: concat("Welcome home, ", $currentEventDevice)
Or: "Welcome home, " + $currentEventDevice

If you want an example I modified your piston the backup code is: 36x4


#3

I think there was an issue with variables inside a random() function… @bangali had a work around for it, somewhere in here.


#4

Ha! Solved. Thank you my good man (or woman, I won’t judge).

I am now Noob version 1.1.