MQTT Honeywell Smoke Detector via zigbee2mqtt

Hi everybody,

I wonder how I add all available Exposes via channels of my Xiaomi Honeywell Smoke Detector. The detector is connected via zigbee2mqtt and exposes its values like described here:

The values for smoke, battery_low, tamper, battery, smoke_density and linkquality were easy to add und straight foward. But how do i add sensitivity and selftest?

  1. To read/write the sensitivity you need to add a payload: {“sensitivity”: “”}. Is there a possibility to do this via channel configuration or do I have to do this via rule? Any suggestions?

  2. To execute the selftest i have to publish a message via mqtt. Do i make this within a rule or is there a better solution?

Bridge mqtt:broker:mosquitto [host="zigbee", secure=false]
	Thing topic ogFSmokeDetectorTopic "ogFSmokeDetector" {
        // Works great
        Type string : smokeDetected	"Smoke Detected"	[ stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.smoke" ]
		Type string : batteryLow	"Battery Low"		[stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.battery_low" ]
		Type string : tamper		"Tamper"			[stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.tamper" ]
	 	Type number : battery		"Battery"			[stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.battery" ]
		Type number : smokeDensity	"Smoke Density" 	[stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.smoke_density" ]
		Type number : linkQuality	"Link Quality" 		[stateTopic="zigbee2mqtt/0x00158d000543f53c", transformationPattern="JSONPATH:$.linkquality" ]
        // Does not work
        Type string : sensitivity	"Sensitivity"		[stateTopic="zigbee2mqtt/0x00158d000543f53c/get", commandTopic="zigbee2mqtt/0x00158d000543f53c/set", formatBeforePublish="{\"sensitivity\": %s}", transformationPattern="JSONPATH:$.sensitivity", allowedStates="low, medium, high" ]
// Works great
Switch	ogFSmokeDetectorSmokeDetected	"OG F Smoke Detector Smoke Detected"	<switch>	{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:smokeDetected" [profile="transform:MAP", function=""]}
Switch	ogFSmokeDetectorBatteryLow		"OG F Smoke Detector Battery Low"		<switch>	{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:batteryLow" [profile="transform:MAP", function=""]}
Switch	ogFSmokeDetectorTamper			"OG F Smoke Detector Tamper"			<switch>	{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:tamper" [profile="transform:MAP", function=""]}
Number	ogFSmokeDetectorBattery			"OG F Smoke Detector Battery"						{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:battery" }
Number	ogFSmokeDetectorSmokeDensity	"OG F Smoke Detector Smoke Density"					{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:smokeDensity" }
Number	ogFSmokeDetectorLinkQuality		"OG F Smoke Detector Link Quality"					{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic:linkQuality" }
// Does not work
String	ogFSmokeDetectorSensitivity		"OG F Smoke Detector Sensitivity"					{ channel="mqtt:topic:mosquitto:ogFSmokeDetectorTopic::sensitivity" }
  • Platform information:
    • Hardware: Pi3
    • OS: openHABian
    • Java Runtime Environment: openjdk 15 2020-09-15
    • openHAB version: openHAB 2.5.10-1 (Release Build)

When you say

What do you mean? What message is the broker receiving? You can use something like MQTT Explorer to subscribe to all topics and ‘sniff’ your MQTT traffic.

You’ve got an error in your Item syntax - double colon ::


Depends. How is a self test executed via MQTT? If you only need this to be executed manually you might not need a rule.

As an aside, are you aware of the attribute option for zigbee2mqtt? Check this out to get rid of all your transforms: Zigbee2mqtt revisited: No more ugly transformations