cagnulein / switchbot_press

This is a simple project that manage the Switchbot ( https://amzn.to/3dnliBD ) that has only the "press" ability in Home Assistant.
GNU Lesser General Public License v3.0
14 stars 5 forks source link

SwitchBot documentation #1

Closed AlanMackie closed 2 years ago

AlanMackie commented 4 years ago

Hi, I have installed your component and HASSIO finds the entity no problem but "pressing" does nothing.

Does the setup require a SwitchBot hub?

Switchbot works fine via my iphone app but not via HASSIO.

Thanks

Alan

cagnulein commented 4 years ago

Hi, no you don't need a hub but you need a Bluetooth adapter connected to your HASS installation

AlanMackie commented 4 years ago

Great thanks. That is what I thought. I have a bluetooth adaptor. How do I connect to HASS? I am running it as a virtual machine on a PC.

cagnulein commented 4 years ago

First of all you need to connect the adapter into the VM. Which VM are you using? Virtual box? You have to select the adapter in the usb menu

AlanMackie commented 4 years ago

yes, using virtual box. I have just added the bluetooth USB device on virtual box and also added the device_tracker:

And restarted my Hass install.

No Joy

I didnt start virtual box...

cagnulein commented 4 years ago

Let's have a look into the logs, what did they say?

AlanMackie commented 4 years ago

I have restarted the VM. When I looking in known_devices.yaml my bluetooth speaker is listed. I deleted that from known_devices and restarted HA and it added the speaker back in.

It is the only device listed there. So bluetooth seems to be finding some devices.

switchbot is added as an entity, so that bit is working.

cagnulein commented 4 years ago

ok so now please add in your configuration.yaml these lines:

logger:
  default: info
  logs:
    switchbot_press: debug

and try to press the switchbot from lovelace

AlanMackie commented 4 years ago

done that and not showing in the HA log

cagnulein commented 4 years ago

Did you restart HASS and did you turn on the entity?

cagnulein commented 4 years ago

If yes ,post all the logs. It must be something

bezlitza commented 4 years ago

good afternoon. Installed your switch bot integration. It doesn't work. ((I have hassia on a raspberry pi+). I apologize if my English is bad, I use a translator. I am from Russia

bezlitza commented 4 years ago

Скриншот 13-05-2020 165228 Скриншот 13-05-2020 165309

cagnulein commented 4 years ago

@bezlitza could you please post some logs? has the raspberry the bluetooth? is it connected to the HASS correctly?

bezlitza commented 4 years ago

logs.txt

bezlitza commented 4 years ago

Bluetooth is available. There was a bluetooth tracker in the configuration (and it worked). now I will add ble tracker.

bezlitza commented 4 years ago

Added ble tracker and didn't help. I have an esp 32 ble gateway. Is it possible to connect to it?

cagnulein commented 4 years ago

@bezlitza did you set to debug into the configuration.yaml? could you please provide the configuration.yaml about the switchbot integration?

bezlitza commented 4 years ago

For some reason, my integrations have stopped being deleted. I delete the lines in the configurator, but the device is still there after reboot, but in the unvialiable state

bezlitza commented 4 years ago

I installed it. something should be displayed and where?

cagnulein commented 4 years ago

@bezlitza you should see the switchbot in the entities

bezlitza commented 4 years ago

image

bezlitza commented 4 years ago

the first three are deleted

cagnulein commented 4 years ago

@bezlitza seems fine, so now try to turn it on in the dashboard

bezlitza commented 4 years ago

I've tried it a bunch of times. and through lovelace and here. Nothing happens at all. In lovelace the button turns off after a few seconds

cagnulein commented 4 years ago

@bezlitza so the plug-in reacts, so please put switchbot_press to debug, give a turn on cycle and post the logs

bezlitza commented 4 years ago

logs.txt

cagnulein commented 4 years ago

@bezlitza which version of HASS do you have?

cagnulein commented 4 years ago

@bezlitza post your configuration.yaml too

bezlitza commented 4 years ago

confyaml.txt 0.109.6

cagnulein commented 4 years ago

@bezlitza i think you have to change in this way in order to have debug log

logger:
  default: info
  logs:
    switchbot_press: debug

I will check also the log tomorrow, let's try with this configuration and I hope we will see some useful information

bezlitza commented 4 years ago

logs.txt Скриншот 13-05-2020 215147

bezlitza commented 4 years ago

thanks

bezlitza commented 4 years ago

Thank you very much. your integration started working after manipulating bluetooth on your phone. I manually connected the switch bot and disabled it in the phone settings and everything worked. Now it is controlled from both a smartphone and ha

cagnulein commented 4 years ago

@bezlitza strange, i didn't anything on my phone side in order to have HA working. Anyway good job!

cagnulein commented 4 years ago

@AlanMackie did you solve the issue? any updates?

AlanMackie commented 4 years ago
    Thanks for asking. I only had a little time yesterday to try some fixes and won’t have much today either. 

Keen to get it fixed though so will be back in touch. Really appreciate all your support.

    Regards

Alan Mackie

On Thu, May 14, 2020 at 7:07 AM +0100, "cagnulein" notifications@github.com wrote:

@AlanMackie did you solve the issue? any updates?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

bezlitza commented 4 years ago

Good evening. it stopped working again. I don't know why.

bezlitza commented 4 years ago

logs.txt

cagnulein commented 4 years ago

logs.txt

i checked the log and i can't find any trace at all of switchbot pressing, are you sure you are asking to press it?

try adding:

logger:
  default: info
  logs:
    pyswitchbot: debug
bezlitza commented 4 years ago

logs.txt

bezlitza commented 4 years ago

I press. and nothing happens.

cagnulein commented 4 years ago

I press. and nothing happens.

i saw no evidence at all in your log, maybe you're pressing a wrong entity? bluetooth tracker it's still working? maybe the switchbot is too far and only sometime works?

bezlitza commented 4 years ago

Just deleted device trackers and put switchbot on raspberry. It doesn't work again.

cagnulein commented 4 years ago

Just deleted device trackers and put switchbot on raspberry. It doesn't work again.

logger:
  default: info
  logs:
    pyswitchbot: debug
    switchbot_press: debug
    switchbot: debug

You must have something to the logs if you enable all these 3 debug log... Did you try to search the switchbot from the raspberry with bluetoothctl?

bezlitza commented 4 years ago

logs.txt

cagnulein commented 4 years ago

logs.txt

finally something it comes:

2020-05-15 11:40:06 DEBUG (SyncWorker_3) [switchbot] Sending command to switchbot 570102
2020-05-15 11:40:06 DEBUG (SyncWorker_3) [switchbot] Connecting to Switchbot...
2020-05-15 11:40:08 DEBUG (SyncWorker_7) [switchbot] Sending command to switchbot 570100
2020-05-15 11:40:08 DEBUG (SyncWorker_7) [switchbot] Connecting to Switchbot...

These are command sends to switchbot plugin not switchbot_press plugin, infact these commands are for turn on and turn off, not pressing. I think you've misconfigured the switchbot entity.

Moreover, you have problems also with the switchbot standard plugin, infact:

2020-05-15 11:41:51 WARNING (MainThread) [homeassistant.components.switch] Updating switchbot_press switch took longer than the scheduled update interval 0:00:30
2020-05-15 11:41:51 WARNING (MainThread) [homeassistant.components.switch] Updating switchbot switch took longer than the scheduled update interval 0:00:30

Both plugins fail to load...

bezlitza commented 4 years ago

image What should I do?

cagnulein commented 4 years ago

image What should I do?

you have to delete the switchbot part, only the first 3 lines must remain!

bezlitza commented 4 years ago

logs.txt

bezlitza commented 4 years ago

not help. it still doesn't work