- Delete the device from ST
- Delete my driver
- Install the Zigbee Smoke Detector - frient Heat STHM driver
- Add device
I had a closer look at the stock SmartThings Zigbee Smoke Detector driver, and the interesting part is that no Lua code change was actually necessary.
The driver was already prepared for exactly this situation.
The Frient HESZB-120 uses the dedicated frient subdriver, and its IAS alarm handling already checks independently whether the device supports temperatureAlarm and/or smokeDetector.
For a real alarm, the existing stock code contains:
if device:supports_capability(capabilities.temperatureAlarm) then
device:emit_event(temperatureAlarm.temperatureAlarm.heat())
end
if device:supports_capability(capabilities.smokeDetector) then
device:emit_event(smokeDetector.smoke.detected())
end
And when the alarm clears:
if device:supports_capability(capabilities.temperatureAlarm) then
device:emit_event(temperatureAlarm.temperatureAlarm.cleared())
end
if device:supports_capability(capabilities.smokeDetector) then
device:emit_event(smokeDetector.smoke.clear())
end
The same is true for the IAS test state:
if device:supports_capability(capabilities.temperatureAlarm) then
device:emit_event(temperatureAlarm.temperatureAlarm.heat())
end
if device:supports_capability(capabilities.smokeDetector) then
device:emit_event(smokeDetector.smoke.tested())
end
So SmartThings had already implemented support for exposing a Frient alarm simultaneously as a heat alarm and as a smoke/fire alarm.
The problem was simply that the HESZB-120 profile never declared the smokeDetector capability.
The stock profile contained:
- id: temperatureAlarm
version: 1
- id: temperatureMeasurement
version: 1
- id: battery
version: 1
but not:
- id: smokeDetector
version: 1
That means this part of the Lua code:
device:supports_capability(capabilities.smokeDetector)
could never evaluate to true for the HESZB-120, so the already existing smoke.detected(), smoke.clear() and smoke.tested() events were effectively dormant.
The experimental driver therefore makes only one functional production change: it adds smokeDetector to the existing heat-temp-battery-alarm profile.
The device now exposes both:
temperatureAlarm
heat / cleared
smokeDetector
detected / clear / tested
I deliberately left the existing device category as:
categories:
- name: TempSensor
unchanged for now. That way we are testing only one variable: whether adding the smokeDetector capability is enough to make the Frient Heat Detector available in SmartThings Home Monitor as a fire/smoke sensor.
So if this works, the stock driver is not missing any actual alarm-handling logic. It is simply missing one capability declaration in the HESZB-120 profile.