Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ metadata {
input description: "Enter the menu by press and hold B-button for 3 seconds. Once indicator glows WHITE, release the B-button. Visual indicator will start changing colours in sequence. Press B-button briefly when visual indicator glows GREEN",
title: "To check smoke detection state", displayDuringSetup: true, type: "paragraph", element: "paragraph"
input description: "Please consult Fibaro Smoke Sensor operating manual for advanced setting options. You can skip this configuration to use default settings",
title: "Advanced Configuration", displayDuringSetup: true, type: "paragraph", element: "paragraph"
input "smokeSensorSensitivity", "enum", title: "Smoke Sensor Sensitivity", options: ["High","Medium","Low"], defaultValue: "${smokeSensorSensitivity}", displayDuringSetup: true
input "zwaveNotificationStatus", "enum", title: "Notifications Status", options: ["disabled","casing opened","exceeding temperature threshold", "lack of Z-Wave range", "all notifications"],
title: "Advanced settings", displayDuringSetup: true, type: "paragraph", element: "paragraph"
input "smokeSensorSensitivity", "enum", title: "Smoke sensor sensitivity", options: ["High", "Medium", "Low"], defaultValue: "${smokeSensorSensitivity}", displayDuringSetup: true
input "zwaveNotificationStatus", "enum", title: "Notifications", options: ["None", "Casing opened", "Exceeding temperature threshold", "Lack of Z-Wave range", "All"],
// defaultValue: "${zwaveNotificationStatus}", displayDuringSetup: true
//Setting the default to casing opened so it can work in SmartThings mobile app.
defaultValue: "casing opened", displayDuringSetup: true
input "visualIndicatorNotificationStatus", "enum", title: "Visual Indicator Notifications Status",
options: ["disabled","casing opened","exceeding temperature threshold", "lack of Z-Wave range", "all notifications"],
defaultValue: "Casing opened", displayDuringSetup: true
input "visualIndicatorNotificationStatus", "enum", title: "Visual indicator notifications status",
options: ["None", "Casing opened", "Exceeding temperature threshold", "Lack of Z-Wave range", "All"],
defaultValue: "${visualIndicatorNotificationStatus}", displayDuringSetup: true
input "soundNotificationStatus", "enum", title: "Sound Notifications Status",
options: ["disabled","casing opened","exceeding temperature threshold", "lack of Z-Wave range", "all notifications"],
input "soundNotificationStatus", "enum", title: "Sound notifications status",
options: ["None", "Casing opened", "Exceeding temperature threshold", "Lack of Z-Wave range", "All"],
defaultValue: "${soundNotificationStatus}", displayDuringSetup: true
input "temperatureReportInterval", "enum", title: "Temperature Report Interval",
options: ["reports inactive", "5 minutes", "15 minutes", "30 minutes", "1 hour", "6 hours", "12 hours", "18 hours", "24 hours"], defaultValue: "${temperatureReportInterval}", displayDuringSetup: true
input "temperatureReportHysteresis", "number", title: "Temperature Report Hysteresis", description: "Available settings: 1-100 C", range: "1..100", displayDuringSetup: true
input "temperatureThreshold", "number", title: "Overheat Temperature Threshold", description: "Available settings: 0 or 2-100 C", range: "0..100", displayDuringSetup: true
input "excessTemperatureSignalingInterval", "enum", title: "Excess Temperature Signaling Interval",
input "temperatureReportInterval", "enum", title: "Temperature report interval",
options: ["Reports inactive", "5 minutes", "15 minutes", "30 minutes", "1 hour", "6 hours", "12 hours", "18 hours", "24 hours"], defaultValue: "${temperatureReportInterval}", displayDuringSetup: true
input "temperatureReportHysteresis", "number", title: "Temperature report hysteresis", description: "Available settings: 1-100 C", range: "1..100", displayDuringSetup: true
input "temperatureThreshold", "number", title: "Overheat temperature threshold", description: "Available settings: 0 or 2-100 C", range: "0..100", displayDuringSetup: true
input "excessTemperatureSignalingInterval", "enum", title: "Excess temperature signaling interval",
options: ["5 minutes", "15 minutes", "30 minutes", "1 hour", "6 hours", "12 hours", "18 hours", "24 hours"], defaultValue: "${excessTemperatureSignalingInterval}", displayDuringSetup: true
input "lackOfZwaveRangeIndicationInterval", "enum", title: "Lack of Z-Wave Range Indication Interval",
input "lackOfZwaveRangeIndicationInterval", "enum", title: "Lack of Z-Wave range indication interval",
options: ["5 minutes", "15 minutes", "30 minutes", "1 hour", "6 hours", "12 hours", "18 hours", "24 hours"], defaultValue: "${lackOfZwaveRangeIndicationInterval}", displayDuringSetup: true
}
tiles (scale: 2){
Expand Down Expand Up @@ -119,9 +119,28 @@ metadata {

def updated() {
log.debug "Updated with settings: ${settings}"
if(!state.legacySettingsUpdated) updateLegacySettings()
setConfigured("false") //wait until the next time device wakeup to send configure command
}

def updateLegacySettings() {

def legacyNotificationOptionMap = [
"disabled" : "None",
"casing opened" : "Casing opened",
"exceeding temperature threshold" : "Exceeding temperature threshold",
"lack of Z-Wave range" : "Lack of Z-Wave range",
"all notifications" : "All"
]

device.updateSetting("temperatureReportInterval", temperatureReportInterval == "reports inactive" ?: "Reports inactive")

device.updateSetting("zwaveNotificationStatus", legacyNotificationOptionMap[zwaveNotificationStatus] ?: zwaveNotificationStatus)
device.updateSetting("visualIndicatorNotificationStatus", legacyNotificationOptionMap[visualIndicatorNotificationStatus] ?: visualIndicatorNotificationStatus)
device.updateSetting("soundNotificationStatus", legacyNotificationOptionMap[soundNotificationStatus] ?: soundNotificationStatus)

state.legacySettingsUpdated = true
}


def parse(String description) {
Expand Down Expand Up @@ -481,15 +500,15 @@ private def getTimeOptionValueMap() { [
"12 hours" : 4320,
"18 hours" : 6480,
"24 hours" : 8640,
"reports inactive" : 0,
"Reports inactive" : 0,
]}

private def getNotificationOptionValueMap() { [
"disabled" : 0,
"casing opened" : 1,
"exceeding temperature threshold" : 2,
"lack of Z-Wave range" : 4,
"all notifications" : 7,
"None" : 0,
"Casing opened" : 1,
"Exceeding temperature threshold" : 2,
"Lack of Z-Wave range" : 4,
"All" : 7,
]}

private command(physicalgraph.zwave.Command cmd) {
Expand Down
Loading