Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5140022
Initial commit - added safety shutoff
bstewart-cae Mar 17, 2026
1ef7df8
wip: fixed issues with bootup and missing handlers. removed reference…
bstewart-cae Mar 23, 2026
96c1d6d
Added missing sound reference to config files
bstewart-cae Mar 23, 2026
6436bb2
WIP: Tested Electric and Gas units. Added Application Rejection handl…
bstewart-cae Mar 24, 2026
0e3f8e8
continued work on device capabilities and UI mapping.
bstewart-cae Mar 30, 2026
c0d4143
WIP: replaced powermeter with appliance utilization.
bstewart-cae Apr 2, 2026
290ca2d
Moved capabilities for consistency across device types
bstewart-cae Apr 3, 2026
bba2705
Fixed issues with detail view on electric units. Added switch handler…
bstewart-cae Apr 17, 2026
4462028
Merge branch 'main' into feature/add-safety-shutoff
bstewart-cae Apr 17, 2026
8dcc524
bug: removed extraneous undefined variable reference
bstewart-cae Apr 20, 2026
f3fda9f
feat: removed unused capabilities, added refresh, fixed issues with n…
bstewart-cae Jul 22, 2026
e458f92
commented out automation section
bstewart-cae Aug 5, 2026
6ef1b85
fix: Updated gas to use safetyValve rather than the switch capability…
bstewart-cae Aug 14, 2026
650a06f
Updated PR with suggested profile configuration, fixed event handling…
bstewart-cae Sep 16, 2026
c7dd702
Merge branch 'main' into feature/add-safety-shutoff
bstewart-cae Sep 16, 2026
9f755bc
Fix: update aliases on dashboard view
bstewart-cae Sep 16, 2026
65c0af3
Fixed CI failures in scripts and yml files
bstewart-cae Sep 17, 2026
baab4a1
Added missing labels on dashboard view, updated copyright notices
bstewart-cae Sep 21, 2026
1edd580
Update drivers/SmartThings/zwave-safety-shutoff/profiles/fireavert-ap…
bstewart-cae Dec 1, 2026
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
6 changes: 6 additions & 0 deletions drivers/SmartThings/zwave-safety-shutoff/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: 'Z-Wave Appliance Safety'
packageKey: 'zwave-appliance-safety'
permissions:
zwave: {}
description: "SmartThings driver for Z-Wave appliance safety devices."
vendorSupportInformation: "https://support.smartthings.com"
26 changes: 26 additions & 0 deletions drivers/SmartThings/zwave-safety-shutoff/fingerprints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
zwaveManufacturer:
- id: "FireAvert/Shutoff/Gas"
deviceLabel: FireAvert Shutoff for Gas Appliances
manufacturerId: 0x045D
productType: 0x0004
productId: 0x1601
deviceProfileName: fireavert-appliance-shutoff-gas
- id: "FireAvert/Shutoff/120v"
deviceLabel: FireAvert Shutoff for Electric Appliances
manufacturerId: 0x045D
productType: 0x0004
productId: 0x0601
deviceProfileName: fireavert-appliance-shutoff-electric
- id: "FireAvert/Shutoff/240v3"
deviceLabel: FireAvert Shutoff for Electric Appliances
manufacturerId: 0x045D
productType: 0x0004
productId: 0x0602
deviceProfileName: fireavert-appliance-shutoff-electric
- id: "FireAvert/Shutoff/240v4"
deviceLabel: FireAvert Shutoff for Electric Appliances
manufacturerId: 0x045D
productType: 0x0004
productId: 0x0603
deviceProfileName: fireavert-appliance-shutoff-electric

Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: fireavert-appliance-shutoff-electric
components:
- id: main
label: "FireAvert Information"
capabilities:
- id: refresh
version: 1
- id: soundDetection
version: 1
- id: switch
version: 1
categories:
- name: Switch
- id: appliancePower
label: "Appliance Power"
capabilities:
- id: applianceUtilization
version: 1
deviceConfig:
dashboard:
states:
- component: main
capability: soundDetection
values:
- key: soundDetected.value
alternatives:
- key: noSound
value: "No Alarm"
type: inactive
- key: fireAlarm
value: "Fire Alarm Detected"
type: active
enabledValues:
- noSound
- fireAlarm
detailView:
- component: main
capability: soundDetection
values:
- key: soundDetected.value
alternatives:
- key: noSound
value: "No Alarm"
type: inactive
- key: fireAlarm
value: "Fire Alarm Detected"
type: active
enabledValues:
- noSound
- fireAlarm
- component: main
capability: switch
version: 1
- component: appliancePower
capability: applianceUtilization
version: 1
values:
- key: status.value
alternatives:
- key: inUse
value: "Appliance Powered On"
type: active
- key: notInUse
value: "Appliance Powered Off"
type: inactive
automation:
conditions:
- component: main
capability: soundDetection
version: 1
- component: main
capability: switch
version: 1
- component: appliancePower
capability: applianceUtilization
version: 1
actions:
- component: main
capability: switch
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: fireavert-appliance-shutoff-gas
components:
- id: main
label: "FireAvert Information"
capabilities:
- id: refresh
version: 1
- id: soundDetection
version: 1
- id: safetyValve
version: 1
categories:
- name: SmokeDetector
deviceConfig:
dashboard:
states:
- component: main
capability: soundDetection
values:
- key: soundDetected.value
alternatives:
- key: noSound
value: "No Alarm"
type: inactive
- key: fireAlarm
value: "Fire Alarm Detected"
type: active
enabledValues:
- noSound
- fireAlarm
version: 1
- component: main
capability: safetyValve
version: 1
detailView:
- component: main
capability: soundDetection
version: 1
values:
- key: soundDetected.value
alternatives:
- key: noSound
value: "No Alarm"
type: inactive
- key: fireAlarm
value: "Fire Alarm Detected"
type: active
enabledValues:
- noSound
- fireAlarm
- component: main
capability: safetyValve
version: 1
automation:
conditions:
- component: main
capability: soundDetection
version: 1
values:
- key: soundDetected.value
enabledValues:
- fireAlarm
- noSound
- component: main
capability: safetyValve
version: 1
actions:
- component: main
capability: safetyValve
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local capabilities = require "st.capabilities"
--- @type st.zwave.CommandClass
local cc = require "st.zwave.CommandClass"
--- @type st.zwave.CommandClass.ApplicationStatus
local ApplicationStatus = (require "st.zwave.CommandClass.ApplicationStatus")({ version = 1 })
--- @type st.zwave.CommandClass.SwitchBinary
local SwitchBinary = (require "st.zwave.CommandClass.SwitchBinary")({ version = 2 })

