[ST Edge] First Alert Smoke and CO Detector (ZCOMBO)

When I pair the First Alert Smoke and CO Detector (ZCOMBO) with the stock ST beta Z-wave Smoke Detector driver I have the following problems:

  1. CO shows off line and does not respond to testing.
  2. When I test the unit the only way to reset it is to remove the batteries and re-install them.

Any advice in how to fix this?

The fingerprints match.

IDE finger print: zw:S type:A100 mfr:0138 prod:0001 model:0002 ver:0.05 zwv:3.52 lib:06 cc:20,80,70,85,71,72,86

Driver Fingerprint:

  • id: “FirstAlert”
    deviceLabel: First Alert Smoke Alarm
    manufacturerId: 0x0138
    productType: 0x0001
    productId: 0x0002
    deviceProfileName: smoke-co-battery

pairing Logs:

2022-03-29T00:27:47.496780186+00:00 TRACE Z-Wave Smoke Alarm Setup driver zwave_smoke_co_detector with lifecycle handlers:
DeviceLifecycleDispatcher: zwave_smoke_co_detector
default_handlers:
driverSwitched:
infoChanged:
init:
doConfigure:
child_dispatchers:
DeviceLifecycleDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V1
default_handlers:
child_dispatchers:
DeviceLifecycleDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2
default_handlers:
added:
child_dispatchers:
DeviceLifecycleDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2 → Fibaro CO sensor zw5
default_handlers:
init:
doConfigure:
infoChanged:
child_dispatchers:
DeviceLifecycleDispatcher: zwave_smoke_co_detector → fibaro smoke sensor
default_handlers:
added:
child_dispatchers:

2022-03-29T00:27:47.502358436+00:00 TRACE Z-Wave Smoke Alarm Setup driver zwave_smoke_co_detector with Capability handlers:
CapabilityCommandDispatcher: zwave_smoke_co_detector
default_handlers:
refresh:
refresh
child_dispatchers:
CapabilityCommandDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V1
default_handlers:
child_dispatchers:
CapabilityCommandDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2
default_handlers:
child_dispatchers:
CapabilityCommandDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2 → Fibaro CO sensor zw5
default_handlers:
child_dispatchers:
CapabilityCommandDispatcher: zwave_smoke_co_detector → fibaro smoke sensor
default_handlers:
child_dispatchers:

2022-03-29T00:27:47.507067061+00:00 TRACE Z-Wave Smoke Alarm Setup driver zwave_smoke_co_detector with Z-Wave handlers:
ZwaveDispatcher: zwave_smoke_co_detector
default_handlers:
SENSOR_BINARY:
REPORT
SENSOR_MULTILEVEL:
REPORT
SENSOR_ALARM:
REPORT
NOTIFICATION:
REPORT
WAKE_UP:
NOTIFICATION
BATTERY:
REPORT
child_dispatchers:
ZwaveDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V1
default_handlers:
NOTIFICATION:
REPORT
child_dispatchers:
ZwaveDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2
default_handlers:
NOTIFICATION:
REPORT
child_dispatchers:
ZwaveDispatcher: zwave_smoke_co_detector → Z-Wave smoke and CO alarm V2 → Fibaro CO sensor zw5
default_handlers:
CONFIGURATION:
REPORT
child_dispatchers:
ZwaveDispatcher: zwave_smoke_co_detector → fibaro smoke sensor
default_handlers:
WAKE_UP:
NOTIFICATION
child_dispatchers:

