mKeRix / room-assistant

Presence tracking and more for automation on the room-level
https://www.room-assistant.io
MIT License
1.27k stars 122 forks source link

Not being able to configure BLE and Mi Band 4 #153

Closed ccrespoa closed 4 years ago

ccrespoa commented 4 years ago

Hi,

First thing I have to say is that It is the first time I submit an issue on Github, so I will say sorry in advance just in case if this is not the right place to submit the following topic.

I have successfully configured a small cluster of room assistant with one Pi 3b connected via ETH directly to my router running Home Assistant, and a remote Pi Zero W following instructions from the website.

The initial configuration I have applied in both devices is the following one:

(Pi 3B - Room assistant Add On in Home Assistant)global: instanceName: livingroom integrations:

(Pi Zero W) global: instanceName: Livingroom integrations:

Considerations: I have also installed MQTT broker in HA so that I can avoid some additional lines to the previous config.

Once confirmed that the Classicbluetooth worked with my Android smartphone, I wanted to tested with my smarband Mi Band 4, but so far I have been able to replicate the config with bluetoothLowEnergy integration.

This is what I am trying to do;

(Pi 3B - Room assistant Add On in Home Assistant) global: instanceName: livingroom integrations:

I first tried with this standalone config in Home Assistant, without any luck. Home Assistant is not seeing neither the switch nor the sensor.

I also tried appliging the room assistant config in the remote Pi Zero W, without luck again. In this case, same config but adding the Home Assistant integration + Broker info.

Any idea how to solve the issue? What am I doing wrong?

Thanks!

mKeRix commented 4 years ago

For BLE you won't see switches being added as the room-assistant instances are scanning passively. The id format looks ok to me. The logs will list all devices that the instances discover with BLE - is your ID/device listed there?

Also note that you will still need - homeAssistant listed under integrations on the Pi 3B. :)

ccrespoa commented 4 years ago

Hi, Thanks a lot for your response.

I have been able to have the Pi Zero W working. The main issue was that I didn't install the extra packages needed as stated in the https://www.room-assistant.io/integrations/bluetooth-low-energy.html section, Node JS. Honestly, I was not aware that my Pi Zero W unit was running node JS so I basically discarded that section.

On the other side, the Pi 3+, initially I didn't include the homeAssistant under integrations because the same config using BluetoothClassic worked fine (without homeassistant integration). I have tried a couple of things now without luck:

First try:

instanceName: livingroom
integrations:
- homeAssistant
- bluetoothLowEnergy
bluetoothLowEnergy:
whitelist:
- 9g549hb4f69e

Second try:

instanceName: livingroom
integrations:
- homeAssistant
- bluetoothLowEnergy
homeAssistant:
mqttUrl: mqtt://xx.xx.xx.xx:1883
mqttOptions:
username: user
password: password
bluetoothLowEnergy:
whitelist:
- 9g549hb4f69e

None of them have worked. In fact, now I am wondering if my Pi 3B+ needs to include the same packages which were missing in the Pi Zero W before working. Those are:

sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev sudo npm i --global --unsafe-perm room-assistant

If so, what is the method for accessing the command line in my Pi 3B+ if Home Assistant is installed?

mKeRix commented 4 years ago

If you're using Home Assistant (formerly known as HassOS/Hass.io) you should just use the Hassio.io addon - that will have all the dependencies already installed. Regular Docker images also have the dependencies already installed, but need special permissions to be set as documented on the integration page.