For whatever reason sending Lannouncer imbedded commands,@|ALARM=CHIME does not work in Hubitat so I added some code. All my testing was using contacts, some additional identical logic needed for all sensor types. Please consider adding this the live Hubitat version.
In the Parent module TALK added code to directly execute the Lannouncer commands. Also wanted a delay on TTS messages so I could do a chime wait then a message, so I added a delay parameter in Milliseconds. It takes two groups working on the same event to do this
- |Chime| with no delay
- %devicename% is now %devicechange% delay 1500 Milliseconds
The Commands are coded alone as a message, as follows
|siren|
|off| shuts off siren
|chime|
|doorbell|
Using Contacts for testing I added an input field for TTS that is an optional delay in milliseconds
if (parent.returnVar("speechDeviceType") == "capability.musicPlayer") {
player input fields
}
else
input name: "contactDelay", type: "number", title: "Delay in MilliSeconds", required: false
Then added the following to onContact1Event processing
if (contactDelay && contactDelay > 0)
runOnce(new Date(now() + contactDelay), processEvent, [data:[deviceType, deviceState1, deviceState2, deviceState3, deviceState4, index, evt]])
else
processEvent(deviceType, deviceState1, deviceState2, deviceState3, deviceState4, index, evt)
In parent TALK added the following>
if (phrase[0]=='|') { def soundType=phrase.toUpperCase() if (soundType == '|SIREN|') { it.siren() return false } else if (soundType == '|OFF|') { it.off() return false } else if (soundType == '|CHIME|') { it.chime() return false } else if (soundType == '|DOORBELL|') { it.doorbell() return false } } it.speak(phrase)
)