As you asked how to discover device IDs, I ended up down the rabbit hole today, and discovered a way - the right way, I'm not sure, but a way!
Using a standard raspberry pi OS (64-bit) install on a Pi4B, I installed https://github.com/cyrils/renogy-bt, the mqtt-discovery branch, with:
git clone https://github.com/cyrils/renogy-bt.git -b mqtt-discovery
and following their prerequisite setup command:
python3 -m pip install -r requirements.txt
From there I edited the config.ini file to include the MAC address, and ID of the Renogy DCDC50 I had (discovered using BLE scanner on my android phone). At this point the device ID was left at 255 - so it would broadcast a request to the device based on it's MAC and Name.
The command:
python3 ./example.py config.ini
returned the data from the controller, one time in about 50, mostly just erroring after connecting in a generic bluetooth fashion.
This was improved dramatically by editing /etc/bluetooth/main.conf, to add a line at the end:
ControllerMode = le
and then rebooting
After getting a successful data set back from the controller on the command line, I could see the device ID in the data (last but one data chunk returned) as:
DEBUG:root:BT-TH-XYZXYZYXZ => {'function': 'READ', 'model': 'RBC50D1S-G1', 'device_id': 96, 'device_info': {'......
And 96 turned out to be the correct ID for my controller (the battery was '48').
Hope that helps someone save some hair/time..
As you asked how to discover device IDs, I ended up down the rabbit hole today, and discovered a way - the right way, I'm not sure, but a way!
Using a standard raspberry pi OS (64-bit) install on a Pi4B, I installed https://github.com/cyrils/renogy-bt, the mqtt-discovery branch, with:
git clone https://github.com/cyrils/renogy-bt.git -b mqtt-discovery
and following their prerequisite setup command:
python3 -m pip install -r requirements.txt
From there I edited the config.ini file to include the MAC address, and ID of the Renogy DCDC50 I had (discovered using BLE scanner on my android phone). At this point the device ID was left at 255 - so it would broadcast a request to the device based on it's MAC and Name.
The command:
python3 ./example.py config.ini
returned the data from the controller, one time in about 50, mostly just erroring after connecting in a generic bluetooth fashion.
This was improved dramatically by editing /etc/bluetooth/main.conf, to add a line at the end:
ControllerMode = le
and then rebooting
After getting a successful data set back from the controller on the command line, I could see the device ID in the data (last but one data chunk returned) as:
DEBUG:root:BT-TH-XYZXYZYXZ => {'function': 'READ', 'model': 'RBC50D1S-G1', 'device_id': 96, 'device_info': {'......
And 96 turned out to be the correct ID for my controller (the battery was '48').
Hope that helps someone save some hair/time..