ha-switchbot-curtain icon indicating copy to clipboard operation
ha-switchbot-curtain copied to clipboard

Documentation very unclear: which MAC to add? How to add multiple?

Open bliekp opened this issue 3 years ago • 6 comments

Just got 4 switchbot curtains and a hub mini. How do I add this properly? The MAC-addresses of the curtains themselves are BLE (Bluetooth) devices and my HA-setup doesn't have BLE. The hub however has a WiFi MAC-address.

How to properly set this up? The documentation is very very sparse and unclear about this.

bliekp avatar May 31 '21 07:05 bliekp

I had the same issues. But I've discovered that the integration communicates directly to the curtains without the hub over BLE. I've sold my hub because I didn't need it after all...

A bluetooth dongle fixed that I didn't have BLE for my setup (I am using a Odroid N2+). With this integrations and the following configuration I was able to get everything to work (I have 3 curtains):

# configuration.yaml
cover:
  - platform: switchbot-curtain
    mac: "AA:BB:CC:DD:EE:FF" # For example
    name: "Curtain 1"
  - platform: switchbot-curtain
    mac: "AA:BB:CC:DD:EE:FF"
    name: "Curtain 2"
  - platform: switchbot-curtain
    mac: "AA:BB:CC:DD:EE:FF"
    name: "Curtain 3"

You need the BLE MAC address from curtain, found in SB app > Device > Settings > '...' > BLE MAC.

DCSBL avatar May 31 '21 09:05 DCSBL

I see. That's a pity really, I would rather use the hub than add an extra USB-device to my Raspberry Pi setup. It's already using a powered USB-hub but that's reaching it's limit since I have a SSD, Z-Wave-stick and Zigbee-stick attached to it.

It would be great, IMHO, if the integration could use the hub instead and query that for the connected curtains and add those automatically to HA....

bliekp avatar May 31 '21 10:05 bliekp

I see. That's a pity really, I would rather use the hub than add an extra USB-device to my Raspberry Pi setup. It's already using a powered USB-hub but that's reaching it's limit since I have a SSD, Z-Wave-stick and Zigbee-stick attached to it.

It would be great, IMHO, if the integration could use the hub instead and query that for the connected curtains and add those automatically to HA....

HA's philosophy is to control the device locally (where it's possible) and use cloud if there's no other option. The reason is simple: being controlled locally, you have the power and you aren't depend on a cloud based solution (for instance: no internet, no control :) ).

LouiS22 avatar Jun 02 '21 11:06 LouiS22

Ok, I got a simple BLE dongle and managed to scan for devices using this in my configuration.yaml since hcitool is not available through Hass.io setup on a Raspberry pi:

device_tracker:

  - platform: bluetooth_le_tracker
    track_new_devices: true

The the new devices pop up in /config/known_devices.yaml, or you can look the MAC-address up in the SwitchBot App on your phone, which I did. Then add them like stated above to the configuration.yaml like this:

cover:
  - platform: switchbot-curtain
    mac: EA:0E:56:C9:A5:2B
    name: "Gordijn Woonkamer Zijkant"
  - platform: switchbot-curtain
    mac: FD:D4:98:02:53:4A
    name: "Gordijn Woonkamer Voor"

It works now, sweet!

bliekp avatar Jun 08 '21 14:06 bliekp

I'm running HA in a virtual machine inside a server far away from the curtains. I do have the Switchbot Hub Mini though. I am able to control the curtains through the app via the hub mini without being on WiFi/Bluetooth. Is there any way to get the Hub working with this integration?

rw377 avatar Jul 06 '21 18:07 rw377

Integration with hub is not possible ...

alextud avatar Jul 07 '21 07:07 alextud