bt-sensors-plugin-sk
v1.1.0-beta.2.2.0.1
Published
Bluetooth Sensors for Signalk -- support for Victron devices, RuuviTag, Xiaomi, ATC and Inkbird, Ultrasonic wind meters, Mopeka tank readers, Renogy Battery and Solar Controllers (new), Aranet4 environment sensors, and Govee GVH51xx temp sensors
Downloads
706
Maintainers
Readme
Bluetooth Sensors for Signal K
BETA 2.2.0
What's New
Support for Aranet4 environment sensor and Renogy Rover/Wanderer Controllers. Untested support for Renogy Battery and Inverter clients. If you have a Renogy Battery or Inverter with bluetooth support, please give it a try and let me know how it goes.
RENOGY NOTES
The class of Renogy Devices cannot be reliably identified from their Bluetooth advertisements.
On the plugin config page, You will need to select the device from the Device dropdown, then select the appropriate class from the Class dropdown. After that, you will need to hit the Submit button. On restart of the plugin, the plugin should recognize the device. If you've selected the appropriate class (RenogyRoverClient for example), you should see configs for paths.
WHAT IT IS
BT Sensors Plugin for Signalk is a lightweight BLE (Bluetooth Low Energy) framework for listening and connecting to Bluetooth sensors on your boat and sending deltas to Signalk paths with the values the sensors reports.
The Plugin currently supports every documented Victron device (AC Charger, Battery Monitor, DC-DC Converter, DC Energy Meter, GX Device, Inverter, Inverter RS, Lynx Smart BMS, Orion XS, Smart Battery Protect, Smart Lithium and VE Bus), Xiaomi devices, ATC devices, RuuviTags and Inkbird thermometers.
A typical use case is a Bluetooth thermometer like the Xiaomi LYWSD03MMC, an inexpensive Bluetooth thermometer that runs on a 3V watch battery that can report the current temperature and humidity in your refrigerator or cabin or wherever you want to stick it (no judgement.)
The reported temperature can then be displayed on a Signalk app like Kip, WilhelmSK or, with appropiate mapping to NMEA-2000, a NMEA 2000 Multi-function display.
It's pretty easy to write and deploy your own sensor class for any currently unsupported sensor. More on that in the development README.
WHO IS IT FOR
Signalk users with a Linux boat-puter (Windows and MacOS are NOT currently supported) and Bluetooth sensors they'd like to integrate into their Signalk datastream.
REQUIREMENTS
- A Linux Signalk boat-puter with System-D (NOTE: Most Linux installations support System-D)
- A Bluetooth adapter
- Bluez installed (Go here for Snap installation instructions)
- Node-ble (installs with the plugin)
INSTALLATION
NOTE: If you're running the 1.0.3 release, you will have to reconfigure your devices.
Signalk Appstore
The plugin is currently available in the Signalk Appstore.
NPM
Go to you signalk home (usually ~/.signalk) and run:
npm i [email protected]
Linux
If you want to install directly from source (this is mostly of interest to custom sensor class developers) execute the following from a command prompt:
Finally, restart SK. Plugin should appear in your server plugins list.
NOTE: "~/.signalk" is the default signalk home on Linux. If you're getting permissions errors executing npm link, try executing "npm link" under sudo.
CONFIGURATION
After installing and restarting Signalk you should see a "BT Sensors Plugin" option in the Signalk->Server->Plugin Config page.
On initial configuration, wait for your Bluetooth adapter to scan devices. The plugin will scan for new devices at whatever you set the "scan for new devices interval" value to.
TIP: Close and re-open the config screen to refresh the screen. The config screen isn't as reactive as it oughtta be.
Then press the + button to add a sensor. Your screen should look something like this:
Select the sensor you want Signalk to listen to from the drop down.
If you don't see your device and you know that it's on and nearby to the server, it may not be currently supported. But fear not, you can add custom sensor classes yourself. (Check out the development section.).
Now it's a simple matter of associating the data emitted by the sensor with the Signalk path you want it to update. (Also, you can name your sensor so when it appears in logs its easy to recognize.)
The plugin doesn't need for Signalk to restart after submitting your config but restart if that makes you more comfortable.
ADVERTISED DATA
Most supported Bluetooth sensors broadcast (or advertise) their device's data without an explicit connection. Some devices broadcast their data encrypted. Supported devices with encrypted advertised data will allow you to input the encryption key as a config parameter. NOTE: the encryption key is currently stored on the server in plain text.
GATT CONNECTIONS
If you see something like this on your device config:
You have the option of making a GATT Connection to your device. A GATT Connection is energy-inefficient but serves data from your device in more or less real-time. To learn more about GATT check out: https://learn.adafruit.com/introduction-to-bluetooth-low-energy/gatt
NOW WHAT?
You should see data appear in your data browser. Here's a screenshot of Signalk on my boat displaying battery data from a Victron SmartShunt.
You can now take the data and display it using Kip, WilhelmSK or route it to NMEA-2K and display it on a N2K MFD, or use it to create and respond to alerts in Node-Red. Isn't life grand?