2022-03-29T00:27:47.533432644+00:00 TRACE Z-Wave Smoke Alarm Received event with handler resync
2022-03-29T00:27:47.537532227+00:00 TRACE Z-Wave Smoke Alarm Received event with handler environment_info
2022-03-29T00:27:47.558345561+00:00 TRACE Z-Wave Smoke Alarm Found DeviceLifecycleDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:27:47.577422769+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:27:47.582016936+00:00 TRACE Z-Wave Smoke Alarm Received event with handler environment_info
2022-03-29T00:27:47.585058728+00:00 DEBUG Z-Wave Smoke Alarm Z-Wave hub node ID environment changed.
2022-03-29T00:27:47.596081019+00:00 TRACE Z-Wave Smoke Alarm Received event with handler device_lifecycle
2022-03-29T00:27:47.599220728+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received lifecycle event: added
2022-03-29T00:27:47.604185144+00:00 TRACE Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received unhandled lifecycle event: added
2022-03-29T00:27:47.607326186+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:27:47.610675103+00:00 TRACE Z-Wave Smoke Alarm Received event with handler device_lifecycle
2022-03-29T00:27:47.613928853+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received lifecycle event: doConfigure
2022-03-29T00:27:47.619591311+00:00 TRACE Z-Wave Smoke Alarm Found DeviceLifecycleDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:27:47.622807269+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:27:47.632630894+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:27:47.844791436+00:00 TRACE Z-Wave Smoke Alarm Received event with handler device_lifecycle
2022-03-29T00:27:47.854897228+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received lifecycle event: infoChanged
2022-03-29T00:27:47.860641269+00:00 TRACE Z-Wave Smoke Alarm Found DeviceLifecycleDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:27:47.863793728+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:28:28.252251664+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:28:28.259569872+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="
", src_channel=0, version=1}
2022-03-29T00:28:28.275483789+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:28:28.279613955+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:28:28.289426205+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:28:28.368533164+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:28:28.375343497+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="", src_channel=0, version=1}
2022-03-29T00:28:28.384803955+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:28:28.388403539+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:28:28.397005747+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:28:28.668565747+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:28:28.675013955+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="
", src_channel=0, version=1}
2022-03-29T00:28:28.684588664+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:28:28.688235955+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:28:28.696749039+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:28:29.078554122+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:28:29.084804414+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="", src_channel=0, version=1}
2022-03-29T00:28:29.094207789+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:28:29.097780081+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:28:29.106380706+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:28:29.352459956+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:28:29.358828247+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="
", src_channel=0, version=1}
2022-03-29T00:28:29.369203997+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:28:29.372861789+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:28:29.382367289+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled

Logs when pushing test button:

2022-03-29T00:31:11.447535477+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:31:11.507875393+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={alarm_level=255, alarm_type=12}, cmd_class=“NOTIFICATION”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="\x0C\xFF", src_channel=0, version=1}
2022-03-29T00:31:11.514517727+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector → Z-Wave smoke and CO alarm V1
2022-03-29T00:31:11.525189643+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“smokeDetector”,“state”:{“value”:“tested”},“attribute_id”:“smoke”,“component_id”:“main”}
2022-03-29T00:31:11.549080477+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:31:28.000104026+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:31:28.006510526+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={alarm_level=0, alarm_type=12}, cmd_class=“NOTIFICATION”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="\x0C\x00", src_channel=0, version=1}
2022-03-29T00:31:28.033347860+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector → Z-Wave smoke and CO alarm V1
2022-03-29T00:31:28.051091860+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“smokeDetector”,“state”:{“value”:“tested”},“attribute_id”:“smoke”,“component_id”:“main”}
2022-03-29T00:31:28.092488068+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled
2022-03-29T00:31:28.108527651+00:00 TRACE Z-Wave Smoke Alarm Received event with handler unnamed
2022-03-29T00:31:28.117285735+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={battery_level=95}, cmd_class=“BATTERY”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="_", src_channel=0, version=1}
2022-03-29T00:31:28.134891193+00:00 TRACE Z-Wave Smoke Alarm Found ZwaveDispatcher handler in zwave_smoke_co_detector
2022-03-29T00:31:28.149947651+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> emitting event: {“capability_id”:“battery”,“state”:{“value”:95},“attribute_id”:“battery”,“component_id”:“main”}
2022-03-29T00:31:28.164893235+00:00 DEBUG Z-Wave Smoke Alarm First Alert Smoke Detector device thread event handled

Main driver:

– Copyright 2021 SmartThings

– Licensed under the Apache License, Version 2.0 (the “License”);
– you may not use this file except in compliance with the License.
– You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

– Unless required by applicable law or agreed to in writing, software
– distributed under the License is distributed on an “AS IS” BASIS,
– WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
– See the License for the specific language governing permissions and
– limitations under the License.

