madchicken / homebridge-zigbee-nt

A standalone ZigBee plugin that works with CC2531 USB dongle or Deconz
Apache License 2.0
74 stars 38 forks source link

Xiaomi MiJia Honeywell smoke detector #85

Closed miktin closed 3 years ago

miktin commented 3 years ago

Hallo it would be possible to use the Xiaomi MiJia Honeywell smoke detector to involve. It is recognized but not passed on to Homebridge Thanks

Miktin

madchicken commented 3 years ago

Hey, it should be easy, just add this to your plugin config:

              "devices": [{
                    "manufacturer": "Xiaomi",
                    "models": [
                        "JTYJ-GD-01LM/BW"
                    ],
                    "services": [
                        {
                            "type": "leak-sensor",
                            "meta": {
                                "smokeLeak": true,
                                "battery": true,
                                "batteryLow": true,
                                "tamper": true
                            }
                        }
                    ]
                }]

Please, tell me if it works, I'll permanently add it to the internal database

miktin commented 3 years ago

Hallo Plugin config? Where i can find? You mean config.json? Sorry i not a programmer and i not write jsoin befor, is not easy for me. I start with homebridge last week. Thanks

madchicken commented 3 years ago

Yes, in config.json, find the section for this plugin. Should be something like:

       {
            "name": "ZigBee",
            "channel": 11,
            "secondaryChannel": "25",
            "routerPollingInterval": 30,
            "disableRouterPolling": false,
            "disableHttpServer": false,
            "disableLed": true,
            "platform": "ZigbeeHomebridgeNTPlatform"
        }

Simply add the config for your device, like this:

       {
            "name": "ZigBee",
            "channel": 11,
            "secondaryChannel": "25",
            "routerPollingInterval": 30,
            "disableRouterPolling": false,
            "disableHttpServer": false,
            "disableLed": true,
            "platform": "ZigbeeHomebridgeNTPlatform",
            "devices": [{
                    "manufacturer": "Xiaomi",
                    "models": [
                        "JTYJ-GD-01LM/BW"
                    ],
                    "services": [
                        {
                            "type": "leak-sensor",
                            "meta": {
                                "smokeLeak": true,
                                "battery": true,
                                "batteryLow": true,
                                "tamper": true
                            }
                        }
                    ]
                }]
        }
miktin commented 3 years ago

Hallo Thanks, i put in, but no Sensor in Homekit. Protokoll says finaly "Unrecognized device":

21/01/2021, 10:22:38] [ZigBee] Found ZigBee device: Device { ID: 2, _type: 'EndDevice', _ieeeAddr: '0x00158d00053d5fdf', _networkAddress: 30997, _manufacturerID: 4151, _endpoints: [ Endpoint { ID: 1, profileID: 260, deviceID: 1026, inputClusters: [Array], outputClusters: [Array], deviceNetworkAddress: 30997, deviceIeeeAddress: '0x00158d00053d5fdf', clusters: [Object], _binds: [], _configuredReportings: [], meta: {} } ], _manufacturerName: 'LUMI', _powerSource: 'Battery', _modelID: 'lumi.sensor_smoke', _applicationVersion: 1, _stackVersion: 2, _zclVersion: 1, _hardwareVersion: 16, _dateCode: '20170314', _softwareBuildID: '3000-0001', _interviewCompleted: true, _interviewing: false, meta: {}, _lastSeen: 1611220191043 } [21/01/2021, 10:22:38] [ZigBee] Unrecognized device: 0x00158d00053d5fdf LUMI lumi.sensor_smoke

Can you Help me also for Device BlitzWolf BW-SHP13

              "devices": [{
                    "manufacturer": "TuYa",
                    "models": [
                        "TS0121_plug"
                    ],
                    "services": [
                        {
                            "type": "plug",
                            "meta": {
                                "switch": true,
                                "power": true,
                                "current": true,
                                "energy": true,
                                "voltage": true,
                                "power_outage_memory": true,
                            }
                        }
                    ]
                }]

Protokoll

[21/01/2021, 11:23:51] [ZigBee] Found ZigBee device: Device { ID: 3, _type: 'Router', _ieeeAddr: '0x588e81fffed3a293', _networkAddress: 54718, _manufacturerID: 4098, _endpoints: [ Endpoint { ID: 1, profileID: undefined, deviceID: undefined, inputClusters: [], outputClusters: [], deviceNetworkAddress: 54718, deviceIeeeAddress: '0x588e81fffed3a293', clusters: [Object], _binds: [], _configuredReportings: [], meta: {} } ], _manufacturerName: undefined, _powerSource: undefined, _modelID: undefined, _applicationVersion: undefined, _stackVersion: undefined, _zclVersion: undefined, _hardwareVersion: undefined, _dateCode: undefined, _softwareBuildID: undefined, _interviewCompleted: false, _interviewing: false, meta: {}, _lastSeen: 1611224494472 } [21/01/2021, 11:23:51] [ZigBee] Unrecognized device: 0x588e81fffed3a293 undefined undefined

madchicken commented 3 years ago

For your smoke sensor, use LUMI as manufacturer and lumi.sensor_smoke in models. For the plug, it seems it could not complete the interview process (it could not get model and manufacturer)...can you try to re-pair it?

miktin commented 3 years ago

Many Thanks The smoke detector is already working. I re-trained the plug and adjusted it a bit. Protocol says generated, but then comes a big error message. I think something doesn't fit with the servises i write in the config.