local FIREAVERT_APPLIANCE_SHUTOFF_FINGERPRINTS = {
{ manufacturerId = 0x045D, productType = 0x0004, productId = 0x0601 }, -- FireAvert Appliance Shutoff - 120V
{ manufacturerId = 0x045D, productType = 0x0004, productId = 0x0602 }, -- FireAvert Appliance Shutoff - 240V 3 Prong
{ manufacturerId = 0x045D, productType = 0x0004, productId = 0x0603 }, -- FireAvert Appliance Shutoff - 240V 4 Prong
}
--- Determine whether the passed device is a FireAvert shutoff device. All devices use the same driver.
local function can_handle_fireavert_appliance_shutoff_e(opts, driver, device, ...)
local isDevice = false
for _, fingerprint in ipairs(FIREAVERT_APPLIANCE_SHUTOFF_FINGERPRINTS) do
if device:id_match(fingerprint.manufacturerId, fingerprint.productType, fingerprint.productId) then
isDevice = true
break
end
end
if true == isDevice then
local subdriver = require("fireavert-appliance-shutoff-electric")
return true, subdriver
else return false end
end

--- Only ever fires when the device attempts to turn the switch back on and this is rejected.
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @param cmd st.zwave.CommandClass.ApplicationStatus.ApplicationRejectedRequest
local function app_rejected_handler(driver, device, cmd)
print("Application rejected received from device, unable to rearm")
--- Reset the UI switch to match the current relay state.
device:emit_event(capabilities.switch.switch.off({state_change = true}))
end