local capabilities = require “st.capabilities”
@type st.zwave.CommandClass
local cc = require “st.zwave.CommandClass”
@type st.zwave.Driver
local ZwaveDriver = require “st.zwave.driver”
@type st.zwave.defaults
local defaults = require “st.zwave.defaults”
@type st.zwave.CommandClass.Configuration
local Configuration = (require “st.zwave.CommandClass.Configuration”)({ version=4 })
local preferencesMap = require “preferences”

— Update preference

@param device st.zwave.Device
@param args
local function update_preference(self, device, args)
local preferences = preferencesMap.get_device_parameters(device)
for id, value in pairs(device.preferences) do
if args.old_st_store.preferences[id] ~= value and preferences and preferences[id] then
local new_parameter_value = preferencesMap.to_numeric_value(device.preferences[id])
device:send(Configuration:Set({parameter_number = preferences[id].parameter_number, size = preferences[id].size, configuration_value = new_parameter_value}))
end
end
end

— Initialize device

@param self st.zwave.Driver
@param device st.zwave.Device
local device_init = function(self, device)
device:set_update_preferences_fn(update_preference)
end

— Handle preference changes

@param driver st.zwave.Driver
@param device st.zwave.Device
@param event table
@param args
local function info_changed(driver, device, event, args)
if not device:is_cc_supported(cc.WAKE_UP) then
update_preference(self, device, args)
end
end

local driver_template = {
supported_capabilities = {
capabilities.smokeDetector,
capabilities.carbonMonoxideDetector,
capabilities.battery,
capabilities.tamperAlert,
capabilities.temperatureAlarm,
capabilities.temperatureMeasurement
},
sub_drivers = {
require(“zwave-smoke-co-alarm-v1”),
require(“zwave-smoke-co-alarm-v2”),
require(“fibaro-smoke-sensor”)
},
lifecycle_handlers = {
init = device_init,
infoChanged = info_changed
}
}

defaults.register_for_default_handlers(driver_template, driver_template.supported_capabilities)
local detector = ZwaveDriver(“zwave_smoke_co_detector”, driver_template)
detector:run()

Sub Driver with fingerprint:

– Copyright 2021 SmartThings

– Licensed under the Apache License, Version 2.0 (the “License”);
– you may not use this file except in compliance with the License.
– You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

– Unless required by applicable law or agreed to in writing, software
– distributed under the License is distributed on an “AS IS” BASIS,
– WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
– See the License for the specific language governing permissions and
– limitations under the License.

local capabilities = require “st.capabilities”
@type st.zwave.CommandClass
local cc = require “st.zwave.CommandClass”
@type st.zwave.CommandClass.Alarm
local Alarm = (require “st.zwave.CommandClass.Alarm”)({ version = 1 })

local SMOKE_CO_ALARM_FINGERPRINTS = {
{ manufacturerId = 0x0138, productType = 0x0001, productId = 0x0002 }, – First Alert Smoke Detector
}

— Determine whether the passed device is Smoke Alarm

@param driver st.zwave.Driver
@param device st.zwave.Device
@return boolean true if the device is smoke co alarm
local function can_handle_v1_alarm(opts, driver, device, cmd, …)
if cmd.version == 1 then
– we only handle v1 reports; this is Notification V3 ( or higher) command
for _, fingerprint in ipairs(SMOKE_CO_ALARM_FINGERPRINTS) do
if device:id_match( fingerprint.manufacturerId, fingerprint.productType, fingerprint.productId) then
return true
end
end
end
return false
end

— Default handler for alarm command class reports

— This converts alarm V1 reports to correct smoke events

@param self st.zwave.Driver
@param device st.zwave.Device
@param cmd st.zwave.CommandClass.Alarm.Report
local function alarm_report_handler(self, device, cmd)
if cmd.args.alarm_type == Alarm.z_wave_alarm_type.SMOKE then
if cmd.args.alarm_level == 0 then
device:emit_event(capabilities.smokeDetector.smoke.clear())
else
device:emit_event(capabilities.smokeDetector.smoke.detected())
end
elseif cmd.args.alarm_type == Alarm.z_wave_alarm_type.CO then
if cmd.args.alarm_level == 0 then
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.clear())
else
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.detected())
end
elseif cmd.args.alarm_type == 12 then – undocumented value
device:emit_event(capabilities.smokeDetector.smoke.tested())
elseif cmd.args.alarm_type == 13 then – undocumented value
device:emit_event(capabilities.smokeDetector.smoke.clear())
end
end

