• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BLE to MQTT Gateway for Smarthome and IoT Devices

Cybele

Cybele is a generic and extensible application used to bridge Bluetooth Low Energy devices to MQTT.

It is written in Javascript and utilizes the BlueZ Linux Bluetooth stack via its D-Bus interface.

Features

Cybele can..

  • Connect to a multitude of devices
  • Use multiple HCI Dongles to work around hardware limitations
  • Run own GATT Services

Supported devices

Currently, the following devices/device types are supported:

You can click on the device to jump to its documentation.

Requirements

Since Cybele uses BlueZ, you will need some GNU+Linux distribution.

You will also need a recent version of nodejs. Development was done using Node 11.

The BlueZ Version needs to be rather new as well. Debian Busters BlueZ 5.50 is sufficient.

Deployment

Deployment is simple:

  1. Clone this repo
  2. Navigate into the cloned repo and run npm install
  3. Copy config.default.json to config.json and edit according to your needs. Documentation can be found here.
  4. Run app.js. Either manually using node app.js or by using the provided systemd unit file.

A sample systemd unit file is included here.

Place it in /etc/systemd/system/ and don't forget to change the paths in it if required.

Known Issues

As of now (2020-10-30), there's a bug in bluetoothd which causes it to constantly write all state changes of everything all the time to disk. This has caused the death of multiple brave 16GB micro sd cards which couldn't handle 50+TBW :(

As a mitigation, I'm currently using a ramdisk for the bluetooth state directory:

Add this to your /etc/fstab:

tmpfs           /tmp/bluetoothstate        tmpfs   nodev,nosuid,size=60M 0 0

Create a symlink ln -s /tmp/bluetoothstate /var/lib/bluetooth

And use this systemd service /etc/systemd/system/bluetoothramdisk.service:

[Unit]
RequiredBy=bluetooth.service
PartOf=bluetooth.service

[Service]
Type=oneshot
User=root
ExecStart=/usr/bin/rsync -ar /opt/bluetooth_backup/ /tmp/bluetoothstate/
ExecStop=/usr/bin/rsync -ar /tmp/bluetoothstate/ /opt/bluetooth_backup/
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

You may need to create /opt/bluetooth_backup beforehand and initially seed it with your current data.

Misc

Please note that Cybele is currently in its early stages. There is still a lot to do regarding both error handling as well as code-cleanup.

GATT Services

To run own GATT services, you also need permission to bring up a service on the system D-Bus.

A sample configuration which grants these rights to a user named pi is included here.

Just place that file in /etc/dbus-1/system.d and you should be able to use the included CurrentTimeService.

Why the name?

No particular reason. I just needed something less generic than ble2mqtt or bleGateway.

It also fits nicely with Valetudo

More Repositories

1

Valetudo

Cloud replacement for vacuum robots enabling local-only operation
JavaScript
6,584
star
2

esp8266-vindriktning-particle-sensor

Wifi MQTT Data Logging via an esp8266 for the Ikea VINDRIKTNING PM2.5 air quality sensor
C++
1,167
star
3

valetudo-dreameadapter

148
star
4

ICantBelieveItsNotValetudo

A Valetudo companion service which renders maps to pngs
JavaScript
129
star
5

deye-microinverter-cloud-free

Documentation and tooling to use Deye microinverters without the solarman cloud
JavaScript
121
star
6

hass-scene_presets

Hue-like scene presets for lights in home assistant
TypeScript
115
star
7

esp8266-midea-dehumidifier

Cloud-free wifi dehumidification
C++
112
star
8

esp8266-deerma-humidifier

Cloud-free wifi humidification
C++
46
star
9

valetudo-helper-miioota

Install rooted firmwares via miio local OTA
JavaScript
40
star
10

SilenTeams

Turn off MS Teams Taskbar Notifications by employing malware techniques
C++
40
star
11

glance-clock

Glance Clock BLE protocol reverse-engineered
37
star
12

valetudo-companion

Valetudo Companion App for Android
Kotlin
31
star
13

Valetudo-Minecraft-Mapper

Create a Minecraft World from your Valetudo Map
JavaScript
25
star
14

valetudo-helper-httpbridge

Utility webserver
JavaScript
14
star
15

hollywood-hacker

Sometimes you just want to look important and skillful
13
star
16

valetudo-tray-companion

Valetudo Companion App for the Windows Tray
C#
12
star
17

schellenberg-qivicon-usb

Schellenberg USB protocol
11
star
18

WiFiFanCon

Control 12V PC Fans via Wi-Fi
Berry
9
star
19

airgradient-cloud-free

Airgradient air quality sensor cloud replacement and firmware modifications
C++
9
star
20

valetudo-helper-voicepacks

C
8
star
21

glance-clock-assets

Glance Clock Assets
8
star
22

hass-valetudo-icons

Valetudo Icons for Home Assistant
8
star
23

huesful-power-adaptor

Use proper PSUs with Hue Signes, Playbars and more
7
star
24

Smarthome

Node/mongo/express server logging sensor data and providing graphs with highcharts. RESTful
JavaScript
6
star
25

Valetudo-Openhab

Stuff related to using Valetudo with Openhab
6
star
26

deye-microinverter-cloud-free-assets

5
star
27

valetudo-misc

Random valetudo-related stuff
Dockerfile
4
star
28

huesful-mounts

3d-printable wall-mounting adapter plates for hue remotes
OpenSCAD
3
star
29

fiio-bta30-protocol

Documentation on the BLE protocol of the FiiO BTA30 DAC & Bluetooth Transceiver
3
star
30

better-button-card

A button-card custom Home Assistant Lovelace Card which has no external dependencies
JavaScript
3
star
31

sieve-ruleset

An excerpt of my sieve ruleset
3
star
32

node-tradfri

Control Ikea Homesmart Tradfri devices using javascript
JavaScript
3
star
33

valetudo-helper-miio

Miio toolbox
JavaScript
2
star
34

BotanischerGarten

A broken mess
TypeScript
2
star
35

home-assistant-no-cloud-custom-component

Use default_config: without the cloud integration
Python
2
star
36

custom-scene_presets

Custom presets to be used with the scene_presets home assistant custom component
2
star
37

meter2mqtt

JavaScript
1
star
38

valetudo-knowledgebase

Here be dragons
1
star
39

squeezelite-downloads

Automatically exported from code.google.com/p/squeezelite-downloads
1
star
40

mikettle2mqtt

Mi Kettle to mqtt bridge
JavaScript
1
star
41

osx-configs

1
star
42

ttrss-plugin-opengraph

Global tt-rss plugin to add opengraph meta tags to shared articles
PHP
1
star
43

Valetudo-Godot-Livemap

Renders a live 3D representation of a Valetudo Map in the Godot Engine
GDScript
1
star
44

simcity3000-strings-de

Kulturgut welches gesichert gehört
1
star
45

webpidginz

Webinterface Plugin for Pidgin || Fork of http://www.shaorang.com/webpidginz/
1
star
46

schellenberg2mqtt

JavaScript
1
star