Have Aeotec Doorbell Play Specific MP3 for each door sensor


#1

1) Give a description of the problem
When the state of the contact sensor changes to “open”, I would like the Aeotec Doorbell to play a specific MP3 file for each sensor

2) What is the expected behavior?
When Contact Sensor 1 changes its state to “open”, the Aeotec Doorbell will play a pre-loaded MP3 file that will say “Contact Sensor 1 has opened.”

Each individual sensor will have a corresponding MP3 file.

3) What is happening/not happening?
The current Piston simply sends an SMS message and all sensor trigger the same MP3 file on the Aeotec Doorbell.

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


#2

Hmm…

I could tell you how to do it using a Loop…but it seems like there should be an easier way.

What you need to know is the index of the $currentEventDevice within the group of devices you have and then it’s easy. Without that it gets a bit more involved.

I’m not sure if WC exposes that information in some place. I do know that it is not $currentEventDeviceIndex (which would have been nice). That variable holds other data.


#3

The easiest way might be to just name the files you want to play to be the same as the name you gave the device.

Then you could just say something like:

Play MP3 file named $currentEventDevice.mp3