forty2 / haiku2mqtt

A bridge between Haiku smart fans and MQTT.
MIT License
10 stars 7 forks source link

service runs for 1-5 minutes then crashes. #2

Open ChristusM opened 6 years ago

ChristusM commented 6 years ago

Not an expert here so this may well be user error... A bit more background. My haiku devices are all lights. The mqtt server is Mosquito and is shared with a number of devices.

Let me know if you need any more detail. Below is the console output.

Chris

root@haiku2mqtt:/home/pi# haiku2mqtt -b mqtt://192.168.5.14 server listening 0.0.0.0:31415 /usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53 client.publish(getTopic(device, 'connected'), '2', STATUS_OPTS); ^

TypeError: Cannot read property 'publish' of undefined at SenseMe.setupNewDevice (/usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53:12) at SenseMe.emit (events.js:160:13) at SenseMe._handleDeviceFound (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:110:22) at Socket. (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:233:28) at Socket.emit (events.js:160:13) at UDP.onMessage [as onmessage] (dgram.js:658:8) root@haiku2mqtt:/home/pi#

ChristusM commented 6 years ago

Debug output:

haiku2mqtt -b mqtt://192.168.5.14 -v debug server listening 0.0.0.0:31415 2018-01-29 03:50:03.934 Creating client for Basement Light 2018-01-29 03:50:04.267 Creating client for Hallway Light 2018-01-29 03:50:04.358 Creating client for Guest Bedroom Light 2018-01-29 03:50:04.417 Creating client for Dining Room Light 2018-01-29 03:50:04.473 Creating client for 2nd Floor Hall Light 1 2018-01-29 03:50:04.531 Creating client for Basement Light 2 2018-01-29 03:50:04.587 Creating client for Basement Light 2018-01-29 03:50:04.642 Creating client for Kitchen Light 2018-01-29 03:50:04.697 Creating client for Office Light 2018-01-29 03:50:04.753 Creating client for Dining Room Wall Control 2018-01-29 03:50:04.808 Creating client for 2nd Floor Hall Light 2 2018-01-29 03:52:22.607 Setting Dining Room Light,light,power from on to off 2018-01-29 03:52:27.295 Setting Dining Room Light,light,power from off to on 2018-01-29 03:54:03.485 Creating client for Entryway Light 2018-01-29 03:57:56.944 Setting Dining Room Light,light,power from on to off 2018-01-29 03:58:00.848 Setting Dining Room Light,light,power from off to on 2018-01-29 03:58:03.648 Creating client for Entryway Light /usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53 client.publish(getTopic(device, 'connected'), '2', STATUS_OPTS); ^

TypeError: Cannot read property 'publish' of undefined at SenseMe.setupNewDevice (/usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53:12) at SenseMe.emit (events.js:160:13) at SenseMe._handleDeviceFound (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:110:22) at Socket. (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:233:28) at Socket.emit (events.js:160:13) at UDP.onMessage [as onmessage] (dgram.js:658:8) pi@haiku2mqtt:~ $

ChristusM commented 6 years ago

The following events are published immediately before/after the crash.

haiku:20:F8:5E:E0:B5:9F/connected 1 haiku:20:F8:5E:E0:B5:9F/connected 0 haiku:20:F8:5E:E0:75:D9/connected 0 haiku:20:F8:5E:E5:97:D1/connected 0 haiku:20:F8:5E:12:EF:81/connected 0 haiku:20:F8:5E:E0:9E:08/connected 0 haiku:20:F8:5E:F7:31:D4/connected 0 haiku:20:F8:5E:DB:F1:B7/connected 0 haiku:20:F8:5E:E0:6A:7E/connected 0 haiku:20:F8:5E:12:F6:32/connected 0 haiku:20:F8:5E:DB:EC:05/connected 0 haiku:20:F8:5E:E2:72:4B/connected 0

pponce commented 6 years ago

I saw the same type of error running latest version using node red with node-red-contrib-mqtt-broker. Works for a little while then receive very similar error.

ChristusM commented 6 years ago

Any progress finding a resolution?

ChristusM commented 6 years ago

Still looking for a resolution or another solution to integrate Big Ass products with mqtt.

chris@mfi:~$ haiku2mqtt -b mqtt://192.168.5.14 server listening 0.0.0.0:31415 /usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53 client.publish(getTopic(device, 'connected'), '2', STATUS_OPTS); ^

TypeError: Cannot read property 'publish' of undefined at SenseMe.setupNewDevice (/usr/local/lib/node_modules/haiku2mqtt/dist/index.js:53:12) at SenseMe.emit (events.js:160:13) at SenseMe._handleDeviceFound (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:110:22) at Socket. (/usr/local/lib/node_modules/haiku2mqtt/node_modules/haiku-senseme/dist/SenseMe.js:233:28) at Socket.emit (events.js:160:13) at UDP.onMessage [as onmessage] (dgram.js:658:8) chris@mfi:~$

ChristusM commented 6 years ago

Interested in a free Haiku light to fix this?

ChristusM commented 5 years ago

@pponce , were you able to resolve?

pponce commented 5 years ago

Nope. I'm using the homebridge haiku plugin to control my fans now.