Code by Scott שאול בן ישוע
Unverified Commit 0bf4f489 authored by Brian Lowrance's avatar Brian Lowrance Committed by GitHub
Browse files

Initial BigTalker2 Child-App Release (2.0.0)

parent 48350928
definition(
name: "BigTalker2-Child",
namespace: "rayzurbock",
author: "rayzur@rayzurbock.com",
description: "Dependency for BigTalker -- Save but don't install/publish",
category: "Fun & Social",
parent: "rayzurbock:BigTalker2",
iconUrl: "http://lowrance.cc/ST/icons/BigTalker-2.0.0.png",
iconX2Url: "http://lowrance.cc/ST/icons/BigTalker@2x-2.0.0.png",
iconX3Url: "http://lowrance.cc/ST/icons/BigTalker@2x-2.0.0.png")
preferences {
page(name: "pageConfigureEvents")
page(name: "pageConfigMotion")
page(name: "pageConfigSwitch")
page(name: "pageConfigPresence")
page(name: "pageConfigLock")
page(name: "pageConfigContact")
page(name: "pageConfigMode")
page(name: "pageConfigThermostat")
page(name: "pageConfigAcceleration")
page(name: "pageConfigWater")
page(name: "pageConfigSmoke")
page(name: "pageConfigButton")
page(name: "pageConfigTime")
page(name: "pageConfigSHM")
page(name: "pageHelpPhraseTokens")
}
def pageConfigureEvents(){
dynamicPage(name: "pageConfigureEvents", title: "Configure Events", install: (!(app?.getInstallationState == true)), uninstall: (app?.getInstallationState == true)) {
section("Group Settings:"){
label(name: "labelRequired", title: "Event Group Name:", defaultValue: "Change this", required: true, multiple: false)
input(name: "groupEnabled", type: "boolean", title: "Enable Group", required: true, defaultValue: true)
}
section("Talk on events:") {
if (settings.timeSlotTime1 || settings.timeSlotTime2 || settings.timeSlotTime3) {
href "pageConfigTime", title: "Time", description: "Tap to modify", state:"complete"
} else {
href "pageConfigTime", title: "Time", description: "Tap to configure"
}
if (settings.motionDeviceGroup1 || settings.motionDeviceGroup2 || settings.motionDeviceGroup3) {
href "pageConfigMotion", title:"Motion", description:"Tap to modify", state:"complete"
} else {
href "pageConfigMotion", title:"Motion", description:"Tap to configure"
}
if (settings.switchDeviceGroup1 || settings.switchDeviceGroup2 || settings.switchDeviceGroup3) {
href "pageConfigSwitch", title:"Switch", description:"Tap to modify", state:"complete"
} else {
href "pageConfigSwitch", title:"Switch", description:"Tap to configure"
}
if (settings.presDeviceGroup1 || settings.presDeviceGroup2 || settings.presDeviceGroup3) {
href "pageConfigPresence", title:"Presence", description:"Tap to modify", state:"complete"
} else {
href "pageConfigPresence", title:"Presence", description:"Tap to configure"
}
if (settings.lockDeviceGroup1 || settings.lockDeviceGroup2 || settings.lockDeviceGroup3) {
href "pageConfigLock", title:"Lock", description:"Tap to modify", state:"complete"
} else {
href "pageConfigLock", title:"Lock", description:"Tap to configure"
}
if (settings.contactDeviceGroup1 || settings.contactDeviceGroup2 || settings.contactDeviceGroup3) {
href "pageConfigContact", title:"Contact", description:"Tap to modify", state:"complete"
} else {
href "pageConfigContact", title:"Contact", description:"Tap to configure"
}
if (settings.modePhraseGroup1 || settings.modePhraseGroup2 || settings.modePhraseGroup3) {
href "pageConfigMode", title:"Mode", description:"Tap to modify", state:"complete"
} else {
href "pageConfigMode", title:"Mode", description:"Tap to configure"
}
if (settings.thermostatDeviceGroup1 || settings.thermostatDeviceGroup2 || settings.thermostatDeviceGroup3) {
href "pageConfigThermostat", title:"Thermostat", description:"Tap to modify", state:"complete"
} else {
href "pageConfigThermostat", title:"Thermostat", description:"Tap to configure"
}
if (settings.accelerationDeviceGroup1 || settings.accelerationDeviceGroup2 || settings.accelerationDeviceGroup3) {
href "pageConfigAcceleration", title: "Acceleration", description:"Tap to modify", state:"complete"
} else {
href "pageConfigAcceleration", title: "Acceleration", description:"Tap to configure"
}
if (settings.waterDeviceGroup1 || settings.waterDeviceGroup2 || settings.waterDeviceGroup3) {
href "pageConfigWater", title: "Water", description:"Tap to modify", state:"complete"
} else {
href "pageConfigWater", title: "Water", description:"Tap to configure"
}
if (settings.smokeDeviceGroup1 || settings.smokeDeviceGroup2 || settings.smokeDeviceGroup3) {
href "pageConfigSmoke", title: "Smoke", description:"Tap to modify", state:"complete"
} else {
href "pageConfigSmoke", title: "Smoke", description:"Tap to configure"
}
if (settings.buttonDeviceGroup1 || settings.buttonDeviceGroup2 || settings.buttonDeviceGroup3) {
href "pageConfigButton", title: "Button", description:"Tap to modify", state:"complete"
} else {
href "pageConfigButton", title: "Button", description:"Tap to configure"
}
if (settings.SHMTalkOnHome || settings.SHMTalkOnAway || settings.SHMTalkOnDisarm) {
href "pageConfigSHM", title: "Smart Home Monitor", description:"Tap to modify", state:"complete"
} else {
href "pageConfigSHM", title: "Smart Home Monitor", description:"Tap to configure"
}
}
}
}
def pageConfigMotion(){
dynamicPage(name: "pageConfigMotion", title: "Configure talk on motion", install: false, uninstall: false) {
section(){
def defaultSpeechActive1 = ""
def defaultSpeechInactive1 = ""
if (state?.motionTestActive1 == null) { state.motionTestActive1 = false }
if (state?.motionTestInactive1 == null) { state.motionTestInactive1 = false }
if (!motionDeviceGroup1) {
defaultSpeechActive1 = "%devicename% is now %devicechange%"
defaultSpeechInactive1 = "%devicename% is now %devicechange%"
}
input name: "motionDeviceGroup1", type: "capability.motionSensor", title: "Motion Sensor(s)", required: false, multiple: true
input name: "motionTalkActive1", type: "text", title: "Say this on motion active:", required: false, defaultValue: defaultSpeechActive1, submitOnChange: true
input name: "motionTestActive1", type: "bool", title: "Toggle to test motion active phrase", required: false, defaultValue: false, submitOnChange: true
input name: "motionTalkInactive1", type: "text", title: "Say this on motion inactive:", required: false, defaultValue: defaultSpeechInactive1, submitOnChange: true
input name: "motionTestInactive1", type: "bool", title: "Toggle to test motion inactive phrase", required: false, defaultValue: false, submitOnChange: true
input name: "motionPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"], submitOnChange: true
input name: "motionSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false, submitOnChange: true
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "motionVolume1", type: "number", title: "Set volume to (overrides default):", required: false, submitOnChange: true
input name: "motionResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true, submitOnChange: true
input name: "motionVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "motionModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "motionStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "motionEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.motionStartTime1 == null))
if (!(settings.motionTestActive1 == null) && !(settings.motionTestActive1 == state?.motionTestActive1)) {
def testevent = [displayName: 'BigTalker Motion', name: 'MotionActiveTest', value: 'Active']
def myVoice = parent?.settings?.speechVoice
if (settings?.motionVoice1) { myVoice = motionVoice1 }
parent.Talk(app.label, settings.motionTalkActive1, motionSpeechDevice1, motionVolume1, motionResumePlay1, motionPersonality1, myVoice, testevent)
state.motionTestActive1 = settings.motionTestActive1
}
if (!(settings.motionTestInactive1 == null) && !(settings.motionTestInactive1 == state?.motionTestInactive1)) {
def testevent = [displayName: 'BigTalker Motion', name: 'MotionInactiveTest', value: 'Inactive']
def myVoice = parent?.settings?.speechVoice
if (settings?.motionVoice1) { myVoice = motionVoice1 }
parent.Talk(app.label, settings.motionTalkInactive1, motionSpeechDevice1, motionVolume1, motionResumePlay1, motionPersonality1, myVoice, testevent)
state.motionTestInactive1 = settings.motionTestInactive1
}
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigMotion()
}
def pageConfigSwitch(){
dynamicPage(name: "pageConfigSwitch", title: "Configure talk on switch", install: false, uninstall: false) {
section(){
def defaultSpeechOn1 = ""
def defaultSpeechOff1 = ""
if (state?.switchTestOn1 == null) { state.switchTestOn1 = false }
if (state?.switchTestOff1 == null) { state.switchTestOff1 = false }
if (!switchDeviceGroup1) {
defaultSpeechOn1 = "%devicename% is now %devicechange%"
defaultSpeechOff1 = "%devicename% is now %devicechange%"
}
input name: "switchDeviceGroup1", type: "capability.switch", title: "Switch(es)", required: false, multiple: true
input name: "switchTalkOn1", type: "text", title: "Say this when switch is turned ON:", required: false, defaultValue: defaultSpeechOn1, submitOnChange: true
input name: "switchTestOn1", type: "bool", title: "Toggle to test switch ON phrase", required: false, defaultValue: false, submitOnChange: true
input name: "switchTalkOff1", type: "text", title: "Say this when switch is turned OFF:", required: false, defaultValue: defaultSpeechOff1, submitOnChange: true
input name: "switchTestOff1", type: "bool", title: "Toggle to test switch OFF phrase", required: false, defaultValue: false, submitOnChange: true
input name: "switchPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"], submitOnChange: true
input name: "switchSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false, submitOnChange: true
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "switchVolume1", type: "number", title: "Set volume to (overrides default):", required: false, submitOnChange: true
input name: "switchResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true, submitOnChange: true
input name: "switchVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "switchModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "switchStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "switchEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.switchStartTime1 == null))
if (!(settings.switchTestOn1 == null) && !(settings.switchTestOn1 == state?.switchTestOn1)) {
def testevent = [displayName: 'BigTalker Switch', name: 'SwitchOnTest', value: 'On']
def myVoice = parent?.settings?.speechVoice
if (settings?.switchVoice1) { myVoice = switchVoice1 }
parent.Talk(app.label, settings.switchTalkOn1, switchSpeechDevice1, switchVolume1, switchResumePlay1, switchPersonality1, myVoice, testevent)
state.switchTestOn1 = settings.switchTestOn1
}
if (!(settings.switchTestOff1 == null) && !(settings.switchTestOff1 == state?.switchTestOff1)) {
def testevent = [displayName: 'BigTalker Switch', name: 'SwitchOffTest', value: 'Off']
def myVoice = parent?.settings?.speechVoice
if (settings?.switchVoice1) { myVoice = switchVoice1 }
parent.Talk(app.label, settings.switchTalkOff1, switchSpeechDevice1, switchVolume1, switchResumePlay1, switchPersonality1, myVoice, testevent)
state.switchTestOff1 = settings.switchTestOff1
}
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigSwitch()
}
def pageConfigPresence(){
dynamicPage(name: "pageConfigPresence", title: "Configure talk on presence", install: false, uninstall: false) {
section(){
def defaultSpeechArrive1 = ""
def defaultSpeechLeave1 = ""
if (!presDeviceGroup1) {
defaultSpeechArrive1 = "%devicename% has arrived"
defaultSpeechLeave1 = "%devicename% has left"
}
input name: "presDeviceGroup1", type: "capability.presenceSensor", title: "Presence Sensor(s)", required: false, multiple: true
input name: "presTalkOnArrive1", type: "text", title: "Say this when someone arrives:", required: false, defaultValue: defaultSpeechArrive1
input name: "presTalkOnLeave1", type: "text", title: "Say this when someone leaves:", required: false, defaultValue: defaultSpeechLeave1
input name: "presPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "presSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "presVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "presResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "presVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "presModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "presStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "presEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.presStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigPresence()
}
def pageConfigLock(){
dynamicPage(name: "pageConfigLock", title: "Configure talk on lock", install: false, uninstall: false) {
section(){
def defaultSpeechUnlock1 = ""
def defaultSpeechLock1 = ""
if (!lockDeviceGroup1) {
defaultSpeechUnlock1 = "%devicename% is now %devicechange%"
defaultSpeechLock1 = "%devicename% is now %devicechange%"
}
input name: "lockDeviceGroup1", type: "capability.lock", title: "Lock(s)", required: false, multiple: true
input name: "lockTalkOnUnlock1", type: "text", title: "Say this when unlocked:", required: false, defaultValue: defaultSpeechUnlock1
input name: "lockTalkOnLock1", type: "text", title: "Say this when locked:", required: false, defaultValue: defaultSpeechLock1
input name: "lockPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "lockSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "lockVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "lockResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "lockVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "lockModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "lockStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "lockEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.lockStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigLock()
}
def pageConfigContact(){
dynamicPage(name: "pageConfigContact", title: "Configure talk on contact sensor", install: false, uninstall: false) {
section(){
def defaultSpeechOpen1 = ""
def defaultSpeechClose1 = ""
if (!contactDeviceGroup1) {
defaultSpeechOpen1 = "%devicename% is now %devicechange%"
defaultSpeechClose1 = "%devicename% is now %devicechange%"
}
input name: "contactDeviceGroup1", type: "capability.contactSensor", title: "Contact sensor(s)", required: false, multiple: true
input name: "contactTalkOnOpen1", type: "text", title: "Say this when opened:", required: false, defaultValue: defaultSpeechOpen1
input name: "contactTalkOnClose1", type: "text", title: "Say this when closed:", required: false, defaultValue: defaultSpeechClose1
input name: "contactPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "contactSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "contactVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "contactResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "contactVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "contactModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "contactStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "contactEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.contactStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigContact()
}
def pageConfigMode(){
def locationmodes = []
location.modes.each(){
locationmodes += it
}
LOGDEBUG("locationmodes=${locationmodes}")
dynamicPage(name: "pageConfigMode", title: "Configure talk on home mode change", install: false, uninstall: false) {
section(){
def defaultSpeechMode1 = ""
if (!modePhraseGroup1) {
defaultSpeechMode1 = "%locationname% mode has changed from %lastmode% to %mode%"
}
input name: "modePhraseGroup1", type:"mode", title:"When mode changes to: ", required:false, multiple:true, submitOnChange:false
input name: "modeExcludePhraseGroup1", type: "mode", title: "But not when changed from (optional): ", required: false, multiple: true
input name: "TalkOnModeChange1", type: "text", title: "Say this when home mode is changed", required: false, defaultValue: defaultSpeechMode1
input name: "modePersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "modePhraseSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "modePhraseVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "modePhraseResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "modePhraseVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "modeStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "modeEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.modeStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigMode()
}
def pageConfigThermostat(){
dynamicPage(name: "pageConfigThermostat", title: "Configure talk when thermostat state is:", install: false, uninstall: false) {
section(){
def defaultSpeechIdle1 = ""
def defaultSpeechHeating1 = ""
def defaultSpeechCooling1 = ""
def defaultSpeechFan1 = ""
if (!thermostatDeviceGroup1) {
defaultSpeechIdle1 = "%devicename% is now off"
defaultSpeechHeating1 = "%devicename% is now heating"
defaultSpeechCooling1 = "%devicename% is now cooling"
defaultSpeechFan1 = "%devicename% is now circulating fan"
}
input name: "thermostatDeviceGroup1", type: "capability.thermostat", title: "Thermostat(s)", required: false, multiple: true
input name: "thermostatTalkOnIdle1", type: "text", title: "Say this on change to Idle:", required: false, defaultValue: defaultSpeechIdle1
input name: "thermostatTalkOnHeating1", type: "text", title: "Say this on change to heating:", required: false, defaultValue: defaultSpeechHeating1
input name: "thermostatTalkOnCooling1", type: "text", title: "Say this on change to cooling:", required: false, defaultValue: defaultSpeechCooling1
input name: "thermostatTalkOnFan1", type: "text", title: "Say this on change to fan only:", required: false, defaultValue: defaultSpeechFan1
input name: "thermostatPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "thermostatSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "thermostatVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "thermostatResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "thermostatVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "thermostatModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "thermostatStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "thermostatEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.thermostatStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigThermostat()
}
def pageConfigAcceleration(){
dynamicPage(name: "pageConfigAcceleration", title: "Configure talk on acceleration", install: false, uninstall: false) {
section(){
def defaultSpeechActive1 = ""
def defaultSpeechInactive1 = ""
if (!accelerationDeviceGroup1) {
defaultSpeechActive1 = "%devicename% acceleration %devicechange%"
defaultSpeechInactive1 = "%devicename% acceleration is no longer active"
}
input name: "accelerationDeviceGroup1", type: "capability.accelerationSensor", title: "Acceleration sensor(s)", required: false, multiple: true
input name: "accelerationTalkOnActive1", type: "text", title: "Say this when activated:", required: false, defaultValue: defaultSpeechActive1
input name: "accelerationTalkOnInactive1", type: "text", title: "Say this when inactivated:", required: false, defaultValue: defaultSpeechInactive1
input name: "accelerationPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "accelerationSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "accelerationVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "accelerationResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "accelerationVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "accelerationModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "accelerationStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "accelerationEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.accelerationStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigAcceleration()
}
def pageConfigWater(){
dynamicPage(name: "pageConfigWater", title: "Configure talk on water", install: false, uninstall: false) {
section(){
def defaultSpeechWet1 = ""
def defaultSpeechDry1 = ""
if (!waterDeviceGroup1) {
defaultSpeechWet1 = "%devicename% is %devicechange%"
defaultSpeechDry1 = "%devicename% is %devicechange%"
}
input name: "waterDeviceGroup1", type: "capability.waterSensor", title: "Water sensor(s)", required: false, multiple: true
input name: "waterTalkOnWet1", type: "text", title: "Say this when wet:", required: false, defaultValue: defaultSpeechWet1
input name: "waterTalkOnDry1", type: "text", title: "Say this when dry:", required: false, defaultValue: defaultSpeechDry1
input name: "waterPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "waterSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "waterVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "waterResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "waterVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "waterModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "waterStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "waterEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.waterStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigWater()
}
def pageConfigSmoke(){
dynamicPage(name: "pageConfigSmoke", title: "Configure talk on smoke", install: false, uninstall: false) {
section(){
def defaultSpeechDetect1 = ""
def defaultSpeechClear1 = ""
def defaultSpeechTest1 = ""
if (!smokeDeviceGroup1) {
defaultSpeechDetect1 = "Smoke, %devicename% has detected smoke"
defaultSpeechClear1 = "Smoke, %devicename% has cleared smoke alert"
defaultSpeechTest1 = "Smoke, %devicename% has been tested"
}
input name: "smokeDeviceGroup1", type: "capability.smokeDetector", title: "Smoke detector(s)", required: false, multiple: true
input name: "smokeTalkOnDetect1", type: "text", title: "Say this when detected:", required: false, defaultValue: defaultSpeechDetect1
input name: "smokeTalkOnClear1", type: "text", title: "Say this when cleared:", required: false, defaultValue: defaultSpeechClear1
input name: "smokeTalkOnTest1", type: "text", title: "Say this when tested:", required: false, defaultValue: defaultSpeechTest1
input name: "smokePersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "smokeSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "smokeVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "smokeResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "smokeVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "smokeModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "smokeStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "smokeEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.smokeStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigSmoke()
}
def pageConfigButton(){
dynamicPage(name: "pageConfigButton", title: "Configure talk on button press", install: false, uninstall: false) {
section(){
def defaultSpeechButton1 = ""
def defaultSpeechButtonHold1 = ""
if (!buttonDeviceGroup1) {
defaultSpeechButton1 = "%devicename% button pressed"
defaultSpeechButtonHold1 = "%devicename% button held"
}
input name: "buttonDeviceGroup1", type: "capability.button", title: "Button(s)", required: false, multiple: true
input name: "buttonTalkOnPress1", type: "text", title: "Say this when pressed:", required: false, defaultValue: defaultSpeechButton1
input name: "buttonTalkOnHold1", type: "text", title: "Say this when held:", required: false, defaultValue: defaultSpeechButtonHold1
input name: "buttonPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "buttonSpeechDevice1", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "buttonVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "buttonResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "buttonVoice1", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "buttonModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "buttonStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "buttonEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.buttonStartTime1 == null))
}
section("Help"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
}
//End pageConfigButton()
}
def pageConfigSHM(){
dynamicPage(name: "pageConfigSHM", title: "Configure talk on Smart Home Monitor status change", install: false, uninstall: false) {
section(){
input name: "SHMPersonality", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
}
section("Smart Home Monitor - Armed, Away"){
def defaultSpeechSHMAway = ""
if ((!SHMTalkOnAway) && (!SHMTalkOnHome) && (!SHMTalkOnDisarm)) {
defaultSpeechSHMAway = "Smart Home Monitor is now Armed in Away mode"
}
input name: "SHMTalkOnAway", type: "text", title: "Say this when Armed, Away:", required: false, defaultValue: defaultSpeechSHMAway
input name: "SHMSpeechDeviceAway", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "SHMVolumeAway", type: "number", title: "Set volume to (overrides default):", required: false
input name: "SHMResumePlayAway", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "SHMResumeVoiceAway", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "SHMModesAway", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "SHMStartTimeAway", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "SHMEndTimeAway", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.SHMStartTimeAway == null))
}
section("Smart Home Monitor - Armed, Home"){
def defaultSpeechSHMHome = ""
if ((!SHMTalkOnAway) && (!SHMTalkOnHome) && (!SHMTalkOnDisarm)) {
defaultSpeechSHMHome = "Smart Home Monitor is now Armed in Home mode"
}
input name: "SHMTalkOnHome", type: "text", title: "Say this when Armed, Home:", required: false, defaultValue: defaultSpeechSHMHome
input name: "SHMSpeechDeviceHome", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "SHMVolumeHome", type: "number", title: "Set volume to (overrides default):", required: false
input name: "SHMResumePlayHome", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "SHMResumeVoiceHome", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "SHMModesHome", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "SHMStartTimeHome", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "SHMEndTimeHome", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.SHMStartTimeHome == null))
}
section("Smart Home Monitor - Disarmed"){
def defaultSpeechSHMDisarm = ""
if ((!SHMTalkOnAway) && (!SHMTalkOnHome) && (!SHMTalkOnDisarm)) {
defaultSpeechSHMDisarm = "Smart Home Monitor is now Disarmed"
}
input name: "SHMTalkOnDisarm", type: "text", title: "Say this when Disarmed:", required: false, defaultValue: defaultSpeechSHMDisarm
input name: "SHMSpeechDeviceDisarm", type: parent?.state?.speechDeviceType, title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
if (parent?.state?.speechDeviceType == "capability.musicPlayer") {
input name: "SHMVolumeDisarm", type: "number", title: "Set volume to (overrides default):", required: false
input name: "SHMResumePlayDisarm", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent?.settings?.resumePlay == false) ? false : true
input name: "SHMResumeVoiceDisarm", type: "enum", title: "Voice (overrides default):", options: parent?.state?.supportedVoices, required: false, submitOnChange: true
}
input name: "SHMModesDisarm", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "SHMStartTimeDisarm", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "SHMEndTimeDisarm", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.SHMStartTimeDisarm == null))
}