Security Alert with Light and Voice


#1

1) Give a description of the problem
Trying to announce the open door sensor in same piston that I’m triggering light change for door sensors

2) What is the expected behavior?
DLNA speaker will announce which door has opened.

3) What is happening/not happening?
The light execution works great, but now I want voice alerts (and the fabriq DLNA Alexa speaker is amazing for those looking for an easy option). Trying to understand how to grab the sensor name as a dynamic variable. Do I need to see each door sensor as a variable before the task for my speaker to announce? I’m trying to make this code efficient instead of separate tasks for each door sensor.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)


#2

I’m going to get a Fabriq as well, and want this capability as well, so watching this with great interest.


#3

You need to create and empty device variable, then clicking on the if statement for the doors opening your open advanced options by clicking the cog. Find the option for save matching device list to variable. Select your new variable.

Further down I changed your first action with the light bulbs to asynchronous so it will execute at the same time the speaker can speak. Otherwise it will have to wait for the bulbs to do their thing until it can speak.

For the speak command I just added the variable into the text.


#4

Or, try siply using the global variables of $currentEventDevice and $currentDeviceValue. These are dynamic global variables that would capture the name of the door being opened. That way, you wouldn’t have a need to rely on a separately created variable.


#5

Thanks so much!! I actually was playing around and had already switched to asynchronous after I posted. That makes sense to me since I’d like them to not wait for each other to fire.

Will try this out later today.


#6

I’m happy to come break into your house is that helps. :japanese_ogre:

:slight_smile:


#7

My Fabriq speaker arrived today, easy setup, easy integration into ST, and I’ve already updated my pistons w/the Speak command to add voice feedback where appropriate.

I’m not telling my wife about the speaker (hid it behind a picture on our entertainment center) and am really looking forward to her expression the first time an audio event happens. :slight_smile:


#8

So I gave your piston a shot. It seems I’m always getting “Empty Device list” announced instead of the actual door sensor. Any ideas? I have it setup just like the example.


#9

Set logging to full and run it then paste the logs here


#10

11/24/2017, 8:27:15 PM +774ms
+1ms ╔Received event [Inside Patio Door].contact = open with a delay of 299ms
+244ms ║RunTime Analysis CS > 16ms > PS > 104ms > PE > 125ms > CE
+253ms ║Runtime (46311 bytes) successfully initialized in 104ms (v0.2.0fe.20171109) (250ms)
+254ms ║╔Execution stage started
+291ms ║║Comparison (enum) open changes_to (string) open = true (1ms)
+293ms ║║Cancelling condition #8’s schedules…
+294ms ║║Condition #8 evaluated true (33ms)
+300ms ║║Comparison (string) :7aad3e91e295b8ba93fae70b001e9706: is (string) :7aad3e91e295b8ba93fae70b001e9706: = true (2ms)
+302ms ║║Condition #13 evaluated true (5ms)
+302ms ║║Condition group #12 evaluated true (state did not change) (7ms)
+303ms ║║Cancelling condition #1’s schedules…
+304ms ║║Condition group #1 evaluated true (state changed) (43ms)
+307ms ║║Cancelling statement #17’s schedules…
+312ms ║║Calculating (string) Empty device list + (string) is open >> (string) Empty device list is open
+693ms ║║Executed physical command [Chorus Alert Speaker].speak([Empty device list is open]) (376ms)
+694ms ║║Executed [Chorus Alert Speaker].speak (378ms)
+697ms ║║Cancelling statement #2’s schedules…
+719ms ║║Executed virtual command [Bottom Stairs Light].saveStateLocally (15ms)
+735ms ║║Executed virtual command [Couch Table Lamp].saveStateLocally (13ms)
+749ms ║║Executed virtual command [Front Door Lamp].saveStateLocally (12ms)
+762ms ║║Executed physical command [Bottom Stairs Light].setColor([[hex: #DC143C, hue:97, saturation:83, level:58]]) (9ms)
+763ms ║║Executed [Bottom Stairs Light].setColor (11ms)
+773ms ║║Executed physical command [Couch Table Lamp].setColor([[hex: #DC143C, hue:97, saturation:83, level:58]]) (8ms)
+773ms ║║Executed [Couch Table Lamp].setColor (10ms)
+783ms ║║Executed physical command [Front Door Lamp].setColor([[hex: #DC143C, hue:97, saturation:83, level:58]]) (8ms)
+784ms ║║Executed [Front Door Lamp].setColor (10ms)
+794ms ║║Executed physical command [Bottom Stairs Light].setLevel([70]) (6ms)
+795ms ║║Executed [Bottom Stairs Light].setLevel (8ms)
+801ms ║║Executed physical command [Couch Table Lamp].setLevel([70]) (5ms)
+802ms ║║Executed [Couch Table Lamp].setLevel (6ms)
+808ms ║║Executed physical command [Front Door Lamp].setLevel([70]) (5ms)
+809ms ║║Executed [Front Door Lamp].setLevel (6ms)
+813ms ║║Executed virtual command [Bottom Stairs Light, Couch Table Lamp, Front Door Lamp].wait (1ms)
+814ms ║║Requesting a wake up for Fri, Nov 24 2017 @ 8:27:22 PM EST (in 6.0s)
+820ms ║╚Execution stage complete. (566ms)
+821ms ║Setting up scheduled job for Fri, Nov 24 2017 @ 8:27:22 PM EST (in 5.994s)
+837ms ╚Event processed successfully (837ms)


#11

Ok try changing the trigger from changes to open to is open (might also display as are open). Then test that and let me know.

Since it was your only trigger the condition will now take the role as the trigger.