knstntn1 / homebridge-mqtt-blinds

homebridge plugin to control blinds via mqtt
MIT License
7 stars 1 forks source link

mqttPositionStateValue #8

Closed Kowy54 closed 5 years ago

Kowy54 commented 5 years ago

I have problem with positionStateValue :( Any help?

TypeError: Cannot read property '0' of undefined at MqttClient. (/usr/lib/node_modules/homebridge-mqtt-blinds/index.js:87:46) at emitThree (events.js:136:13) at MqttClient.emit (events.js:217:7) at MqttClient._handlePublish (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/mqtt/lib/client.js:987:12) at MqttClient._handlePacket (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/mqtt/lib/client.js:336:12) at work (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/mqtt/lib/client.js:292:12) at Writable.writable._write (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/mqtt/lib/client.js:302:5) at doWrite (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/readable-stream/lib/_stream_writable.js:417:5) at Writable.write (/usr/lib/node_modules/homebridge-mqtt-blinds/node_modules/readable-stream/lib/_stream_writable.js:334:11)

knstntn1 commented 5 years ago

There was a typo in the sample config for mqttPositionStateValues. The last s was missing. Could that be the Problem?

Kowy54 commented 5 years ago

If i Push value for positionstatevalue, homebridge will crash with error described on top. Really. I dont know how to work with topic for positionState. "mqttPositionStateValue": ["0", "1", "2"] this i have in config.

knstntn1 commented 5 years ago

Yes, than the typo from the sample config found it's way into your config. It should be "mqttPositionStateValues": ["0", "1", "2"]

Kowy54 commented 5 years ago

Oh. Thanks. I hope that it will work. I'll try after work.

knstntn1 commented 5 years ago

Hi, does it work?

Kowy54 commented 5 years ago

Yes. Thanks man!