Interfering display values from CC2530 zigbee2mqtt sensor with two temperature endpoint entities
I have a CC2530 zigbee device sending two temperature endpoint: one is object infrared temperature and the other is ambient temperature. There are the interences of display values with any temperature endpoint entities: two entities are always changing the same temperature while their line graphs DRAWING THE CORRECT ITS TEMPERATURE HISTORY.
If I just use a single temperature endpoint entity, of course it is showing the correct temperature in both value and line graph.
I cannot determine where is causing this prolem: from CC2530 device or zigbee2mqtt configuration or homeassistant configuration? Any helps will be appreciated. Thanks.
The detailed information of these two entities in homeassistant:
The first endpoint:
curl -k -X GET -H “Authorization: Bearer Lo0o0o0ngAuthorisedToken” -H “Content-Type: application/json” https://samples.duckdns.org/api/states/sensor.0x00124b0008829c8c_temperature_object
{“attributes”: {“device”: {“friendlyName”: “0x00124b0008829c8c”, “ieeeAddr”: “0x00124b0008829c8c”, “manufacturerID”: 0, “manufacturerName”: “TestDemo”, “model”: “IRTHERMOMETER”, “networkAddress”: 53337, “powerSource”: “Mains (single phase)”, “type”: “Router”}, “device_class”: “temperature”, “friendly_name”: “Infrared Temperature”, “linkquality”: 13, “state”: “ON”, “temperature”: 31.1, “unit_of_measurement”: “\u00b0C”}, “context”: {“id”: “9a4043c6db9f463393a3926c054fc98d”, “parent_id”: null, “user_id”: null}, “entity_id”: “sensor.0x00124b0008829c8c_temperature_object”, “last_changed”: “2020-04-05T01:39:07.042451+00:00”, “last_updated”: “2020-04-05T01:39:07.042451+00:00”, “state”: “31.1”}
The second endpoint: >
curl -k -X GET -H “Authorization: Bearer Lo0o0o0ngAuthorisedToken” -H “Content-Type: application/json” https://samples.duckdns.org/api/states/sensor.0x00124b0008829c8c_temperature_ambient
{“attributes”: {“device”: {“friendlyName”: “0x00124b0008829c8c”, “ieeeAddr”: “0x00124b0008829c8c”, “manufacturerID”: 0, “manufacturerName”: “TestDemo”, “model”: “IRTHERMOMETER”, “networkAddress”: 53337, “powerSource”: “Mains (single phase)”, “type”: “Router”}, “device_class”: “temperature”, “friendly_name”: “Ambient Temperature”, “linkquality”: 13, “state”: “ON”, “temperature”: 31.7, “unit_of_measurement”: “\u00b0C”}, “context”: {“id”: “8ecb7ff9b04b4565a44b11f55c95283b”, “parent_id”: null, “user_id”: null}, “entity_id”: “sensor.0x00124b0008829c8c_temperature_ambient”, “last_changed”: “2020-04-05T01:37:57.008447+00:00”, “last_updated”:
Information from zigbee2mqtt debug/log:
zigbee2mqtt:debug 2020-04-05 09:32:38: Using MQTT client ID: ‘zigbee2mqtt’
zigbee2mqtt:info 2020-04-05 09:32:40: Connected to MQTT server
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘zigbee2mqtt/bridge/state’, payload ‘online’
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘zigbee2mqtt/0x00124b0008829c8c’, payload ‘{“state”:“ON”,“linkquality”:13,“temperature”:31.8,“device”:{“friendlyName”:“0x00124b0008829c8c”,“model”:“IRTHERMOMETER”,“ieeeAddr”:“0x00124b0008829c8c”,“networkAddress”:53337,“type”:“Router”,“manufacturerID”:0,“manufacturerName”:“TestDemo”,“powerSource”:“Mains (single phase)”}}’
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘zigbee2mqtt/bridge/config’, payload ‘{“version”:“1.8.0”,“commit”:“da4d26a”,“coordinator”:{“type”:“zStack12”,“meta”:{“transportrev”:2,“product”:0,“majorrel”:2,“minorrel”:6,“maintrel”:3,“revision”:20190608}},“log_level”:“debug”,“permit_join”:true}’
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘homeassistant/sensor/0x00124b0008829c8c/temperature_object/config’, payload ‘{“unit_of_measurement”:“°C”,“device_class”:“temperature”,“value_template”:“{{ value_json.temperature_object }}”,“state_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“json_attributes_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“name”:“0x00124b0008829c8c_temperature_object”,“unique_id”:“0x00124b0008829c8c_temperature_object_zigbee2mqtt”,“device”:{“identifiers”:[“zigbee2mqtt_0x00124b0008829c8c”],“name”:“0x00124b0008829c8c”,“sw_version”:“Zigbee2mqtt 1.8.0”,“model”:“Infrared thermometer demo MLX90614 (IRTHERMOMETER)”,“manufacturer”:“TestDemo”},“availability_topic”:“zigbee2mqtt/bridge/state”}’
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘homeassistant/sensor/0x00124b0008829c8c/temperature_ambient/config’, payload ‘{“unit_of_measurement”:“°C”,“device_class”:“temperature”,“value_template”:“{{ value_json.temperature_ambient }}”,“state_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“json_attributes_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“name”:“0x00124b0008829c8c_temperature_ambient”,“unique_id”:“0x00124b0008829c8c_temperature_ambient_zigbee2mqtt”,“device”:{“identifiers”:[“zigbee2mqtt_0x00124b0008829c8c”],“name”:“0x00124b0008829c8c”,“sw_version”:“Zigbee2mqtt 1.8.0”,“model”:“Infrared thermometer demo MLX90614 (IRTHERMOMETER)”,“manufacturer”:“TestDemo”},“availability_topic”:“zigbee2mqtt/bridge/state”}’
zigbee2mqtt:info 2020-04-05 09:32:40: MQTT publish: topic ‘homeassistant/sensor/0x00124b0008829c8c/linkquality/config’, payload ‘{“unit_of_measurement”:“-”,“value_template”:“{{ value_json.linkquality }}”,“state_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“json_attributes_topic”:“zigbee2mqtt/0x00124b0008829c8c”,“name”:“0x00124b0008829c8c_linkquality”,“unique_id”:“0x00124b0008829c8c_linkquality_zigbee2mqtt”,“device”:{“identifiers”:[“zigbee2mqtt_0x00124b0008829c8c”],“name”:“0x00124b0008829c8c”,“sw_version”:“Zigbee2mqtt 1.8.0”,“model”:“Infrared thermometer demo MLX90614 (IRTHERMOMETER)”,“manufacturer”:“TestDemo”},“availability_topic”:“zigbee2mqtt/bridge/state”}’
zigbee2mqtt:debug 2020-04-05 09:32:57: Received Zigbee message from ‘0x00124b0008829c8c’, type ‘attributeReport’, cluster ‘msTemperatureMeasurement’, data ‘{“measuredValue”:3250}’ from endpoint 9 with groupID 0
zigbee2mqtt:info 2020-04-05 09:32:57: MQTT publish: topic ‘zigbee2mqtt/0x00124b0008829c8c’, payload ‘{“state”:“ON”,“linkquality”:10,“temperature”:32.5,“device”:{“friendlyName”:“0x00124b0008829c8c”,“model”:“IRTHERMOMETER”,“ieeeAddr”:“0x00124b0008829c8c”,“networkAddress”:53337,“type”:“Router”,“manufacturerID”:0,“manufacturerName”:“TestDemo”,“powerSource”:“Mains (single phase)”}}’
zigbee2mqtt:debug 2020-04-05 09:33:07: Received Zigbee message from ‘0x00124b0008829c8c’, type ‘attributeReport’, cluster ‘msTemperatureMeasurement’, data ‘{“measuredValue”:3180}’ from endpoint 8 with groupID 0
zigbee2mqtt:info 2020-04-05 09:33:07: MQTT publish: topic ‘zigbee2mqtt/0x00124b0008829c8c’, payload ‘{“state”:“ON”,“linkquality”:13,“temperature”:31.8,“device”:{“friendlyName”:“0x00124b0008829c8c”,“model”:“IRTHERMOMETER”,“ieeeAddr”:“0x00124b0008829c8c”,“networkAddress”:53337,“type”:“Router”,“manufacturerID”:0,“manufacturerName”:“TestDemo”,“powerSource”:“Mains (single phase)”}}’
Information from zigbee2mqtt configuration:
data/database.db
{“id”:2,“type”:“Router”,“ieeeAddr”:“0x00124b0008829c8c”,“nwkAddr”:53337,“manufId”:0,“manufName”:“TestDemo”,“powerSource”:“Mains (single phase)”,“modelId”:“IRTHERMOMETER”,“epList”:[8,9,20],“endpoints”:{“8”:{“epId”:8,“inClusterList”:,“outClusterList”:,“clusters”:{“msTemperatureMeasurement”:{“attributes”:{“measuredValue”:3130}}},“binds”:[{“cluster”:1026,“type”:“endpoint”,“deviceIeeeAddress”:“0x00124b000be87882”,“endpointID”:1}]},“9”:{“epId”:9,“inClusterList”:,“outClusterList”:,“clusters”:{“msTemperatureMeasurement”:{“attributes”:{“measuredValue”:3140}}},“binds”:[{“cluster”:1026,“type”:“endpoint”,“deviceIeeeAddress”:“0x00124b000be87882”,“endpointID”:2}]},“20”:{“epId”:20,“inClusterList”:,“outClusterList”:,“clusters”:{},“binds”:}},“interviewCompleted”:false,“meta”:{}}
lib/extension/homeassistant.js
const irThermometerWithPostfix = (postfix) => {
return {
type: ‘sensor’,
object_id:temperature_${postfix}
,
discovery_payload: {
unit_of_measurement: ‘°C’,
device_class: ‘temperature’,
value_template:{{ value_json.temperature_${postfix} }}
,
},
};
};const mapping = {
// …
‘IRTHERMOMETER’: [irThermometerWithPostfix(‘object’),irThermometerWithPostfix(‘ambient’)],
// …
}
node_modules/zigbee-herdsman-converters/devices.js
const devices = [
// …
{
zigbeeModel: [‘IRTHERMOMETER’],
model: ‘IRTHERMOMETER’,
vendor: ‘TestDemo’,
description: ‘Infrared thermometer demo MLX90614’,
supports: ‘temperature’,
fromZigbee: [
fz.temperature,
],
toZigbee: ,
endpoint: (device) => {
return {‘object’: 8, ‘ambient’: 9 };
},
meta: {configureKey: 1},
configure: async (device, coordinatorEndpoint) => {
const endpoint1 = device.getEndpoint(8);
await bind(endpoint1, coordinatorEndpoint, [‘msTemperatureMeasurement’]);
await configureReporting.temperature(endpoint1);
const endpoint2 = device.getEndpoint(9);
await bind(endpoint2, coordinatorEndpoint, [‘msTemperatureMeasurement’]);
await configureReporting.temperature(endpoint2);
},
},
// …
}