[21/01/2021, 12:15:22] [ZigBee] Found ZigBee device: Device { ID: 3, _type: 'Router', _ieeeAddr: '0x588e81fffed3a293', _networkAddress: 56762, _manufacturerID: 4098, _endpoints: [ Endpoint { ID: 1, profileID: 260, deviceID: 81, inputClusters: [Array], outputClusters: [Array], deviceNetworkAddress: 56762, deviceIeeeAddress: '0x588e81fffed3a293', clusters: [Object], _binds: [], _configuredReportings: [], meta: {} } ], _manufacturerName: '_TZ3000_g5xawfcq', _powerSource: 'Mains (single phase)', _modelID: 'TS0121', _applicationVersion: 65, _stackVersion: 0, _zclVersion: 3, _hardwareVersion: 1, _dateCode: '', _softwareBuildID: undefined, _interviewCompleted: true, _interviewing: false, meta: {}, _lastSeen: 1611227513113 } [21/01/2021, 12:15:22] [ZigBee] Registering new accessory with uuid 25941bfe-319c-4b10-ae63-6a75f52c3426 and name 0x588e81fffed3a293

but then

(node:19019) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 44) (node:19019) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'displayName' of undefined at /usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:209:50 at Array.forEach () at ConfigurableAccessory.update (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:208:25) at ConfigurableAccessory.internalUpdate (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/accessories/zig-bee-accessory.ts:197:10) at /usr/local/lib/node_modules/homebridge-zigbee-nt/src/platform.ts:387:27 at ZigBeeClient.decodeMessage (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/zigbee/zig-bee-client.ts:145:5) at ZigbeeNTHomebridgePlatform.handleZigBeeMessage (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/platform.ts:384:21) at Controller. (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/platform.ts:126:71) at Controller.emit (events.js:315:20) at Controller. (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman/src/controller/controller.ts:621:18) at Generator.next () at /usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman/dist/controller/controller.js:27:71 at new Promise () at __awaiter (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman/dist/controller/controller.js:23:12) at Controller.onZclOrRawData (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman/dist/controller/controller.js:457:16) at ZStackAdapter. (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman/src/controller/controller.ts:124:70) (node:19019) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 45)

One more question: Can i create a name for the devices? If i understand is somethink like "friendly_name: "?

madchicken commented 3 years ago

oh, I see...plug service is stil not supported. My bad. I'll add in the next release

madchicken commented 3 years ago

Actually no, I was wrong. Change plug into outlet and it should work

miktin commented 3 years ago

Thanks so mutch. it works.

One more question: Can i create a name for the devices? If i understand is somethink like "friendly_name: "?

miktin commented 3 years ago

But i see in Protokoll some warning.

(node:19938) UnhandledPromiseRejectionWarning: Error: This callback function has already been called by someone else; it can only be called one time. at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13 at OutletServiceBuilder. (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/builders/outlet-service-builder.ts:101:11) at Generator.throw () at rejected (/usr/local/lib/node_modules/homebridge-zigbee-nt/dist/builders/outlet-service-builder.js:6:65) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) (Use node --trace-warnings ... to show where the warning was created)

madchicken commented 3 years ago

Thanks so mutch. it works.

One more question: Can i create a name for the devices? If i understand is somethink like "friendly_name: "?

You can change the name in Home App. Do you want to add a friendly name for better understanding logs?

madchicken commented 3 years ago

But i see in Protokoll some warning.

(node:19938) UnhandledPromiseRejectionWarning: Error: This callback function has already been called by someone else; it can only be called one time. at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/once.ts:6:13 at OutletServiceBuilder. (/usr/local/lib/node_modules/homebridge-zigbee-nt/src/builders/outlet-service-builder.ts:101:11) at Generator.throw () at rejected (/usr/local/lib/node_modules/homebridge-zigbee-nt/dist/builders/outlet-service-builder.js:6:65) at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) (Use node --trace-warnings ... to show where the warning was created)

I'll take a look at this, it happened to me one time, but never again. Is probably due to Homebridge and the way it invokes the set callback

miktin commented 3 years ago

Thanks so mutch. it works. One more question: Can i create a name for the devices? If i understand is somethink like "friendly_name: "?

You can change the name in Home App. Do you want to add a friendly name for better understanding logs?

Yes for better understand in Logs also for identifikation if I learn 5 windows sensors, i dont now later witch one is it.

miktin commented 3 years ago

i see some in smoke sensor. There is no Battery state.

Abou the plug, maybe is some misstake about the services?

madchicken commented 3 years ago

Sorry @miktin I forgot to reply. The plug config is "almost" right. The correct one should be

"devices": [{
                    "manufacturer": "TuYa",
                    "models": [
                        "TS0121_plug"
                    ],
                    "services": [
                        {
                            "type": "plug",
                            "meta": {
                                "power": true,
                                "current": true,
                                "voltage": true,
                            }
                        }
                    ]
                }]

But your config is actually still good, since you added flags that are just ignored. Regarding errors, please open a new issue with all the logs and maybe a description of what you did when the log appeared.

miktin commented 3 years ago

Thanks for the information. First have it deinstaled again. The sensors are not shown to me in Homekit as it would be desirable, test a few other ways to get the devices to Homekit. Maybe I'll come back to that later. As I said, I am new to the subject and am currently learning. I also have to get to know the different plugins and options regarding Zigbee first. but you've already helped me a lot and I've already learned a lot. thanks

madchicken commented 3 years ago

The sensors are not shown to me in Homekit as it would be desirable

Could you please elaborate a bit more on this?