diff --git a/src/devices/third_reality.ts b/src/devices/third_reality.ts index 71750e3b2bf74..a8920f99b020b 100644 --- a/src/devices/third_reality.ts +++ b/src/devices/third_reality.ts @@ -5,7 +5,7 @@ import tz from '../converters/toZigbee'; import * as exposes from '../lib/exposes'; import {battery, deviceAddCustomCluster, humidity, iasZoneAlarm, light, onOff, temperature} from '../lib/modernExtend'; import * as reporting from '../lib/reporting'; -import {DefinitionWithExtend, Fz} from '../lib/types'; +import {DefinitionWithExtend, Fz, KeyValue} from '../lib/types'; const e = exposes.presets; @@ -14,8 +14,10 @@ const fzLocal = { cluster: '3rVirationSpecialcluster', type: ['attributeReport', 'readResponse'], convert: (model, msg, publish, options, meta) => { - if (msg.data['0'] == 0) return; - const payload = {x_axis: msg.data['x_axis'], y_axis: msg.data['y_axis'], z_axis: msg.data['z_axis']}; + const payload: KeyValue = {}; + if (msg.data['xAxis']) payload.x_axis = msg.data['xAxis']; + if (msg.data['yAxis']) payload.y_axis = msg.data['yAxis']; + if (msg.data['zAxis']) payload.z_axis = msg.data['zAxis']; return payload; }, } satisfies Fz.Converter,