neil-morrison44 / homebridge-am43-blinds-bluez

A homebridge plugin for AM43 blinds which only works on linux
MIT License
0 stars 1 forks source link

Project Status

Doing anything with BLE from node is in a pretty bad place just now, so I can't build this as well as I'd like. For me, after installing manually, this plugin will run fine 9 times out of 10 (with the 10th time requiring a reboot). If it doesn't run for you then, sorry.

If anyone wants to start a new version of this my advice would be to avoid node completely:

That'll be a lot more reliable & work for a lot more people, but requires doing embedded work in C++. I'd do it myself but, as I said, this plugin works fine for me.


Builds off of https://github.com/renssies/homebridge-am43-blinds but in typescript instead, with some additional features, but (due to BLE differences between plaforms) it'll likely only work on Raspberry Pi (/ other linux) based homebridge instances.

Homebridge AM43 Blinds

A homebridge plugin to control the AM43 based blind motors in HomeKit, these include the A-OK, Zemismart, Upndown and other blinds motors that use Bluetooth and the Blinds Engine app.

This Homebridge plugin uses the Bluetooth on your homebridge device to search for, and connect to the AM43 blinds via the "Blind Engine" part of the Settings in homebridge-config-ui.

Known Issues

DBusError: Software caused connection abort

Requirements

This plugin requires Node version 14 or newer and Homebridge version 1.3.0 or newer. It must be run on a linux system with bluez (e.g. a Raspberry PI).

Installation

Before installing set up node-ble by creating the following file in /etc/dbus-1/system.d/node-ble.conf (assuming that your homebridge instance is run as homebridge)

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
  <policy user="homebridge">
   <allow own="org.bluez"/>
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>
</busconfig>

See the node-ble docs for more information

Debugging

Running homebridge with DEBUG=AM43 should cause motor-level debug logs to be output.

So to run homebridge in debug mode use the command DEBUG=AM43 homebridge -D to log debug messages of the AM43 plugin. Or DEBUG=* homebridge -D to log messages of all plugins.

The logs can be found in ~/.homebridge or any custom folder you've specified. They should also be available in the Homebridge Config UI (if homebridge-config-ui-x is installed)