SphtKr / homebridge-zway

Homebridge plugin for (better) HomeKit support of RaZBerry and Z-Way Server
ISC License
85 stars 37 forks source link

Motion Sensor (Multi-Sensor) FGMS001 & Homebridge #63

Closed antti365 closed 7 years ago

antti365 commented 7 years ago

Hi, I have a Motion Sensor (Multi-Sensor) FGMS001 (v 2.6), homebridge does not start. `/ZAutomation/api/v1/devices

{"data":{"structureChanged":true,"updateTime":1478857830,"devices":[{"creationTime":1478811664,"creatorId":7,"deviceType":"battery","h":-592588978,"hasHistory":false,"id":"BatteryPolling_7","location":0,"metrics":{"probeTitle":"Battery","scaleTitle":"%","title":"Battery digest 7","level":100},"permanently_hidden":false,"probeType":"","tags":[],"visibility":true,"updateTime":1478820492},{"creationTime":1478819743,"creatorId":1,"deviceType":"sensorBinary","h":493935549,"hasHistory":false,"id":"ZWayVDev_zway_4-0-48-1","location":0,"metrics":{"probeTitle":"General purpose","scaleTitle":"","icon":"motion","level":"off","title":"Fibaro PIR (4.0.48.1)"},"permanently_hidden":false,"probeType":"general_purpose","tags":[],"visibility":true,"updateTime":1478857282},{"creationTime":1478819744,"creatorId":1,"deviceType":"sensorMultilevel","h":493936510,"hasHistory":false,"id":"ZWayVDev_zway_4-0-49-1","location":0,"metrics":{"probeTitle":"Temperature","scaleTitle":"°C","level":25.8,"icon":"temperature","title":"Fibaro Temperature (4.0.49.1)"},"permanently_hidden":false,"probeType":"temperature","tags":[],"visibility":true,"updateTime":1478857546},{"creationTime":1478819744,"creatorId":1,"deviceType":"sensorMultilevel","h":493936512,"hasHistory":false,"id":"ZWayVDev_zway_4-0-49-3","location":0,"metrics":{"probeTitle":"Luminiscence","scaleTitle":"Lux","level":1,"icon":"luminosity","title":"Fibaro Luminiscence (4.0.49.3)"},"permanently_hidden":false,"probeType":"luminosity","tags":[],"visibility":true,"updateTime":1478857224},{"creationTime":1478819743,"creatorId":1,"deviceType":"battery","h":847214338,"hasHistory":false,"id":"ZWayVDev_zway_4-0-128","location":0,"metrics":{"probeTitle":"Battery","scaleTitle":"%","level":100,"icon":"battery","title":"Fibaro Battery (4.0)"},"permanently_hidden":false,"probeType":"","tags":[],"visibility":true,"updateTime":1478820492}]},"code":200,"message":"200 OK","error":null} /var/log/homebridge.log

[2016-11-11 01:28:14] Loaded plugin: homebridge-zway [2016-11-11 01:28:18] Registering accessory 'homebridge-zway.ZWayServer' [2016-11-11 01:28:18] Registering platform 'homebridge-zway.ZWayServer' [2016-11-11 01:28:18] --- [2016-11-11 01:28:18] Loaded config.json with 0 accessories and 1 platforms. [2016-11-11 01:28:18] --- [2016-11-11 01:28:18] Loading 1 platforms... [2016-11-11 01:28:18] Initializing ZWayServer platform... [2016-11-11 01:28:20] Initializing platform accessory 'Fibaro PIR (4.0.48.1)'...`

