dietah / mqtt-switchbot

Control a SwitchBot switch via mqtt messages

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No bots found

Flachzange opened this issue · comments

Hi @dietah,

first of all, thanks for providing the switchbott/mqtt bridge. I managed to get the docker image built and I am runnning it in a Truenas Scale K8s environment. After getting rid of all issues, the mqtt-switchbot container starts without error. However, it does not find any bots. I have two switchbot curtain rod 2. Is there anything I need to do additionally to disvover the bots?

2023-02-05 13:33:50.942553+00:002023-02-05T13:33:50.942553208Z
2023-02-05 13:33:50.942590+00:00> mqtt-switchbot@1.1.1 start /usr/src/app
2023-02-05 13:33:50.942599+00:00> node index.mjs
2023-02-05 13:33:50.942605+00:002023-02-05T13:33:50.942605478Z
2023-02-05 13:33:51.094414+00:00�[32m[2023-02-05T14:33:51.092] [INFO] mqtt-switchbot - �[39menvironment variables:
2023-02-05 13:33:51.094461+00:00{
2023-02-05 13:33:51.094469+00:00LOG_LEVEL: 'DEBUG',
2023-02-05 13:33:51.094476+00:00SCAN_DURATION: 6000,
2023-02-05 13:33:51.094482+00:00DEVICE_LIST: undefined,
2023-02-05 13:33:51.094489+00:00RETRY_LIMIT: 5,
2023-02-05 13:33:51.094495+00:00MQTT_HOST: 'mosquitto.ix-mosquitto.svc.cluster.local',
2023-02-05 13:33:51.094506+00:00MQTT_PORT: 1883,
2023-02-05 13:33:51.094512+00:00MQTT_USERNAME: '[REDACTED]',
2023-02-05 13:33:51.094519+00:00MQTT_PASSWORD: '[REDACTED]',
2023-02-05 13:33:51.094525+00:00MQTT_TOPIC: 'switchbot'
2023-02-05 13:33:51.094532+00:00}
2023-02-05 13:33:51.176149+00:00�[32m[2023-02-05T14:33:51.175] [INFO] mqtt-switchbot - �[39mstarted scanning
2023-02-05 13:33:57.307562+00:00�[32m[2023-02-05T14:33:57.306] [INFO] mqtt-switchbot - �[39mfound 0 bot(s)
2023-02-05 13:33:57.308052+00:00�[32m[2023-02-05T14:33:57.307] [INFO] mqtt-switchbot - �[39mcould not find any bots, shutting dow

Using hcitool lescan on the host I can easily find the MAC of the switchbot device in question. So the hardware and the drivers are working.

What can I do to further debug the issue?

Many thanks!

commented

Hi @Flachzange ,

In my code I only filter on type bot here and here.
The initial scan is skipped if you provide the device list on startup, but in the work function it tries to regain contact.

If you have the code build locally you can try adapting the parameter to c and see if that helps discovering them.
More info on the device filter here

You might also need to extend the list of command actions here

Good luck!

Thanks @dietah for the hint. After adjusting the code I was able to control the curtain bots although I seem to have general issues with my usb bluetooth 5.0 device. I can only send a single bluetooth command. After that I have to a hciconfig hci0 down/up to make it work for the next command. But that is a different story...