local zwave_alarm = {
zwave_handlers = {
[cc.ALARM] = {
– also shall handle cc.ALARM
[Alarm.REPORT] = alarm_report_handler
}
},
NAME = “Z-Wave smoke and CO alarm V1”,
can_handle = can_handle_v1_alarm,
}

return zwave_alarm

Screen shot

The driver doesn’t initialize the Smoke/CO values like the DTH did. You could put that into the Added lifecycle as one solution, or just get the Test button to properly cycle through status for both capabilities.

Your logs show the test button returning the two z-wave commands below. According to the DTH, the first one (level FF) indicates the test, and the second one (level 00) indicates all clear. The DTH shows the device sends just the one test command to indicate both Smoke and CO are tested.

2022-03-29T00:31:11.507875393+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={alarm_level=255, alarm_type=12}, cmd_class=“NOTIFICATION”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="\x0C\xFF", src_channel=0, version=1}
2022-03-29T00:31:28.006510526+00:00 INFO Z-Wave Smoke Alarm <ZwaveDevice: 43bceff4-0b45-46e2-ae30-7a0f14c2591b [7A] (First Alert Smoke Detector)> received Z-Wave command: {args={alarm_level=0, alarm_type=12}, cmd_class=“NOTIFICATION”, cmd_id=“REPORT”, dst_channels={}, encap=“NONE”, payload="\x0C\x00", src_channel=0, version=1}

This code in the current driver is interpreting both of those lines as just smoke tested:

elseif cmd.args.alarm_type == 12 then -- undocumented value
    device:emit_event(capabilities.smokeDetector.smoke.tested())

Changing it to this below should result in both capabilities getting a tested event from the FF level command and a clear event from the 00 level command that follows:

elseif cmd.args.alarm_type == 12 then -- undocumented value
    if cmd.args.alarm_level == 0 then
        device:emit_event(capabilities.smokeDetector.smoke.clear())
        device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.clear())
    else
        device:emit_event(capabilities.smokeDetector.smoke.tested())
        device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.tested())
    end

The only thing that concerns me a bit is that when you replace batteries, you’re seeing the smoke capability set to clear but not the CO capability. What kind of z-wave commands are you seeing in logs when you change batteries?

Phil, Thanks for jumping in.
I made the suggested changes, now nothing shows up in APP or CLI when I test the detector.

Revised sub-driver is shown below:

– Copyright 2021 SmartThings

– Licensed under the Apache License, Version 2.0 (the “License”);
– you may not use this file except in compliance with the License.
– You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

– Unless required by applicable law or agreed to in writing, software
– distributed under the License is distributed on an “AS IS” BASIS,
– WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
– See the License for the specific language governing permissions and
– limitations under the License.

local capabilities = require “st.capabilities”
@type st.zwave.CommandClass
local cc = require “st.zwave.CommandClass”
@type st.zwave.CommandClass.Alarm
local Alarm = (require “st.zwave.CommandClass.Alarm”)({ version = 1 })

local SMOKE_CO_ALARM_FINGERPRINTS = {
{ manufacturerId = 0x0138, productType = 0x0001, productId = 0x0002 }, – First Alert Smoke Detector
}

— Determine whether the passed device is Smoke Alarm

@param driver st.zwave.Driver
@param device st.zwave.Device
@return boolean true if the device is smoke co alarm
local function can_handle_v1_alarm(opts, driver, device, cmd, …)
if cmd.version == 1 then
– we only handle v1 reports; this is Notification V3 ( or higher) command
for _, fingerprint in ipairs(SMOKE_CO_ALARM_FINGERPRINTS) do
if device:id_match( fingerprint.manufacturerId, fingerprint.productType, fingerprint.productId) then
return true
end
end
end
return false
end

— Default handler for alarm command class reports

— This converts alarm V1 reports to correct smoke events