--- Handle a Switch OFF command from the application.
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @param command ST level capability command
local function st_switch_off_handler(driver, device, command)
device:send(SwitchBinary:Set({
target_value = SwitchBinary.value.OFF_DISABLE,
duration = 0
})
)
device:send(SwitchBinary:Get({}))
end

--- Handle a Switch ON command from the application.
--- Switching on is not allowed in some cases, so that is handled through the ApplicationRejected
--- handler.
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @param command ST level capability command
local function st_switch_on_handler(driver, device, command)
device:send(SwitchBinary:Set({
target_value = SwitchBinary.value.ON_ENABLE,
duration = 0
})
)
device:send(SwitchBinary:Get({}))
end


--- Configuration lifecycle event handler.
---
--- Send refresh GETs and manufacturer-specific configuration for
--- the FireAvert Appliance Shutoff device
---
--- @param self st.zwave.Driver
--- @param device st.zwave.Device
local function do_configure(self, device)
device:refresh()
end

local fireavert_appliance_shutoff_e = {
zwave_handlers = {
[cc.APPLICATION_STATUS] = {
[ApplicationStatus.APPLICATION_REJECTED_REQUEST] = app_rejected_handler,
}
},
capability_handlers = {
[capabilities.switch.ID] = {
[capabilities.switch.commands.off.NAME] = st_switch_off_handler,
[capabilities.switch.commands.on.NAME] = st_switch_on_handler
},
},
lifecycle_handlers = {
doConfigure = do_configure,
},
NAME = "FireAvert Appliance Shutoff - Electric",
can_handle = can_handle_fireavert_appliance_shutoff_e
}

return fireavert_appliance_shutoff_e
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local capabilities = require "st.capabilities"
--- @type st.zwave.CommandClass.SwitchBinary
local SwitchBinary = (require "st.zwave.CommandClass.SwitchBinary")({ version = 2 })

local FIREAVERT_APPLIANCE_SHUTOFF_FINGERPRINTS = {
{ manufacturerId = 0x045D, productType = 0x0004, productId = 0x1601 } -- FireAvert Appliance Shutoff - Gas
}
--- Determine whether the passed device is a FireAvert shutoff device. All devices use the same driver.
local function can_handle_fireavert_appliance_shutoff_gas(opts, driver, device, ...)
local isDevice = false
for _, fingerprint in ipairs(FIREAVERT_APPLIANCE_SHUTOFF_FINGERPRINTS) do
if device:id_match(fingerprint.manufacturerId, fingerprint.productType, fingerprint.productId) then
isDevice = true
break
end
end
if true == isDevice then
local subdriver = require("fireavert-appliance-shutoff-gas")
return true, subdriver
else return false end
end

--- Handle a Valve Close command from the application.
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @param command ST close valve command
local function st_close_valve(driver, device, command)
device:send(SwitchBinary:Set({
target_value = SwitchBinary.value.OFF_DISABLE,
duration = 0
})
)
-- Refresh valve state
device:send(SwitchBinary:Get({}))
end

--- Configuration lifecycle event handler.
---
--- Send refresh GETs and manufacturer-specific configuration for
--- the FireAvert Appliance Shutoff device
---
--- @param self st.zwave.Driver
--- @param device st.zwave.Device
local function do_configure(self, device)
device:refresh()
end

local fireavert_appliance_shutoff_g = {
capability_handlers = {
[capabilities.safetyValve.ID] = {
[capabilities.safetyValve.commands.close.NAME] = st_close_valve
}
},
lifecycle_handlers = {
doConfigure = do_configure,
},
NAME = "FireAvert Appliance Shutoff - Gas",
can_handle = can_handle_fireavert_appliance_shutoff_gas
}

return fireavert_appliance_shutoff_g
Loading
Loading