Help with Loop for alarm


#1

1) Give a description of the problem
Having Does not seem to doing anything at all No sound comes out of the speaker at all.

2) What is the expected behavior?
I am looking to have this Trigger as soon at the contact sensor opens and continue to play the track until the SHM is changed to “Disarmed” (closing the contact should also not affect this if it is closed i would like the track to continue to loop until it is disarmed)

3) What is happening/not happening?
No sound at all.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
( 12/28/2018, 9:04:35 PM +158ms
+1ms ╔Received event [Home].time/recovery = 1546049075157 with a delay of 1ms
+82ms ║RunTime Analysis CS > 19ms > PS > 49ms > PE > 13ms > CE
+84ms ║Runtime (38078 bytes) successfully initialized in 49ms (v0.3.109.20181207) (83ms)
+86ms ║╔Execution stage started
+87ms ║╚Execution stage complete. (1ms)
+88ms ╚Event processed successfully (88ms)
12/28/2018, 9:03:54 PM +266ms
+2ms ╔Received event [Front Door].contact = closed with a delay of 262ms
+90ms ║RunTime Analysis CS > 20ms > PS > 57ms > PE > 13ms > CE
+93ms ║Runtime (38073 bytes) successfully initialized in 57ms (v0.3.109.20181207) (90ms)
+94ms ║╔Execution stage started
+105ms ║║Comparison (enum) closed changes_away_from (string) closed = false (0ms)
+106ms ║║Condition #2 evaluated false (6ms)
+108ms ║║Condition group #1 evaluated false (state did not change) (7ms)
+110ms ║╚Execution stage complete. (16ms)
+112ms ╚Event processed successfully (112ms)
12/28/2018, 9:03:08 PM +78ms
+1ms ╔Received event [Home].time/recovery = 1546048988078 with a delay of 0ms
+96ms ║RunTime Analysis CS > 21ms > PS > 58ms > PE > 17ms > CE
+99ms ║Runtime (38078 bytes) successfully initialized in 58ms (v0.3.109.20181207) (97ms)
+101ms ║╔Execution stage started
+102ms ║╚Execution stage complete. (2ms)
+104ms ╚Event processed successfully (103ms))


#2

If this is your first attempt to play a MP3 via webCoRE, I would first make a new piston with only one command:

With Music Player Do Play Track at volume 10

Then press TEST.
Once you have that working, it’s easy to build logic around that.

I use this technique with most new devices I buy to learn the capabilities and proper syntax. It helps me to get familiar with the commands without having to open the door each time I want to test something.


#3

Thanks for the feedback i have tried that and have been able to get this basic setup to work. I have also been able to get other things to work. For example i have have been able to get it to sound the mp3 that i want when a contact is changed away from closed.

The two issues i really seem to be getting stuck on are, first that when i open the contact it take the speaker about 30 seconds to sound this makes things very difficult to test things when i need to wait for 30+ second to see if what i just did worked or not (wastes alot of time)

And second is that i am not able to get the mp3 to loop it plays once and then stops.

If guess i will have to just keep picking away at examples and see what other are doing and try to figure out what i’m doing incorrect.


#4

I suspect looping an MP3 file will be a challenge… I mean, how is webCoRE supposed to know it is time to play the file again? Perhaps adding a wait in your loop 2 seconds longer than the length of the MP3?

Another alternative is to use a MP3 with a longer duration… Then you can drop the loop entirely. One command to start playing, and another command to stop playing.


#5

Anytime I see a device stalling more than 2-3 seconds, the red flags go up.

To help pin-point the issue, I would likely change the line:
IF Contact Sensor 3's contact changes away from closed
to any other device, (preferably one located near the hub) such as:
IF Lamp switch changes to on

I would be curious as to how long the speaker takes to respond in this test.