eclipse-smarthome-bluetooth-binding icon indicating copy to clipboard operation
eclipse-smarthome-bluetooth-binding copied to clipboard

Add support for Huawei scales

Open vkolotov opened this issue 6 years ago • 5 comments

Ok, did a reboot, and now it can stay with ConnectionControl ON.

However, trying to connect to my Huwei AN100/CN100 I get the following:

2019-02-05 20:39:48.036 [vent.ItemStateChangedEvent] - ScaleCH100_Connected changed from OFF to ON
==> /var/log/openhab2/openhab.log <==
2019-02-05 20:39:48.749 [ERROR] [.manager.transport.tinyb.TinyBDevice] - Services resolved notification execution error
java.lang.NullPointerException: null
	at org.sputnikdev.bluetooth.gattparser.spec.BluetoothGattSpecificationReader.validate(BluetoothGattSpecificationReader.java:304) ~[?:?]
	at org.sputnikdev.bluetooth.gattparser.spec.BluetoothGattSpecificationReader.addCharacteristic(BluetoothGattSpecificationReader.java:294) ~[?:?]
	at org.sputnikdev.bluetooth.gattparser.spec.BluetoothGattSpecificationReader.getCharacteristicByUUID(BluetoothGattSpecificationReader.java:131) ~[?:?]
	at org.sputnikdev.bluetooth.gattparser.BluetoothGattParser.isKnownCharacteristic(BluetoothGattParser.java:86) ~[?:?]
	at org.sputnikdev.esh.binding.bluetooth.handler.AutomaticPinCodeAuthProvider.lambda$discoverPinCodeCharacteristic$1(AutomaticPinCodeAuthProvider.java:64) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) ~[?:?]
	

If I connect to the CH100 with the BLE Scanner app I actually see some apparently nice GATT fields, so I was hoping to get it to work i OpenHAB. I am still on Bluez 5.43. Again, any help would be appreciated.

–Jesper

vkolotov avatar Feb 05 '19 20:02 vkolotov

I was actually running with GATT parsing strategy "Recognised + System + Unknown + unrecognised as binary" when I got the stack trace. I have tried with "Recognised only" and "All as binary" as well but that gives same stack trace.

jesperldk avatar Feb 05 '19 21:02 jesperldk

Ok, what stack trace? Could you please remove your "thing", set "All as binary" and re-add your device from the inbox again?

vkolotov avatar Feb 05 '19 21:02 vkolotov

Ok, I removed my thing, set "All as binary" and re-added, and set connection control to ON. The scale connects and then still makes the same stack trace as in the first message in the openhab log, and I get no extra channels. The stack trace starts with BluetoothGattSpecificationReader.validate() as you can see above.

jesperldk avatar Feb 05 '19 21:02 jesperldk

Interesting. It tries to perform authentication and fails for some reason. Looks like your scales does not require any authentication, so you could try to disable "auto authentication" here:

image

Disable connection control, wait until it disconnects, and stays disconnected, then disable auth and enable connection control again.

vkolotov avatar Feb 05 '19 21:02 vkolotov

sorry, same result: stack trace

jesperldk avatar Feb 05 '19 21:02 jesperldk