Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "Unknown message of type bindok" #83

Open
find-a-good-nickname opened this issue Aug 24, 2022 · 2 comments
Open

Error: "Unknown message of type bindok" #83

find-a-good-nickname opened this issue Aug 24, 2022 · 2 comments

Comments

@find-a-good-nickname
Copy link

I get an error when starting this stuff.
npm version: 8.18.0
node version: 16.13.0

pi@raspberrypi:~/gree-hvac-mqtt-bridge $ node index.js --hvac-host="192.168.10.71" --mqtt-broker-url="mqtt://192.168.10.2:1883" --mqtt-topic-prefix="domoticz/in" --mqtt-username="" --mqtt-password=""
[MQTT] Connecting to mqtt://192.168.10.2:1883...
[MQTT] Connected to broker
[UDP] Connected to device at 192.168.10.71
[UDP] New device registered:
[UDP] Unknown message of type bindok: {
t: 'pack',
i: 1,
uid: 0,
cid: '',
tcid: 'app',
pack: 'FtZAY6UHKBwtaI55He0IneqJYxO3Vlz4+hb0PtbAybYXlqXCgDxwDeT3Y77VfVElYs+kEFxiRgA9LpeTA16TdA=='
}, { r: 200, t: 'bindok', mac: '', key: 'oxk22YP1uj0S97fd' }

...and then silence.
I think that "bindok" is referring to binding is ok, isn't it?

@reformhaz
Copy link

in app/deviceFactory.js this line:
this._setDevice(message.cid, pack.name, rinfo.address, rinfo.port)
sets the id to cid which is empty, so I hacked it to read:
this._setDevice(pack.mac, pack.name, rinfo.address, rinfo.port)
that gets over the binding, but I also had to change:
// If package type is response, update device properties if (pack.t === 'res' && this.device.bound) { pack.opt.forEach((opt, i) => { this.device.props[opt] = pack.v[i] }) this.options.onUpdate(this.device) return }
to
// If package type is response, update device properties if (pack.t === 'res' && this.device.bound) { pack.opt.forEach((opt, i) => { this.device.props[opt] = pack.p[i] }) this.options.onUpdate(this.device) return }
because pack has no v field, but does have p

Please note I have no idea what and why I'm doing, but using these modifications I can use this.

@lelemka0
Copy link

if (pack.t === 'bindok' && this.device.id) {

Because the cid returned by your firmware is empty. Give my fork a try if you like.
My fork is mainly dedicated to supporting sub-devices, there may be problems with single-devices, please feel free to let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants