[New Binding] AM43 Blind Drive Motor Binding

I think I found what went wrong, looks like I forgot to make a critical change in one of the bluetooth binding xml files. So looks like the AM43 binding won’t be included automatically with the bluetooth binding. My screw up. I’ll have it fixed for next release. In the meantime you should be able to download the binding jar from my initial post and copy the jar into the openhab addons directory. Assuming you are using openhabian this would be located at /usr/share/openhab2/addons/. Once you copy the jar everything should work.

so I recorded there but write in the log:

[ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing ‘openhab-binding-org.openhab.binding.bluetooth.am43, openhab-binding-anymore bindings here’

Is that the entire error message? Can you post the entire thing?

Hi, quick functional question. With the app that comes with the Zemismart roller blind engine the engine will stop after a couple of minutes, leaving my blinds less than halfway open or closed. The blinds are 240cm high. Before I buy myself a raspberry Pi and try your binding, does any of you already use this binding for blinds with similar height?

The blinds drive engine app is known for being very unreliable. But the AM43 devices themselves are very reliable, with the exception of the solar panel not being large enough to keep it charged.

I won’t necessarily blame the app the blinds not opening or closing completely, unless you are trying to command your blinds to be a percentage open/closed. From what I can tell the AM43 should be able to support blinds of up to 25 meters in size, not that I have experimented to see if it actually can but the bluetooth protocol seems to hint that it should.

If your blinds are only going halfway I would troubleshoot without using the app and try to confirm that you have the upper/lower limits of your AM43 configured correctly. You can configure it without using the app. Once you have the upper and lower limits set you should be able to raise or lower the blinds completely from just holding a direction button for a second and a half. If that doesn’t work then your AM43 might have hardware issues.

@cpmeister Many thanks for the binding :slight_smile:

I have been trying to make it work for sometime now with no success :frowning:

I have a bluegiga usb passed to openhab in a privileged container.
The motor device is showing as offline all the time.
I have the below configs in things:

Bridge bluetooth:bluegiga:adapter1 “BlueGiga Adapter” [ port=“/dev/ttyACM1”, discovery=false ]

Thing bluetooth:am43:adapter1:motor1 “AM43 Blind Drive Motor 1” (bluetooth:bluegiga:adapter1) [ address=“02:D2:12:B3:59:50”, refreshInterval=300, invertPosition=false ]

The bluegiga is online but the motor is always offline (device not connected).

Any suggestions?

Ok, im officially out of ideas :).

The bridge is online and working fine, but the motor thing is offline.

2020-08-07 11:13:42.462 [DEBUG] [.bluetooth.am43.internal.AM43Handler] - Unable to send command GetAllCommand to device 02:D2:12:B3:59:50: not connected
2020-08-07 11:13:42.463 [DEBUG] [.bluetooth.am43.internal.AM43Handler] - Unable to send command GetBatteryLevelCommand to device 02:D2:12:B3:59:50: not connected
2020-08-07 11:13:42.464 [DEBUG] [.bluetooth.am43.internal.AM43Handler] - Unable to send command GetLightLevelCommand to device 02:D2:12:B3:59:50: not connected

How can i make it connected!?

If you are having trouble connecting to the device I would suggest checking whether or not the device is turned on. If it is on and you still can’t connect to it then it might be frozen. If it is frozen then it wouldn’t respond to manual button inputs either. If it is frozen, then the only way to unfreeze it is to restart the device, which given that it is unresponsive to manual button inputs would require the device to shutoff by running out of power. You can either wait for it to run out of power (which might take a while) or you could take apart the motor cover and disconnect the battery from the rest of the circuit, wait 10 seconds, and then reconnect the battery.

Another reason that it might not be able to connect is because your bluegiga adapter is not close enough to the motors. I’ve found that the AM43 is rather picky about signal quality so it requires bluetooth adapter to be close by.

What would be the recommended bluetooth adapters for use in OH to reliably connect to the AM43?

I use a LM1010 and a +12db antenna, which might be overkill but I’ve found it to be the most reliable solution for my setup.

Will a bluegiga adapter work as well?
Will OH detect the this LM1010 adapter if my OH is a docker container?

A bluegiga adapter works as well, but it didn’t have the same range as the LM1010 gave me.

The LM1010 uses bluez so I don’t know if it would be recognized in a docker container or how to configure it to be recognized.

I just got the LM1010 and plugged it into the ubuntu server that host the OH docker, but its not shown under /dev/tty. I am not sure how to open the LM1010 to the OH docker as the zwave and zigbee2mqtt usb devices are seen in /dev/tty

Hi everyone , I have bought the AM43 blind engine and on May 1 I already asked some support that was rapidly answered, for which I was very greatful :slightly_smiling_face:

Based on the response I decided to give it a go with the RaspberyPi4, but I think I’ve taken on too much for me to chew.

  1. I’ve installed OpenHabian according to the Raspberry Pi (Prepackaged SD Card Image).
  2. Went through the Quickstart guide and stuff and have everything running, including the Paper UI
  3. From there I added the Bluetooth binding
  4. Then I try to search for devices, but it finds nothing automatically
  5. Therefore I SSH into my openhabian and used hcitool -i hci0 lescan to find my AM43’s MAC (02:FD:11:CD:A6:6A)
  6. I created a new AM43 thing and added that address
  7. PaperUI shows me that this Thing now needs a Bridge, and this is where it goes over my head

Now I am not entirely sure what to do. I would like to use the built in Bluetooth adapter of the Raspbery 4. If I understood correctly you need to add the BlueZ Adapter, so I tried to do that manually. I retrieved the MAC from the sudo bluetoothctl command, or the bluetoothctl menu, and it states the following details on the controller:
Controller DC:A6:32:BD:1A:89
Name: openhab
Alias: openhab
Class: 0x000000
Powered: yes
Discoverable: yes
Pairable: yes
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
Modalias: usb:v1D6Bp0246d0532
Discovering: no

I tried adding DC:A6:32:BD:1A:89 as the address of the BlueZ adapter that I try to add manually. When I press the complete button I get the following error in the log:
2020-09-05 19:46:33.101 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler@2c1d3f’: BlueZ JNI connection cannot be established.
java.lang.IllegalStateException: BlueZ JNI connection cannot be established.
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:72) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
Caused by: java.lang.UnsatisfiedLinkError: tinyb.BluetoothManager.getNativeAPIVersion()Ljava/lang/String;
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:67) ~[?:?]
… 10 more
2020-09-05 19:46:33.114 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘bluetooth:bluez:8f7f58bf’: BlueZ JNI connection cannot be established.
java.lang.IllegalStateException: BlueZ JNI connection cannot be established.
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:72) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_265]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_265]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_265]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
Caused by: java.lang.UnsatisfiedLinkError: tinyb.BluetoothManager.getNativeAPIVersion()Ljava/lang/String;
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:67) ~[?:?]
… 10 more

I’ve tried to go through all sorts of posts, but I can’t figure out how to continue from here and be able to operate my blinds through OpenHab

Did you overcome the 5 min autostop limit?
I have the same issue. My window is 220 cm tall (86,6 in) and I have to press up (or down) twice during the opening (or closing).
I tried factory reset, setting the up and down limit again. I even tried to switch from solar to just wired, but nothing seems to help. After 5 min the motor just stops and there is nothing I can do about it.
I wanted to use the homebridge plugin and have it controled via siri. But with this limitation, it’s not possible with full comfort.
Fyi the plugin I tried is this one: https://www.reddit.com/r/homebridge/comments/hydz0p/ive_created_a_plugin_to_connect_the_cheap_am43/

Hey cpmeister, since Chinmoku is not responding, I’m asking you too - I have this “turn off after couple of mins” issue as well. My window is huge and it takes the engine about 18 minutes to fully close or open the blinds. I do have upper/lower limits set correctly - since the engine correctly stops at these positions. However during the opening or closing, the engine won’t go full up or down and it stops every 5 minutes no matter what. This means that I have to manually press up/down 3 times during opening or closing. It is quite frustrating since the main reason why I bought it is to not to worry about opening/closing the blinds - just one button or voice command (siri through homebridge plugin) and it does it’s job without interfering.
I hoped I could somehow overcome this with the homebridge plugin but so far I couldn’t figure out how.

It might be defective motor, but it might also be the overload protection for the motor kicking in. I don’t know for sure if automatic shutoff is timer based or distance based. Have you tried adjusting speed channel? I haven’t used it myself but that channel should control the rpms of the motor. If the shutoff is timer based then increasing the speed might allow the motor to complete full up/down before the timer kicks in. No idea if it would work but I think it is worth a shot trying.

I have the same problem and the manual copy of *.so files to java JRE directory helps me. Please try following steps:

wget https://github.com/openhab/openhab-addons/raw/2.5.x/bundles/org.openhab.binding.bluetooth.bluez/src/main/resources/lib/armv6hf/libtinyb.so

wget https://github.com/openhab/openhab-addons/raw/2.5.x/bundles
/org.openhab.binding.bluetooth.bluez/src/main/resources/lib/armv6hf/libjavatinyb.so

sudo cp lib* /opt/jdk/zulu8.48.3.246-ca-jdk8.0.265-linux_aarch32hf/jre/lib/aarch32/

sudo systemctl restart openhab2

I have a new installation of OpenHab2 on Raspberry Pi. I am using a BlueZ drivers and have added Bluetooth Interface openHABianDevice that works fine.

The AM43 thing was successfully detected on PaperUI as:
Bluetooth Interface openHABianDevice - AM43 Blind Drive Motor AM43 Blind Drive Motor 02:FA:B9:00:F6:FE

but when I add it, I the thing has OFFLINE status and I’ve found following error in logs:
2020-11-02 21:19:08.625 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.bluetooth.am43.internal.AM43Handler@14421cd’: Duplicate channels bluetooth:am43:hci0:02fab900f6fe:rssi

java.lang.IllegalArgumentException: Duplicate channels bluetooth:am43:hci0:02fab900f6fe:rssi

at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:165) ~[?:?]

at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:157) ~[?:?]

at org.eclipse.smarthome.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:153) ~[?:?]

at org.eclipse.smarthome.core.thing.binding.builder.ThingBuilder.withChannel(ThingBuilder.java:76) ~[?:?]

at org.openhab.binding.bluetooth.BeaconBluetoothHandler.initialize(BeaconBluetoothHandler.java:107) ~[?:?]

at org.openhab.binding.bluetooth.ConnectedBluetoothHandler.initialize(ConnectedBluetoothHandler.java:67) ~[?:?]

at org.openhab.binding.bluetooth.am43.internal.AM43Handler.initialize(AM43Handler.java:91) ~[?:?]

and
2020-11-02 21:19:08.548 [me.event.InboxRemovedEvent] - Discovery Result with UID ‘bluetooth:am43:hci0:02fab900f6fe’ has been removed.

2020-11-02 21:19:08.587 [hingStatusInfoChangedEvent] - ‘bluetooth:am43:hci0:02fab900f6fe’ changed from UNINITIALIZED to INITIALIZING

2020-11-02 21:19:08.678 [hingStatusInfoChangedEvent] - ‘bluetooth:am43:hci0:02fab900f6fe’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Duplicate channels bluetooth:am43:hci0:02fab900f6fe:rssi

2020-11-02 21:19:19.517 [hingStatusInfoChangedEvent] - ‘bluetooth:am43:hci0:02fab900f6fe’ changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Duplicate channels bluetooth:am43:hci0:02fab900f6fe:rssi to OFFLINE: Device is not connected.

The same Duplicate channels ... errors I got when I add a think manually:
bluetooth:am43:adapter3:motor1 “AM43 Blind Drive Motor 1” (bluetooth:bluez:hci0) [ address=“02:FA:B9:00:F6:FE”, refreshInterval=300, invertPosition=false ]

Thank you for any help!

Is your system running OH 2.5 or OH 3? If you are running OH 2.5 go look for my more recent posts on the bluetooth revivial topic where I left instructions for installing the latest bluetooth binding. Adding the linked bluetooth-2.5.9 jar to your addons folder should fix the issue for you after you uninstall your current bluetooth bundle through the OH cli.