Switch Bot

Hi All,

I’m about the buy a ‘‘SwitchBot’’. This is a little device that can press a button on a remote control or any other devices which have a dum button.

However. I have a remote device which needs to 2 steps to activate the device (airo)

  1. Press button to ‘‘awake’’ the remote.
  2. Press the same button for 1.5 / 2 seconds to turn on the airco.

My question is: Is this possible to do within HA? I can see that the SwitchBot is supported, however, i was wondering how i can achieve this.

Sounds like something that could easily be done with a script or automation.

The switchbot can run in 2 modes: press (momentary switch) or switch (toggle on/off like a light switch).
In press mode you can set the press duration from 0 to 60 seconds. If you can wake the remote by pressing for 2 seconds, you can simply set the press duration to 2s in the switchbot app, then in HA have a little script to trigger the switchbot twice in succession.

Edit: while I love my little switchbot, if your remote is IR or 433mhz RF it would probably be cheaper, more elegant (and more fun) to build yourself a little esp32 remote transmitter using this component: https://esphome.io/components/remote_transmitter.html

@murtoz Oke can i create a sript /automation in HA only? Or do I have to install the switchbot APP first ?

The remote controller is is unfortnetly RF 2.4 Ghz… So no way of intercept the signals becasue they are probably encrypted.

I think you’re going to need the app, if only for the initial configuration. As far as I am aware there is no way to change mode or press duration from within home assistant so you will need to do that in the app. It saves it to the actual switchbot itself though so once you have it configured to your liking, i think you never need to use the app again. I exclusively use home assistant to control mine.

Oké thanks! Bus how can ha communicate with the app so i van make an automation?

It doesn’t need to talk to the app provided your HA hardware can talk bluetooth. It will then talk directly to the switchbot itself, no hub needed. I have two switchbots working like this. All you need to know the the bluetooth mac address of the switchbot, and you can see this in the app (app home screen, click on gear icon next to the switchbot, then on the … top right and it shows the ble mac).
You then use this mac address in your configuration.yaml:

switch:
  - platform: switchbot
    mac: 'a1:b2:c3:d4:e5:f6'
    name: 'myswitchbot'

(edit: I think the mac address has to be lowercase although I can’t remember why i think this :wink: )
you can then call switch.myswitchbot in scripts and automations and do the double button press somehow.

@murtoz

Oke i have received the Switchbot. I have intergrated in HA and it is working fine. Now i am trying to create an automation to press a button 2 times. But for some reaons, it doenst work:

Here is de automation. Any idea whats wrong?

- alias: Schakel Pelletkachel aan
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: switch.pelletkachel_afstandsbediening
    to: 'on
  action:
    - delay: 00:05:00
    - service: switch.toggle
      entity_id: switch.pelletkachel_afstandsbediening

Looks like you are missing a ’ at the end of the to: 'on' section

@murtoz

Thanks it is working fine now… But i still have a big issue. When the switch bot is inactive for a couple of hours, HA cannot connect anymore. I need to start the official app and ‘‘awake’’ the switchbot from the app. After that, the switchbot is reconized again by HA.

Do you have this problem?

No I don’t. I do have issues with some xiaomi bluetooth temp & humidity sensors with my home assistant where ha is no longer able to get a signal from them. This issue then also affects the switchbot. I’m using a pi 3b+ and suspect there is a bug on this platform somewhere in the stack with regards to bluetooth. I’ve moved those sensors onto esp32s and the issue has now gone away.

Were you able to resolve this issue?

1 Like

I have the same issue, it is proving difficult to wake over Bluetooth from my rpi3. It is about 5m away but works fine once it is initially woken from its slumber

@eterpstra, hi, I was thinking about the switchbot curtain, do you need switchbot hub to connect to device? Or do you connect to HA directly? What’s the communication protocol dose switchbot use, Bluetooth, wifi, zigbee, or z-wave? Thanks

2 Likes

Also wondering this. I have Original Switchbot working directly with HA. Has anyone has tested Switchbot Curtain in HA?

There is a lot of switchbot knowledge here. Is there any wat to control (activate) the switch bot over WiFi (preferably without having to buy the hub)? I have a faulty robomow that only works if i press a button on top of the mower twice. I was thinking about buying a switchbot and manage it through HASS (make a schedule and don’t mow when it’s raining and that kind of stuff). But my HASS is on a RPI4 in the hallway and not in bluetooth range. I do have have wifi in the garden.
Or are there any ESP8266 or ESP32 (or other cheap technologies) examples where you can make your own WIFI button presser.

Were you referring to the switchbot Bot that is working for you? Is it still working. Read from another thread, a few are having trouble with the Bot.

I, too, am interested with the curtain as well. My amazon country says it will be available on Sept 15. However, I will wait until others on HA forum reports if they can get it to work with HA before purchasing.

1 Like

Edit: while I love my little switchbot, if your remote is IR or 433mhz RF it would probably be cheaper, more elegant (and more fun) to build yourself a little esp32 remote transmitter using this component:

So are you basically creating your own ‘smart’ remote with ir/rf codes using the esp32 and the esp32 needs to be in line of sight with the devices you want to control?
Wouldn’t it be cheaper or cost just a much to get a Broadlink to learn the codes?

No I don’t. I do have issues with some xiaomi bluetooth temp & humidity sensors with my home assistant where ha is no longer able to get a signal from them.

Your Switchbot Bot is still working for you with no disconnect even after the Bot has gone to sleep? I am thinking about picking one up to turn on my tv box. It uses bluetooth to transmit the signals. My main concern is that the tv box is quite far from HA and the Bot may be out of BT range.

I have the Switchbot Thermometer/Hygrometer and followed this guide to setup.

Hello,

I’ve been using a few of this SwitchBots through the hub and IFTTT.

IFTTT is moving to a pay subscription and I see little value with only a handful of bots.

Any idea if HA can connect to the SwitchBot HUB and how?

Could not find any information about it.

Thank you.

Could you please tell me how did you integrate them? I have added the BLE MAC but I can’t trigger it.