How to send random text messages from a list


Yep, you’re right about the variables within the random(). I thought someone came up with a workaround on that but I don’t remember where I’ve seen it. Maybe one of the more skilled @webCoRE_Minions can chime in.


heres an example of combining random and variables:


Thank you! That’s where I saw it before but didn’t bookmark it. I had pistons where I wanted to do that before but just gave up on it and have not updated it since.


So you know the Arrival piston that you created for me, would I be able to incorporate the whoCameHome variable into random statements? It doesn’t seem to work when I put them in the statement.


Should work. Will take a look later today. Please post a snapshot if you have a modified version of what’s not working.


Here is the piston right now. I was trying to have greetings based on {whoCameHome}. But the random() doesn’t seem to like having a variable in it. Also, I might have messed something up because now when someone leaves it is also triggering this arrival piston. I think it is because the Contact Sensor is always Closed.


I have this piston and something similar setup for departures based on this one. But both are using the Contact Sensor is closed but the departure uses the presence sensor changes to not present and this one uses the presence sensor changes to present. Yet they are both firing when someone leaves.


ok. should we go back to the original and start from there then? if yes, please post:

  1. the post with the original piston if you have a link to it. otherwise i will search thru my history to find it.
  2. the messages as text so i dont have to hand type those in.


sorry didnt see this till now … somehow did not get a notification. the reply button on the post notifies the poster there is a response but the reply button on the thread does not. :slight_smile:


both will trigger because they both subscribe to the presence event. question is are the presence conditions being evaluated correctly. they should be.


Not sure. Let’s pick this up after Christmas! I am going to be busy the next couple of days. Have a good Christmas!


sure, ping me whenever you want to get back to it.

now that we have permission: :wink:

merry christmas!


Hey, I’m back! So looking at the above piston, I am not sure what the point of the virtual sensor is? When I took it out of the piston for arrival, it seemed to fix the issue of firing when someone left also. This would be because the presence sensor is always on. Then I started to wonder why we need it in either piston? There is nothing telling it to change to “off” so it is always “on”.


welcome back! do you mean piston xpgwi or another piston? which one is the virtual sensor? it seems to only have 3 presence sensors and 1 contact sensor.


This one…


i may be getting old … but this looks almost the same as xpgwi :slight_smile: which one is the virtual sensor?


So what seems to be happening now is that for some reason if someone leaves the house it will then also tell me that Tom is in the house and then the greeting will fire. Except he didn’t leave. This is the Leaving piston…


It might be but I just took a picture of the current one that I am using. The Contact Sensor 1 is the virtual sensor.


Hey @bangali did you figure out if a variable can be used in the Random statement?


didnt see these before since the response did not tag me. here try this one:


i had. posted couple of examples a while back. let me see if i can find one of those … forum search willing :slight_smile:

actually there seems to be one on this thread itself: