Emit MQTT events from victron-ble
Project description
victron_ble2mqtt
Emit MQTT events from Victron Energy Solar Charger via victron-ble
This is in early, not useable state!
Tested with:
- Solar Charger: SmartSolar MPPT 100/20
- Raspberry Pi Zero 2 W with Raspberry Pi OS Lite
- Mosquitto MQTT Broker
- Home Assistant MQTT integration
Usage
Bootstrap
Clone the sources and just call the CLI to create a Python Virtualenv, e.g.:
~$ git clone https://github.com/jedie/victron-ble2mqtt.git
~$ cd victron-ble2mqtt
~/victron-ble2mqtt$ ./cli.py --help
Setup Device
Detect your device first, e.g.:
~/victron-ble2mqtt$ ./cli.py discover
...
{
'name': 'SmartSolar HQ2248AM79D',
'address': 'E7:37:97:XX:XX:XX',
'details': {
'path': '/org/bluez/hci0/dev_E7_37_97_XX_XX_XX',
'props': {
'Address': 'E7:37:97:XX:XX:XX',
'AddressType': 'random',
'Name': 'SmartSolar HQ2248AM79D',
'Alias': 'SmartSolar HQ2248AM79D',
'Paired': False,
'Trusted': False,
'Blocked': False,
'LegacyPairing': False,
'RSSI': -89,
'Connected': False,
'UUIDs': [],
'Adapter': '/org/bluez/hci0',
'ManufacturerData': {737: bytearray(b'...')},
'ServicesResolved': False
}
}
}
...
(Hit Ctrl-C to abort)
Device Key
You need the Device MAC address and the key.
The easiest way to get the device key: Install the official Victron Smartphone and and copy&paste the key:
- Click on your SmartSolar device
- Go to detail page about the
SmartSolar Bluetooth Interface
- Click on
SHOW
atInstant readout via Bluetooth
/Encryption data
- Copy the Connectionkey by click on the key
(I send the key via Signal as "my note" and use the Desktop Signal app to receive the key on my Computer)
See also: https://community.victronenergy.com/questions/187303/victron-bluetooth-advertising-protocol.html
setting
Just call edit-settings
command, e.g.:
~/victron-ble2mqtt$ ./cli.py edit-settings
At least insert your MQTT settings and the device MAC and key.
Test
Start publish MQTT endless look, just call publish-loop
command, e.g.:
~/victron-ble2mqtt$ ./cli.py publish-loop
setup systemd services
Check systemd setup:
~/victron-ble2mqtt$ ./cli.py systemd-debug
Setup services:
~/victron-ble2mqtt$ ./cli.py systemd-setup
Check the services:
~/victron-ble2mqtt$ ./cli.py systemd-status
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file victron_ble2mqtt-0.1.0.tar.gz
.
File metadata
- Download URL: victron_ble2mqtt-0.1.0.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf0c1600e3b81bd8045ec15aed3fc392ffa93ef3422f9cc2b066539c18220210 |
|
MD5 | 0c1117df56dd4521948b87d626536ce0 |
|
BLAKE2b-256 | f0227e052424afcec6a3e81739d814851edc0b2453aff63baea6eea1d173351c |
File details
Details for the file victron_ble2mqtt-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: victron_ble2mqtt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.0rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d2a4157b95cd159460966d09dc925885df501c99962ae75dc1b436ba1746af8 |
|
MD5 | d972ae4b94f14b38ebe25bcba1a3dd8d |
|
BLAKE2b-256 | e386344bff607ff3f36c03ef6e524c81f20a2b704ba23777a43f4d823dd4a9ed |