` /var/log/homebridge.err

WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister Thu, 10 Nov 2016 23:28:18 GMT ZWayServer Fetching Z-Way devices... Thu, 10 Nov 2016 23:28:19 GMT ZWayServer Authenticating... Thu, 10 Nov 2016 23:28:19 GMT ZWayServer Authenticated. Resubmitting original request... Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey battery.Battery for vdev BatteryPolling_7 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'battery', probeTitle: 'Battery', probeType: '' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorBinary.General purpose for vdev ZWayVDev_zway_4-0-48-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorBinary', probeTitle: 'General purpose', probeType: 'general_purpose' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Temperature for vdev ZWayVDev_zway_4-0-49-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Temperature', probeType: 'temperature' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Luminiscence for vdev ZWayVDev_zway_4-0-49-3 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Luminiscence', probeType: 'luminosity' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey battery.Battery for vdev ZWayVDev_zway_4-0-128 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'battery', probeTitle: 'Battery', probeType: '' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got grouped device BatteryPolling_7 consisting of devices: Thu, 10 Nov 2016 23:28:20 GMT ZWayServer BatteryPolling_7 - battery.Battery Thu, 10 Nov 2016 23:28:20 GMT ZWayServer WARN: Didn't find suitable device class! Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got grouped device ZWayVDev_4-0 consisting of devices: Thu, 10 Nov 2016 23:28:20 GMT ZWayServer ZWayVDev_zway_4-0-48-1 - sensorBinary.General purpose Thu, 10 Nov 2016 23:28:20 GMT ZWayServer ZWayVDev_zway_4-0-49-1 - sensorMultilevel.Temperature Thu, 10 Nov 2016 23:28:20 GMT ZWayServer ZWayVDev_zway_4-0-49-3 - sensorMultilevel.Luminiscence Thu, 10 Nov 2016 23:28:20 GMT ZWayServer ZWayVDev_zway_4-0-128 - battery.Battery Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorBinary.General purpose for vdev ZWayVDev_zway_4-0-48-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorBinary', probeTitle: 'General purpose', probeType: 'general_purpose' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorBinary.General purpose for vdev ZWayVDev_zway_4-0-48-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorBinary', probeTitle: 'General purpose', probeType: 'general_purpose' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorBinary.General purpose for vdev ZWayVDev_zway_4-0-48-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorBinary', probeTitle: 'General purpose', probeType: 'general_purpose' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Temperature for vdev ZWayVDev_zway_4-0-49-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Temperature', probeType: 'temperature' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Luminiscence for vdev ZWayVDev_zway_4-0-49-3 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Luminiscence', probeType: 'luminosity' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey battery.Battery for vdev ZWayVDev_zway_4-0-128 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'battery', probeTitle: 'Battery', probeType: '' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorBinary.General purpose for vdev ZWayVDev_zway_4-0-48-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorBinary', probeTitle: 'General purpose', probeType: 'general_purpose' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Temperature for vdev ZWayVDev_zway_4-0-49-1 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Temperature', probeType: 'temperature' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey sensorMultilevel.Luminiscence for vdev ZWayVDev_zway_4-0-49-3 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'sensorMultilevel', probeTitle: 'Luminiscence', probeType: 'luminosity' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer Got typeKey battery.Battery for vdev ZWayVDev_zway_4-0-128 Thu, 10 Nov 2016 23:28:20 GMT ZWayServer { deviceType: 'battery', probeTitle: 'Battery', probeType: '' } Thu, 10 Nov 2016 23:28:20 GMT ZWayServer ERROR! Failed to configure required characteristic "Contact Sensor State"! `

SphtKr commented 7 years ago

Almost certainly a duplicate of #57. Fixes for this class of issues are already done and merged, I'm trying to fix one more issue before making a beta release.

antti365 commented 7 years ago

Fine, I'm happy, but what is no beta release?

SphtKr commented 7 years ago

It's out now, do npm upgrade -g homebridge-zway (or npm install -g homebridge-zway@0.5.0-rc0 if you're not on the pre-release channel) and see if it fixes your problem (it became a release candidate instead of a beta).

antti365 commented 7 years ago

Set update (sudo npm install -g homebridge-zway@0.5.0-rc0), homebridge start his sensor appeared, everything is OK. But the latter option (charging) is not displayed correctly, which is correct? image1 image3

antti365 commented 7 years ago

Yet I found a mistake in the file /var/log/homebridge.err:

Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Adding Characteristic "Name" failed with message "Cannot add a Characteristic with the same UUID as another Characteristic in this Service: 00000023-0000-1000-8000-0026BB765291". This may be expected.

