Comments (13)
Now that I had a working solution at hand, I investigated why my fixing of the node-switchbot
package failed.
I found that there were three different problems:
- BLE support failed because the status in the init function of
node-switchbot
was not "poweredOn" and no waiting for stateChange was implemented - after the problem was fixed, the device still did not work because the identifier in iosensor.ts was wrong
- with the correct identifier it still failed as
node-switchbot
does not support the sensor
I hope the related PRs are helpful to fix this issue.
from homebridge-switchbot.
Bluetooth issues have nothing to do with the plugin, checkout the Bluetooth Plugins Wiki.
from homebridge-switchbot.
Understood & respect that @donavanbecker.
Question though; this feels kind of dumb on my part, but I'd never actually checked whether the BLE worked. I assumed it didn't when I saw those errors.
I just tried, with the curtains switched to BLE only, and it does indeed work.
The thing to note here, is that when I then used 'BLE/OpenAPI', it says 'OpenAPI' will then be used.
Can you help point me in the right direction here? It sounds like this might be a Switchbot side thing, with when BLE is enabled, but it could be within the library and not properly indicating the BLE state back to Switchbot...
[8/29/2023, 1:50:22 PM] [SwitchBot] MeterPlus: Meter Plus failed BLERefreshStatus with BLE Connection, Error Message: "Adapter is not ready: unknown"
[8/29/2023, 1:50:22 PM] [SwitchBot] MeterPlus: Meter Plus wasn't able to establish BLE Connection, node-switchbot: [object Object]
[8/29/2023, 1:50:22 PM] [SwitchBot] Curtain: Verandah failed BLERefreshStatus with BLE/OpenAPI Connection, Error Message: "Adapter is not ready: unknown"
[8/29/2023, 1:50:22 PM] [SwitchBot] Curtain: Verandah wasn't able to establish BLE Connection, node-switchbot: [object Object]
[8/29/2023, 1:50:22 PM] [SwitchBot] Curtain: Verandah Using OpenAPI Connection to Refresh Status
[8/29/2023, 1:50:22 PM] [SwitchBot] Curtain: Backyard failed BLERefreshStatus with BLE Connection, Error Message: "Adapter is not ready: unknown"
[8/29/2023, 1:50:22 PM] [SwitchBot] Curtain: Backyard wasn't able to establish BLE Connection, node-switchbot: [object Object]
To clarify the above, I have 2 grouped curtains, Verandah & Backyard. I set Verandah to be BLE/OpenAPI, and Backyard to 'BLE'.
from homebridge-switchbot.
If set to BLE/OpenAPI, BLE will be tried first and if it doesn't work then it will use OpenAPI as a backup.
If set to BLE, then only BLE will be tried.
from homebridge-switchbot.
Understood - but in the above, BLE works for both. I am able to control the curtains via BLE if I set it to that. They both report errors, but both work.
If I change it to BLE/OpenAPI, I don't see indications that it changes back to BLE later - but I may be misreading the logs?
from homebridge-switchbot.
I found this issue when I searched for the Adapter is not ready: unknown
error that I got trying to get the SwitchBot Indoor/Outdoor Thermo-Hygrometer to work. After some research I found the node-switchbot
library to cause the error (even when using it in a test script independently of homebridge). I then created a small test script which did indeed work (in the same docker container). So the problem is not one of bluetooth setup but is indeed related to the node-switchbot
package.
For anyone who tries to get aforementioned sensor to work might find my my plugin to be of use :)
from homebridge-switchbot.
@moritzmhmk Why not help update this plugin to not rely on node-SwitchBot?
from homebridge-switchbot.
Adding support for all the different SwitchBot devices with a new code base would require a lot of testing and I do only own the Indoor/Outdoor Thermo-/Hygrometer. I did try to fix node-switchbot
for about 2 hours before I decided to write something from scratch - which did happen to be surprisingly simple - so simple indeed that I decided the effort of creating a new plugin was worth it ;)
In general I think that there is space for multiple different plugins. While this one is best suited for someone who operates multiple SwitchBot devices and also has a SwitchBot Hub, my plugin targets those users that just want to get a cheap (but good) BLE Hygrometer running.
from homebridge-switchbot.
but couldn't you just add that support directly into the the iosensor file in this plugin?
from homebridge-switchbot.
you don't have to change it on all of them....
from homebridge-switchbot.
Handling bluetooth differently for the different device types would be a rather unclean solution, since it would still cause the problems for anyone who wants to use a different device type. Imagine setting the plugin up and having all but the iosensor devices fail with the Adapter is not ready: unknown
error.
from homebridge-switchbot.
is it really a good idea to mark my comments that hint to a solution as spam?
from homebridge-switchbot.
#814 appears to be the PR to help fix this. Thanks @moritzmhmk, I'm not experienced enough in Typescript to work out how to properly test it and didn't have the time. Appreciate the fix in both sides. It'll be good for my curtains :)
from homebridge-switchbot.
Related Issues (20)
- Feature Request: Support for Robot Vacuum K10+ Japanese version HOT 7
- Bot Not Working HOT 2
- Feature Request: S10 HOT 18
- Feature Request: K10+ HOT 4
- Question: Why do I see this in the log every time the plugin runs a scan? HOT 3
- Support Request: No volume control for IR speakers HOT 3
- Bug: Unknown statusCode HOT 3
- Bug: Hub 2: Hub 2 F0 Internal Server Error, An unexpected error on the SmartThings servers has occurred. These errors should be rare, statusCode: 500 HOT 5
- Bug: HOT 2
- Bug: cannot upgrade beyond v2.13.1 HOT 2
- Bug: v3.5.0-beta crashes on restart HOT 30
- Feature Request: Add Troubleshooting in docs HOT 3
- Feature Request: Customised Mode for Bot HOT 3
- Bug: SwitchBot not working with BLE and keep rebooting the child bridge HOT 13
- Bug: Switchbot accessory status (Garage Door) stuck at "Opening" HOT 4
- Bug: Request to turn off bot is being sent as turn on request. HOT 3
- Bug: plugin loses humidity values for IO-Sensor during Parsing HOT 3
- Bug: Bug: latest update has broken Custom IR devices
- Bug: Homebridge shuts down. If there is a ceiling light. HOT 2
- Bug: IR Air Conditioning will not turn on anymore, but off still works HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-switchbot.