PatchworkBoy / homebridge-edomoticz

Domoticz Homebridge-Plugin
Other
118 stars 43 forks source link

MQTT Crashing Homebridge #121

Closed Lorccan closed 6 years ago

Lorccan commented 6 years ago

I just switched on mqtt, and now I'm getting these errors that are crashing Homebridge. I tried setting "mqttenable" : 0 in the first room in config.json, but the error just cascaded to another room. In case it matters, both lamps that have thrown the error so far are white dimmable GU10s from INNR which are connected to the Hue Bridge (V2).

Any ideas please? (I have validated config.json with jsonlint.com.)

Nov 17 18:55:11 milos homebridge[17436]: Name:                Lobby-2
Nov 17 18:55:11 milos homebridge[17436]: Device:                Lighting 2,AC
Nov 17 18:55:11 milos homebridge[17436]: Is Switch:        true
Nov 17 18:55:11 milos homebridge[17436]: SwitchTypeVal:        7
Nov 17 18:55:11 milos homebridge[17436]: MQTT Message:
Nov 17 18:55:11 milos homebridge[17436]: {
Nov 17 18:55:11 milos homebridge[17436]: "Battery": 255,
Nov 17 18:55:11 milos homebridge[17436]: "RSSI": 12,
Nov 17 18:55:11 milos homebridge[17436]: "description": "",
Nov 17 18:55:11 milos homebridge[17436]: "dtype": "Lighting 2",
Nov 17 18:55:11 milos homebridge[17436]: "id": "000000A",
Nov 17 18:55:11 milos homebridge[17436]: "idx": 886,
Nov 17 18:55:11 milos homebridge[17436]: "name": "Lobby-2",
Nov 17 18:55:11 milos homebridge[17436]: "nvalue": 1,
Nov 17 18:55:11 milos homebridge[17436]: "stype": "AC",
Nov 17 18:55:11 milos homebridge[17436]: "svalue1": "5",
Nov 17 18:55:11 milos homebridge[17436]: "switchType": "Dimmer",
Nov 17 18:55:11 milos homebridge[17436]: "unit": 1
Nov 17 18:55:11 milos homebridge[17436]: }
Nov 17 18:55:11 milos homebridge[17436]: /usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:678
Nov 17 18:55:11 milos homebridge[17436]: var powerCharacteristic = service.getCharacteristic(Characteristic.On);
Nov 17 18:55:11 milos homebridge[17436]: ^
Nov 17 18:55:11 milos homebridge[17436]: TypeError: Cannot read property 'getCharacteristic' of undefined
Nov 17 18:55:11 milos homebridge[17436]: at Object.eDomoticzAccessory.handleMQTTMessage (/usr/local/lib/node_modules/homebridge-edomoticz/lib/domoticz_accessory.js:678:39)
Nov 17 18:55:11 milos homebridge[17436]: at MqttClient.<anonymous> (/usr/local/lib/node_modules/homebridge-edomoticz/lib/mqtt.js:77:17)
Nov 17 18:55:11 milos homebridge[17436]: at emitThree (events.js:97:13)
Nov 17 18:55:11 milos homebridge[17436]: at MqttClient.emit (events.js:175:7)
Nov 17 18:55:11 milos homebridge[17436]: at MqttClient._handlePublish (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:792:12)
Nov 17 18:55:11 milos homebridge[17436]: at MqttClient._handlePacket (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:282:12)
Nov 17 18:55:11 milos homebridge[17436]: at process (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:238:12)
Nov 17 18:55:11 milos homebridge[17436]: at Writable.writable._write (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/mqtt/lib/client.js:248:5)
Nov 17 18:55:11 milos homebridge[17436]: at doWrite (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/readable-stream/lib/_stream_writable.js:237:10)
Nov 17 18:55:11 milos homebridge[17436]: at writeOrBuffer (/usr/local/lib/node_modules/homebridge-edomoticz/node_modules/readable-stream/lib/_stream_writable.js:227:5)
Nov 17 18:55:11 milos systemd[1]: homebridge.service: main process exited, code=exited, status=1/FAILURE
Nov 17 18:55:11 milos systemd[1]: Unit homebridge.service entered failed state.
Lorccan commented 6 years ago

Fixed by upgrading to latest version