Full log: * WARNING * The program 'node' uses the Apple Bonjour compatibility layer of Avahi. * WARNING * Please fix your application to use the native API of Avahi! * WARNING * For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node * WARNING * The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. * WARNING * Please fix your application to use the native API of Avahi! * WARNING * For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister Fri, 11 Nov 2016 19:11:15 GMT ZWayServer Fetching Z-Way devices... Fri, 11 Nov 2016 19:11:16 GMT ZWayServer Authenticating... Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Authenticated. Resubmitting original request... Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Got grouped device BatteryPolling_7 consisting of devices: Fri, 11 Nov 2016 19:11:17 GMT ZWayServer BatteryPolling_7 - battery.Battery Fri, 11 Nov 2016 19:11:17 GMT ZWayServer WARN: Didn't find suitable device class! Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Got grouped device ZWayVDev_8-0 consisting of devices: Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_8-0-48-1 - sensorBinary.General purpose Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_8-0-49-1 - sensorMultilevel.Temperature Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_8-0-49-3 - sensorMultilevel.Luminiscence Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_8-0-128 - battery.Battery Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Got grouped device ZWayVDev_9-0 consisting of devices: Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_9-0-37 - switchBinary Fri, 11 Nov 2016 19:11:17 GMT ZWayServer ZWayVDev_zway_9-0-38 - switchMultilevel Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Name" for vdev "ZWayVDev_zway_8-0-48-1" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Contact Sensor State" for vdev "ZWayVDev_zway_8-0-48-1" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Status Low Battery" for vdev "ZWayVDev_zway_8-0-128" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Adding Characteristic "Name" failed with message "Cannot add a Characteristic with the same UUID as another Characteristic in this Service: 00000023-0000-1000-8000-0026BB765291". This may be expected. Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Found and configured Service "ContactSensor" for vdev "ZWayVDev_zway_8-0-48-1" with typeKey "sensorBinary.General purpose" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Name" for vdev "ZWayVDev_zway_8-0-128" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Battery Level" for vdev "ZWayVDev_zway_8-0-128" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Charging State" for vdev "ZWayVDev_zway_8-0-128" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Configured Characteristic "Status Low Battery" for vdev "ZWayVDev_zway_8-0-128" Fri, 11 Nov 2016 19:11:17 GMT ZWayServer Found and configured Service "BatteryService" for vdev "ZWayVDev_zway_8-0-128" with typeKey "battery.Battery" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Name" for vdev "ZWayVDev_zway_8-0-49-1" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Current Temperature" for vdev "ZWayVDev_zway_8-0-49-1" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Found and configured Service "TemperatureSensor" for vdev "ZWayVDev_zway_8-0-49-1" with typeKey "sensorMultilevel.Temperature" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Name" for vdev "ZWayVDev_zway_8-0-49-3" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Current Ambient Light Level" for vdev "ZWayVDev_zway_8-0-49-3" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Found and configured Service "LightSensor" for vdev "ZWayVDev_zway_8-0-49-3" with typeKey "sensorMultilevel.Luminiscence" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Loaded services for Fibaro PIR (8.0.48.1) Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Name" for vdev "ZWayVDev_zway_9-0-38" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Current Position" for vdev "ZWayVDev_zway_9-0-38" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Target Position" for vdev "ZWayVDev_zway_9-0-38" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Position State" for vdev "ZWayVDev_zway_9-0-38" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Configured Characteristic "Hold Position" for vdev "ZWayVDev_zway_9-0-38" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Found and configured Service "WindowCovering" for vdev "ZWayVDev_zway_9-0-38" with typeKey "switchMultilevel.blind" Fri, 11 Nov 2016 19:11:18 GMT ZWayServer Loaded services for Fibaro Blind (9.0) Fri, 11 Nov 2016 19:11:18 GMT EventedHTTPServer Server listening on port 51826 Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.11] New connection from client Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP server listening on port 40656 Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP request: /pair-verify Fri, 11 Nov 2016 19:11:20 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify Fri, 11 Nov 2016 19:11:20 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP Response is finished Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.10] New connection from client Fri, 11 Nov 2016 19:11:20 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP server listening on port 40245 Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP request: /pair-verify Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] Client 54EBDA2C-BBA2-438B-ACF8-38E4283CA54A verification complete Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP Response is finished Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP request: /pair-verify Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP Response is finished Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP request: /accessories Fri, 11 Nov 2016 19:11:21 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories Fri, 11 Nov 2016 19:11:21 GMT EventedHTTPServer [::ffff:192.168.10.11] HTTP Response is finished Fri, 11 Nov 2016 19:11:23 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP request: /pair-verify Fri, 11 Nov 2016 19:11:23 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify Fri, 11 Nov 2016 19:11:23 GMT HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 Fri, 11 Nov 2016 19:11:23 GMT HAPServer [CC:22:3D:E3:CE:30] Client 54EBDA2C-BBA2-438B-ACF8-38E4283CA54A verification complete Fri, 11 Nov 2016 19:11:23 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP Response is finished Fri, 11 Nov 2016 19:11:23 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP request: /accessories Fri, 11 Nov 2016 19:11:23 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories Fri, 11 Nov 2016 19:11:23 GMT EventedHTTPServer [::ffff:192.168.10.10] HTTP Response is finished

SphtKr commented 7 years ago

Okay, both of those are expected.

The HomeKit spec requires anything with a battery to also include a charging characteristic, so I include one but it's always false. The Fibaro motion sensor can't charge its battery, right? (Mine can't). Some of the Aeon Labs multi-sensors actually can run off a USB line, so I'll have to look at that for them, but I don't have one to test. Anyway, charging = No is correct.

The message you noticed, "Adding Characteristic "Name" failed ... This may be expected." is okay. In some combinations of devices this happens, and it was difficult to prevent it, so I just ignore the second "name" that it tries to set. The names are mostly a convenience anyway, you can rename all the devices in HomeKit if they're not right. In any case, as long as your device(s) are showing up as expected, you can ignore that message.

SphtKr commented 7 years ago

Also, you'll probably want to add a tag (in Z-Way) to the motion sensor device so that Homebridge knows what it really is--right now it's showing it as a contact sensor. See the documentation for more info.

SphtKr commented 7 years ago

I think the original issue here is fixed, and the other issues resolved...closing, reopen if needed.