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

2.1.0 - Child

See Parent App Notes for changes
parent d84d4792
......@@ -33,7 +33,7 @@ preferences {
}
def pageConfigureEvents(){
setAppVersion()
setVersion()
state.hubType = parent.returnVar("hubType")
dynamicPage(name: "pageConfigureEvents", title: "Configure Events", install: (!(app?.getInstallationState == true)), uninstall: (app?.getInstallationState == true)) {
section("Group Settings:"){
......@@ -56,7 +56,7 @@ def pageConfigureEvents(){
} else {
href "pageConfigSwitch", title:"Switch", description:"Tap to configure"
}
if (settings.presDeviceGroup1 || settings.presDeviceGroup2 || settings.presDeviceGroup3) {
if (settings.presenceDeviceGroup1 || settings.presenceDeviceGroup2 || settings.presenceDeviceGroup3) {
href "pageConfigPresence", title:"Presence", description:"Tap to modify", state:"complete"
} else {
href "pageConfigPresence", title:"Presence", description:"Tap to configure"
......@@ -139,36 +139,43 @@ def pageConfigureEvents(){
def pageConfigMotion(){
dynamicPage(name: "pageConfigMotion", title: "Configure talk on motion", install: false, uninstall: false) {
section(){
def defaultSpeechActive1 = ""
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
//CONFIGURATION
section(){
def defaultSpeechActive1 = ""
def defaultSpeechInactive1 = ""
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: "motionTalkOnActive1", type: "text", title: "Say this on motion active:", required: false, defaultValue: defaultSpeechActive1, submitOnChange: true
input name: "motionTestOnActive1", type: "bool", title: "Toggle to test motion active phrase", required: false, defaultValue: false, submitOnChange: true
input name: "motionTalkOnInactive1", type: "text", title: "Say this on motion inactive:", required: false, defaultValue: defaultSpeechInactive1, submitOnChange: true
input name: "motionTestOnInactive1", 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.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false, submitOnChange: true
input name: "motionDeviceGroup1", type: "capability.motionSensor", title: "${formatSettingRootStart}Motion Sensor(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "motionTalkOnActive1", type: "text", title: "${formatSettingRootStart}Say this on motion active:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechActive1, submitOnChange: true
input name: "motionTestOnActive1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test motion active phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "motionTalkOnInactive1", type: "text", title: "${formatSettingRootStart}Say this on motion inactive:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechInactive1, submitOnChange: true
input name: "motionTestOnInactive1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test motion inactive phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "motionPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"], submitOnChange: true
input name: "motionSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false, submitOnChange: true
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true, submitOnChange: true
input name: "motionVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "motionVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "motionResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true, submitOnChange: true
input name: "motionVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${parent.SettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
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))
input name: "motionDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
//input name: "motionCount1", type: "number", title: "Do this only x times (next prompt)...", required: false, submitOnChange: true
//input name: "motionCountUnit1", type:"enum", title: "... per ", required: settings.motionCount1, options: ["Minute", "Hour", "Day"]
input name: "motionDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
}
section("Help"){
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "motionModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "motionStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "motionEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.motionStartTime1 == null))
input name: "motionDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
//input name: "motionCount1", type: "number", title: "${formatSettingOptionalEnd}Do this only x times (next prompt)...${parent.formatSettingOptionalEnd}", required: false, submitOnChange: true
//input name: "motionCountUnit1", type:"enum", title: "${formatSettingOptionalEnd}... per ${parent.formatSettingOptionalEnd}", required: settings.motionCount1, options: ["Minute", "Hour", "Day"]
input name: "motionDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
def phraseTestTogDeviceUpper = "Motion"
......@@ -200,6 +207,11 @@ def pageConfigMotion(){
def pageConfigSwitch(){
dynamicPage(name: "pageConfigSwitch", title: "Configure talk on switch", install: false, uninstall: false) {
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
//CONFIGURATION
section(){
def defaultSpeechOn1 = ""
def defaultSpeechOff1 = ""
......@@ -207,28 +219,30 @@ def pageConfigSwitch(){
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: "switchTalkOnOn1", type: "text", title: "Say this when switch is turned ON:", required: false, defaultValue: defaultSpeechOn1, submitOnChange: true
input name: "switchTestOnOn1", type: "bool", title: "Toggle to test switch ON phrase", required: false, defaultValue: false, submitOnChange: true
input name: "switchTalkOnOff1", type: "text", title: "Say this when switch is turned OFF:", required: false, defaultValue: defaultSpeechOff1, submitOnChange: true
input name: "switchTestOnOff1", 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.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false, submitOnChange: true
input name: "switchDeviceGroup1", type: "capability.switch", title: "${formatSettingRootStart}Switch(es)${formatSettingRootEnd}", required: false, multiple: true
input name: "switchTalkOnOn1", type: "text", title: "${formatSettingRootStart}Say this when switch is turned ON:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechOn1, submitOnChange: true
input name: "switchTestOnOn1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test switch ON phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "switchTalkOnOff1", type: "text", title: "${formatSettingRootStart}Say this when switch is turned OFF:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechOff1, submitOnChange: true
input name: "switchTestOnOff1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test switch OFF phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "switchPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"], submitOnChange: true
input name: "switchSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false, submitOnChange: true
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true, submitOnChange: true
input name: "switchVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "switchVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "switchResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true, submitOnChange: true
input name: "switchVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
//IN DEVELOPMENT input name: "switchOnThreshold", type: "number", title: "If it's on for more than this many minutes (default 0)", required: false, defaultValue: 0
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))
input name: "switchDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "switchDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
}
section("Help"){
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
//IN DEVELOPMENT input name: "switchOnThreshold", type: "number", title: "${formatSettingOptionalStart}If it's on for more than this many minutes (default 0)${formatSettingOptionalEnd}", required: false, defaultValue: 0
input name: "switchModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "switchStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "switchEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.switchStartTime1 == null))
input name: "switchDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "switchDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -260,36 +274,43 @@ def pageConfigSwitch(){
}
def pageConfigPresence(){
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigPresence", title: "Configure talk on presence", install: false, uninstall: false) {
//CONFIGURATION
section(){
def defaultSpeechArrive1 = ""
def defaultSpeechLeave1 = ""
def testState = ""
if (!presDeviceGroup1) {
if (!presenceDeviceGroup1) {
defaultSpeechArrive1 = "%devicename% has arrived"
defaultSpeechLeave1 = "%devicename% has left"
}
input name: "presenceDeviceGroup1", type: "capability.presenceSensor", title: "Presence Sensor(s)", required: false, multiple: true
input name: "presenceTalkOnArrive1", type: "text", title: "Say this when someone arrives:", required: false, defaultValue: defaultSpeechArrive1
input name: "presenceTestOnArrive1", type: "bool", title: "Toggle to test arrival phrase", required: false, defaultValue: false, submitOnChange: true
input name: "presenceTalkOnLeave1", type: "text", title: "Say this when someone leaves:", required: false, defaultValue: defaultSpeechLeave1
input name: "presenceTestOnLeave1", type: "bool", title: "Toggle to test departure phrase", required: false, defaultValue: false, submitOnChange: true
input name: "presencePersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "presenceSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "presenceDeviceGroup1", type: "capability.presenceSensor", title: "${formatSettingRootStart}Presence Sensor(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "presenceTalkOnPresent1", type: "text", title: "${formatSettingRootStart}Say this when someone arrives:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechArrive1
input name: "presenceTestOnPresent1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test arrival phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "presenceTalkOnNot present1", type: "text", title: "${formatSettingRootStart}Say this when someone leaves:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechLeave1
input name: "presenceTestOnNot present1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test departure phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "presencePersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"]
input name: "presenceSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalEnd}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("speechDeviceType") == "capability.musicPlayer") {
input name: "presenceVolume1", type: "number", title: "Set volume to (overrides default):", required: false
input name: "presenceResumePlay1", type: "bool", title: "Attempt to resume playing audio?", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "presenceVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "presenceVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "presenceResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "presenceVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
input name: "presenceModes1", type: "mode", title: "Talk when in these mode(s) (overrides default)", multiple: true, required: false
input name: "presenceStartTime1", type: "time", title: "Don't talk before (overrides default)", required: false, submitOnChange: true
input name: "presenceEndTime1", type: "time", title: "Don't talk after (overrides default)", required: (!(settings.presenceStartTime1 == null))
input name: "presenceDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "presDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "presenceModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "presenceStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "presenceEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.presenceStartTime1 == null))
input name: "presenceDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "presenceDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
section("Help"){
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -298,7 +319,7 @@ def pageConfigPresence(){
def phraseTestTogState = ""
def testEvent = ""
def myVoice = ""
phraseTestTogState = "Arrive"
phraseTestTogState = "Present"
if (state?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" == null) {state."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" = false} //init var
if ((!(settings?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" == null)) && (settings?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" != state?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1")) { //test toggle switch state
testEvent = [displayName: "Big Talker Test", name: "${phraseTestTogDeviceUpper}${phraseTestTogState}Test", value: phraseTestTogState]
......@@ -307,7 +328,7 @@ def pageConfigPresence(){
sendTalk(app.label, settings."${phraseTestTogDeviceLower}TalkOn${phraseTestTogState}1", settings."${phraseTestTogDeviceLower}SpeechDevice1", settings."${phraseTestTogDeviceLower}Volume1", settings."${phraseTestTogDeviceLower}ResumePlay1", settings."${phraseTestTogDeviceLower}Personality1", myVoice, testEvent)
state."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" = settings."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" //capture toggle switch state
}
phraseTestTogState = "Leave"
phraseTestTogState = "Not present"
if (state?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" == null) {state."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" = false} //init var
if ((!(settings?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" == null)) && (settings?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1" != state?."${phraseTestTogDeviceLower}TestOn${phraseTestTogState}1")) { //test toggle switch state
testEvent = [displayName: "Big Talker Test", name: "${phraseTestTogDeviceUpper}${phraseTestTogState}Test", value: phraseTestTogState]
......@@ -321,7 +342,12 @@ def pageConfigPresence(){
}
def pageConfigLock(){
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigLock", title: "Configure talk on lock", install: false, uninstall: false) {
//CONFIGURATION
section(){
def defaultSpeechUnlock1 = ""
def defaultSpeechLock1 = ""
......@@ -329,27 +355,29 @@ def pageConfigLock(){
defaultSpeechUnlock1 = "%devicename% is now unlocked"
defaultSpeechLock1 = "%devicename% is now locked"
}
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: "lockTestOnUnlock1", type: "bool", title: "Toggle to test unlock phrase", required: false, defaultValue: false, submitOnChange: true
input name: "lockTalkOnLock1", type: "text", title: "Say this when locked:", required: false, defaultValue: defaultSpeechLock1
input name: "lockTestOnLock1", type: "bool", title: "Toggle to test lock phrase", required: false, defaultValue: false, submitOnChange: true
input name: "lockPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "lockSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "lockDeviceGroup1", type: "capability.lock", title: "${formatSettingRootStart}Lock(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "lockTalkOnUnlock1", type: "text", title: "${formatSettingRootStart}Say this when unlocked:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechUnlock1
input name: "lockTestOnUnlock1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test unlock phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "lockTalkOnLock1", type: "text", title: "${formatSettingRootStart}Say this when locked:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechLock1
input name: "lockTestOnLock1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test lock phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "lockPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"]
input name: "lockSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true
input name: "lockVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "lockVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "lockResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "lockVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
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))
input name: "lockDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "lockDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "lockModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "lockStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "lockEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.lockStartTime1 == null))
input name: "lockDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s${formatSettingOptionalEnd})", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "lockDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
section("Help"){
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -381,7 +409,12 @@ def pageConfigLock(){
}
def pageConfigContact(){
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigContact", title: "Configure talk on contact sensor", install: false, uninstall: false) {
//CONFIGURATION
section(){
def defaultSpeechOpen1 = ""
def defaultSpeechClosed1 = ""
......@@ -389,28 +422,30 @@ def pageConfigContact(){
defaultSpeechOpen1 = "%devicename% is now %devicechange%"
defaultSpeechClosed1 = "%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: "contactTestOnOpen1", type: "bool", title: "Toggle to test opened phrase", required: false, defaultValue: false, submitOnChange: true
input name: "contactTalkOnClosed1", type: "text", title: "Say this when closed:", required: false, defaultValue: defaultSpeechClosed1
input name: "contactTestOnClosed1", type: "bool", title: "Toggle to test closed phrase", required: false, defaultValue: false, submitOnChange: true
input name: "contactPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "contactSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "contactDeviceGroup1", type: "capability.contactSensor", title: "${formatSettingRootStart}Contact sensor(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "contactTalkOnOpen1", type: "text", title: "${formatSettingRootStart}Say this when opened:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechOpen1
input name: "contactTestOnOpen1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test opened phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "contactTalkOnClosed1", type: "text", title: "${formatSettingRootStart}Say this when closed:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechClosed1
input name: "contactTestOnClosed1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test closed phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "contactPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingRootEnd}", required: false, options: ["Yes", "No"]
input name: "contactSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true
input name: "contactVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "contactVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "contactResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "contactVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
//IN DEVELOPMENT input name: "contactOpenThreshold", type: "number", title: "If it's open for more than this many minutes (default 0)", required: false, defaultValue: 0
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))
input name: "contactDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "contactDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
}
section("Help"){
input name: "contactModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "contactStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "contactEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.contactStartTime1 == null))
input name: "contactDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "contactDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -447,31 +482,38 @@ def pageConfigMode(){
locationmodes += it
}
LOGDEBUG("locationmodes=${locationmodes}", true)
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigMode", title: "Configure talk on home mode change", install: false, uninstall: false) {
//CONFIGURATION
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: "modeTalkOnChange1", type: "text", title: "Say this when home mode is changed", required: false, defaultValue: defaultSpeechMode1
input name: "modeTestOnChange1", type: "bool", title: "Toggle to test mode change phrase", required: false, defaultValue: false, submitOnChange: true
input name: "modePersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "modePhraseSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "modePhraseGroup1", type:"mode", title:"${formatSettingRootStart}When mode changes to:${formatSettingRootEnd}", required:false, multiple:true, submitOnChange:false
input name: "modeExcludePhraseGroup1", type: "mode", title: "${formatSettingOptionalStart}But not when changed from (optional):${formatSettingOptionalEnd}", required: false, multiple: true
input name: "modeTalkOnChange1", type: "text", title: "${formatSettingRootStart}Say this when home mode is changed${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechMode1
input name: "modeTestOnChange1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test mode change phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "modePersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"]
input name: "modePhraseSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true
input name: "modePhraseVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "modePhraseVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "modePhraseResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "modePhraseVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
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: false//(!(settings.modeStartTime1 == null))
input name: "modeDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "modeDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
//RESTRICTIONS
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "modeStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "modeEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: false//(!(settings.modeStartTime1 == null))
input name: "modeDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "modeDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
section("Help"){
//HELP
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -494,6 +536,10 @@ def pageConfigMode(){
}
def pageConfigThermostat(){
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigThermostat", title: "Configure talk when thermostat state is:", install: false, uninstall: false) {
section(){
def defaultSpeechIdle1 = ""
......@@ -506,31 +552,31 @@ def pageConfigThermostat(){
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: "thermostatTestOnIdle1", type: "bool", title: "Toggle to test Idle phrase", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnHeating1", type: "text", title: "Say this on change to heating:", required: false, defaultValue: defaultSpeechHeating1
input name: "thermostatTestOnHeating1", type: "bool", title: "Toggle to test Heating phrase", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnCooling1", type: "text", title: "Say this on change to cooling:", required: false, defaultValue: defaultSpeechCooling1
input name: "thermostatTestOnCooling1", type: "bool", title: "Toggle to test Cooling phrase", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnFan1", type: "text", title: "Say this on change to fan only:", required: false, defaultValue: defaultSpeechFan1
input name: "thermostatTestOnFan1", type: "bool", title: "Toggle to test Fan phrase", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "thermostatSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "thermostatDeviceGroup1", type: "capability.thermostat", title: "${formatSettingRootStart}Thermostat(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "thermostatTalkOnIdle1", type: "text", title: "${formatSettingRootStart}Say this on change to Idle:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechIdle1
input name: "thermostatTestOnIdle1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test Idle phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnHeating1", type: "text", title: "${formatSettingRootStart}Say this on change to heating:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechHeating1
input name: "thermostatTestOnHeating1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test Heating phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnCooling1", type: "text", title: "${formatSettingRootStart}Say this on change to cooling:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechCooling1
input name: "thermostatTestOnCooling1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test Cooling phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatTalkOnFan1", type: "text", title: "${formatSettingRootStart}Say this on change to fan only:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechFan1
input name: "thermostatTestOnFan1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test Fan phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "thermostatPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"]
input name: "thermostatSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true
input name: "thermostatVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "thermostatVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "thermostatResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "thermostatVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
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))
input name: "thermostatDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "thermostatDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "thermostatModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "thermostatStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "thermostatEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.thermostatStartTime1 == null))
input name: "thermostatDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "thermostatDisableSwitch1", type: "capability.switch", title: "${formatSettingOptionalStart}Disable when this switch is off${formatSettingOptionalEnd}", required: false, multiple: false
}
section("Help"){
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Help</CENTER>${formatSettingRootEnd}"){
href "pageHelpPhraseTokens", title:"Phrase Tokens", description:"Tap for a list of phrase tokens"
}
//Test Phrase Toggle Switch
......@@ -580,6 +626,10 @@ def pageConfigThermostat(){
}
def pageConfigAcceleration(){
def formatSettingRootStart = parent.returnVar("formatSettingRootStart")
def formatSettingRootEnd = parent.returnVar("formatSettingRootEnd")
def formatSettingOptionalStart = parent.returnVar("formatSettingOptionalStart")
def formatSettingOptionalEnd = parent.returnVar("formatSettingOptionalEnd")
dynamicPage(name: "pageConfigAcceleration", title: "Configure talk on acceleration", install: false, uninstall: false) {
section(){
def defaultSpeechActive1 = ""
......@@ -588,27 +638,27 @@ def pageConfigAcceleration(){
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: "accelerationTestOnActive1", type: "bool", title: "Toggle to test activate phrase", required: false, defaultValue: false, submitOnChange: true
input name: "accelerationTalkOnInactive1", type: "text", title: "Say this when inactivated:", required: false, defaultValue: defaultSpeechInactive1
input name: "accelerationTestOnInactive1", type: "bool", title: "Toggle to test inactivate phrase", required: false, defaultValue: false, submitOnChange: true
input name: "accelerationPersonality1", type: "enum", title: "Allow Personality (overrides default)?:", required: false, options: ["Yes", "No"]
input name: "accelerationSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "Talk with these text-to-speech devices (overrides default)", multiple: true, required: false
input name: "accelerationDeviceGroup1", type: "capability.accelerationSensor", title: "${formatSettingRootStart}Acceleration sensor(s)${formatSettingRootEnd}", required: false, multiple: true
input name: "accelerationTalkOnActive1", type: "text", title: "${formatSettingRootStart}Say this when activated:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechActive1
input name: "accelerationTestOnActive1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test activate phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "accelerationTalkOnInactive1", type: "text", title: "${formatSettingRootStart}Say this when inactivated:${formatSettingRootEnd}", required: false, defaultValue: defaultSpeechInactive1
input name: "accelerationTestOnInactive1", type: "bool", title: "${formatSettingOptionalStart}Toggle to test inactivate phrase${formatSettingOptionalEnd}", required: false, defaultValue: false, submitOnChange: true
input name: "accelerationPersonality1", type: "enum", title: "${formatSettingOptionalStart}Allow Personality (overrides default)?:${formatSettingOptionalEnd}", required: false, options: ["Yes", "No"]
input name: "accelerationSpeechDevice1", type: parent.returnVar("speechDeviceType"), title: "${formatSettingOptionalStart}Talk with these text-to-speech devices (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
if (parent.returnVar("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.returnVar("resumePlay") == false) ? false : true
input name: "accelerationVoice1", type: "enum", title: "Voice (overrides default):", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
input name: "accelerationVolume1", type: "number", title: "${formatSettingOptionalStart}Set volume to (overrides default):${formatSettingOptionalEnd}", required: false
input name: "accelerationResumePlay1", type: "bool", title: "${formatSettingOptionalStart}Attempt to resume playing audio?${formatSettingOptionalEnd}", required: false, defaultValue: (parent.returnVar("resumePlay") == false) ? false : true
input name: "accelerationVoice1", type: "enum", title: "${formatSettingOptionalStart}Voice (overrides default):${formatSettingOptionalEnd}", options: parent.returnVar("supportedVoices"), required: false, submitOnChange: true
}
}
section("Restrictions"){
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))
input name: "accelerationDays1", type: "enum", title: "Restrict to these day(s)", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true
input name: "accelerationDisableSwitch1", type: "capability.switch", title: "Disable when this switch is off", required: false, multiple: false
section("<BR><HR><HR>${formatSettingRootStart}<CENTER>Restrictions</CENTER>${formatSettingRootEnd}"){
input name: "accelerationModes1", type: "mode", title: "${formatSettingOptionalStart}Talk when in these mode(s) (overrides default)${formatSettingOptionalEnd}", multiple: true, required: false
input name: "accelerationStartTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk before (overrides default)${formatSettingOptionalEnd}", required: false, submitOnChange: true
input name: "accelerationEndTime1", type: "time", title: "${formatSettingOptionalStart}Don't talk after (overrides default)${formatSettingOptionalEnd}", required: (!(settings.accelerationStartTime1 == null))
input name: "accelerationDays1", type: "enum", title: "${formatSettingOptionalStart}Restrict to these day(s)${formatSettingOptionalEnd}", required: false, options: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], multiple: true