Is the URL random one? Sorry, a little slow, on mobile.
Edit: I tried this and it worked. random(“http://www.url1.com”,“http://www.url2.com”,“http://www.url3.com”,“http://www.url4.com”)
Is the URL random one? Sorry, a little slow, on mobile.
Edit: I tried this and it worked. random(“http://www.url1.com”,“http://www.url2.com”,“http://www.url3.com”,“http://www.url4.com”)
The url is to have the speech go through my sonos setup on my unraid server with a docker. When I set it up the way you have it, webCore gave an error. This is the error:
║Error executing virtual command [].httpRequest: (10ms) java.lang.NullPointerException: Cannot invoke method replace() on null object
Ah I just tested it with random() in the console and didn’t do the actual web request. I don’t have a sonos to test it on.
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.
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:
thanks.
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.
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.
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.
i may be getting old … but this looks almost the same as xpgwi
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…