alextud / ha-switchbot-curtain

Controls switchbot curtain using Home Assistant
MIT License
55 stars 16 forks source link

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

Open bliekp opened 3 years ago

bliekp commented 3 years ago

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.

DCSBL commented 3 years ago

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.

bliekp commented 3 years ago

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....

LouiS22 commented 3 years ago

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 :) ).

bliekp commented 3 years ago

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!

rw377 commented 3 years ago

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?

alextud commented 3 years ago

Integration with hub is not possible ...