cflurin / homebridge-mqtt

Homebridge-mqtt is a Plugin for Homebridge.
Apache License 2.0
229 stars 39 forks source link

sevice AccessoryInformation not work #34

Closed JJiri closed 7 years ago

JJiri commented 7 years ago

If I tested sevice "AccessoryInformation" homebridge crashed:

[4/20/2017, 7:14:54 PM] [mqtt] Number of cached Accessories: 1 [4/20/2017, 7:14:54 PM] [mqtt] connect Anonymous [4/20/2017, 7:14:54 PM] [Homebridge Server] is listening on: http://192.168.1.85:8765 [4/20/2017, 7:14:54 PM] Homebridge is running on port 51827. [4/20/2017, 7:14:54 PM] [mqtt] connected (url = mqtt://192.168.1.85) /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:72 throw new Error("Cannot add a Characteristic with the same UUID as another Characteristic in this Service: " + existing.UUID); ^

Error: Cannotadd a Characteristic with the same UUID as another Characteristic in this Service: 00000023-0000-1000-8000-0026BB765291 at Service.addCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:72:13) at new Service.AccessoryInformation (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/gen/HomeKitTypes.js:2447:8) at PlatformAccessory.addService (/usr/local/lib/node_modules/homebridge/lib/platformAccessory.js:44:15) at Accessory.addService (/usr/local/lib/node_modules/homebridge-mqtt/lib/accessory.js:48:13) at Controller.addAccessory (/usr/local/lib/node_modules/homebridge-mqtt/lib/controller.js:97:17) at Model. (/usr/local/lib/node_modules/homebridge-mqtt/lib/model.js:114:22) at emitThree (events.js:97:13) at MqttClient.emit (events.js:175:7) at MqttClient._handlePublish (/usr/local/lib/node_modules/homebridge-mqtt/node_modules/mqtt/lib/client.js:819:12) at MqttClient._handlePacket (/usr/local/lib/node_modules/homebridge-mqtt/node_modules/mqtt/lib/client.js:286:12) pi@MQTT:~ $

cflurin commented 7 years ago

How did you set "accessory information" ? topic ? payload ?

JJiri commented 7 years ago

Very simply:

homebridgeJJ/to/add {"name": "TST", "service_name": "TST", "service": "AccessoryInformation"}

Jiří Janeba janebaj@gmail.com

    1. 2017 v 19:29, cflurin notifications@github.com:

How did you set "accessory information" ? topic ? payload ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cflurin/homebridge-mqtt/issues/34#issuecomment-295825448, or mute the thread https://github.com/notifications/unsubscribe-auth/AZCuS3Jb2jcM1zZWmJ17WAYT_SeqnL2tks5rx5XvgaJpZM4NDU6h.

cflurin commented 7 years ago

You don't need to add the service "AccessoryInformation"! Just set the characteristics.

Have a look here: https://github.com/cflurin/homebridge-mqtt#set-accessory-information

JJiri commented 7 years ago

hmm, but this way isn't working for me. I send this: topic: homebridgeJJ/to/add payload: {"name": "TST", "service_name": "light", "service": "Switch"} and topic: homebridgeJJ/to/set/accessoryinformation payload: {"name": "TST", "manufacturer": "JJ", "model": "esp8266-12", "serialnumber": "4711"} and result in iPhone:

I have problem with identification of accessories - I have 14 thermometers and I don't know how in iPhone identify which is which...

Jiří Janeba janebaj@gmail.com

    1. 2017 v 20:14, cflurin notifications@github.com:

You don't need to add the service "AccessoryInformation"! Just set the characteristics.

Have a look here: https://github.com/cflurin/homebridge-mqtt#set-accessory-information https://github.com/cflurin/homebridge-mqtt#set-accessory-information — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cflurin/homebridge-mqtt/issues/34#issuecomment-295841338, or mute the thread https://github.com/notifications/unsubscribe-auth/AZCuS3KJoNvED2iSDvrUJ1n7e7BdAp87ks5rx6CdgaJpZM4NDU6h.

cflurin commented 7 years ago

Why is this a problem? Your accessories should have a unique name. e.g. thermometer1, thermometer2 etc.

JJiri commented 7 years ago

yes, but in iPhone don’t show name, but show only service_name. and in all my termometrs is service_name same

This is better for make program to ESP8266 - only one ESP does this 14 thermometrs (it comunicate via RS232 whit home heating system and send data from this system via MQTT to homebridge...)

Jiří Janeba janebaj@gmail.com

    1. 2017 v 21:13, cflurin notifications@github.com:

Why is this a problem? Your accessories should have a unique name. e.g. thermometer1, thermometer2 etc.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cflurin/homebridge-mqtt/issues/34#issuecomment-295864732, or mute the thread https://github.com/notifications/unsubscribe-auth/AZCuS3T51hUqHg6jzEY8inZXO176JLJxks5rx653gaJpZM4NDU6h.

cflurin commented 7 years ago

Just set different service_names for each thermometer.