@param self st.zwave.Driver
@param device st.zwave.Device
@param cmd st.zwave.CommandClass.Alarm.Report
local function alarm_report_handler(self, device, cmd)
if cmd.args.alarm_type == Alarm.z_wave_alarm_type.SMOKE then
if cmd.args.alarm_level == 0 then
device:emit_event(capabilities.smokeDetector.smoke.clear())
else
device:emit_event(capabilities.smokeDetector.smoke.detected())
end
elseif cmd.args.alarm_type == Alarm.z_wave_alarm_type.CO then
if cmd.args.alarm_level == 0 then
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.clear())
else
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.detected())
end
elseif cmd.args.alarm_type == 12 then – undocumented value
if cmd.args.alarm_level == 0 then
device:emit_event(capabilities.smokeDetector.smoke.clear())
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.clear())
else
device:emit_event(capabilities.smokeDetector.smoke.tested())
device:emit_event(capabilities.carbonMonoxideDetector.carbonMonoxide.tested())
end
elseif cmd.args.alarm_type == 13 then – undocumented value
device:emit_event(capabilities.smokeDetector.smoke.clear())
end
end

local zwave_alarm = {
zwave_handlers = {
[cc.ALARM] = {
– also shall handle cc.ALARM
[Alarm.REPORT] = alarm_report_handler
}
},
NAME = “Z-Wave smoke and CO alarm V1”,
can_handle = can_handle_v1_alarm,
}

return zwave_alarm

I have Z-Combo with fingerprint products id 3 that works great


I had to add new fingerprint. I haven’t made any changes to the driver.
Maybe try to pair it again

I don’t see any errors in that other than the weird stuff the forum does to formatting. One thing the forum is doing that impacts that bit of code I posted is to combine multiple hyphens together into a different character. So – undocumented value needs to be -- undocumented value. I’m going to edit my prior post to get that corrected, but if it’s showing as a single hyphen in your code then delete the hyphen character and type two new hyphens (or just delete the comment since it isn’t necessary).

Otherwise, if you’re not seeing anything in the CLI - not even the incoming z-wave commands - then you may need to try rebooting your hub and/or packaging/installing your driver again. If you’re at least seeing some activity in the CLI, but this code isn’t working, then I would troubleshoot by adding some log lines to figure out what is/isn’t working.

The driver as written will only populate a value to CO when it receives a CO clear or detected z-wave command from the device. Your device must send those on join or when the battery is changed. Paul’s model looks to be an older non-plus device while yours appears to be a newer z-wave plus device, so I wouldn’t be surprised if they behave differently.

1 Like

Thank you Phil.

I replaced the single elongated hyphen with 2 hyphens and rebooted the hub as you suggested.

That solved the problem.

Now both smoke and CO are live. When I push the test button they both show testing and they automatically reset.

When I test with canned smoke it goes into alarm and automatically resets when the agent clears. I do not have CO test gas so I could not live test the CO.

The only minor thing is that on the device tile it shows an active (colored) icon and says connected instead of clear.

Thanks again for helping to get these detectors back online.

We used to test CO meters on job sites by taking a grocery or garbage bag and “filling” it with car exhaust then covering up the sensor with the bag…

1 Like

I’m away from my computer today but my first guess would be that the smokeDetector capability doesn’t have a dashboard presentation defined.

I think the ideal dashboard solution would be to create a custom capability that combines smoke and CO status. Happy to help if you want to work through that.

1 Like

Thanks, that would be great.

It is a known and reported problem, common to all smoke sensors.
It is assumed that one day they will fix it.
I don’t know if @nayelyz knows anything new about this problem

2 Likes

There are no updates yet, sorry about that…I’m trying to escalate further the report…

3 Likes

In case it’s any help, I’ve seen that on my.smartthings.com, the status on the dashboard and the icon work perfectly.
It is in the app where it does not work well


1 Like

Yes, I just looked and it does look correct in the web portal.

@Mariano_Colmenarejo @Paul_Oliver

I am curious if you all have any update on this driver as I can only get it to show up as a sensor and it seems that zwave plus secure connections are not being accepted by this device? Any update would be a huge help! Thanks

My First Alert Z-Combo works with both the ST Beta “Z-wave Smoke Alarm” driver and Mariano’s “Z-Wave Smoke Alarm Mc” driver.

You might need to exclude your detector and re-pair it next to your hub after you install the needed driver.

And the S2 security is not necessary, so you can install it with out using S2 security.