Skip to content

homebridge-switchbot-sensor-ble #565

Closed

Activity

  1. added
    pendingthe label given to a new verification/icon request
    on Sep 1, 2023
  2. github-actions commented on Sep 1, 2023

    @github-actions
    Contributor

    The following pre-checks failed:

    ❌ Failed to import plugin: EAFNOSUPPORT, Address family not supported by protocol

    Comment /check to run checks again.

  3. moritzmhmk commented on Sep 1, 2023

    @moritzmhmk
    Author

    /check

  4. github-actions commented on Sep 1, 2023

    @github-actions
    Contributor

    ✅ Pre-checks completed successfully.

  5. bwp91 commented on Sep 1, 2023

    @bwp91
    Contributor

    Hi @moritzmhmk

    How does your plugin handle cases where abandonware/noble has not been able to install - does the plugin properly catch the error in this case?

  6. moritzmhmk commented on Sep 1, 2023

    @moritzmhmk
    Author

    Hi it will log an error message here and since the accessory never receives a value for temperature and humidity it will be marked as unreachable in the Home App.

  7. bwp91 commented on Sep 1, 2023

    @bwp91
    Contributor

    alrighty thank you for confirming.

    also, does this plugin offer any more functionality than the already verified switchbot plugins?
    Screenshot 2023-09-02 at 00 11 37

    It might be worth a note in your readme about how your plugin is different.

    Whilst there is no official plugin verification rule against multiple plugins with the same functionality, I think it would be helpful for users who are looking for their right plugin to see (e.g. in your readme) how yours is different from the others

  8. added
    awaiting-user-replyuse after review has started - awaiting user to reply to a comment
    and removed
    pendingthe label given to a new verification/icon request
    on Sep 1, 2023
  9. moritzmhmk commented on Sep 2, 2023

    @moritzmhmk
    Author

    When trying to get the sensor to work on my Raspberry Pi 4 with Docker, I kept getting the error adapter is not ready: unknown, while other (non switchbot) BLE devices in the setup worked fine. Tracking down the error, I found that the node-switchbot library used by the other plugins was causing the error. Looking into creating a PR for node-switchbot, I found that it is easier to create a new plugin from scratch that only handles the device in question and does not rely on dependencies (besides noble).

    So, unlike the other alternatives, my package is written according to the philosophy of doing only one thing but doing it well and having as few dependencies as reasonably possible. I tried to hint towards this in the README, if you have a suggestion on how to better communicate this to other users I will be happy to adjust the README accordingly.

  10. moritzmhmk commented on Sep 2, 2023

    @moritzmhmk
    Author

    I updated the README.

  11. moritzmhmk commented on Sep 2, 2023

    @moritzmhmk
    Author

    After some communication with the creator of the other plugin, I looked at the problem again.

    The node-switchbot package indeed has a BLE initialisation that is not compatible with my (and others Docker based) setup. Furthermore, and this is what made the troubleshooting so confusing, there is no support in node-switchbot at all for the sensor in question and additionally a wrong identifier used in the homebridge-switchbot plugin.

    I have created corresponding PRs in both repos. Nevertheless, I will keep using my plugin due to its few dependencies and the concise code. For all those who also only use the hygrometers from Switchbot, it might be a lightweight alternative.

  12. bwp91 commented on Sep 3, 2023

    @bwp91
    Contributor

    One more small thing, after installing the plugin and configuring an accessory with the ble address of a thermometer sensor with a different brand (yes, I wasn't expecting to work!) but it does throw homebridge into a crash loop:

    [03/09/2023, 14:16:17] [Hygrometer] Restarting Process...
    [03/09/2023, 14:16:19] [Hygrometer] Launched child bridge with PID 11611
    [03/09/2023, 14:16:19] Registering accessory 'homebridge-switchbot-sensor-ble.SwitchBotSensorBLE'
    [03/09/2023, 14:16:19] [Hygrometer] Loaded homebridge-switchbot-sensor-ble v1.3.2 child bridge successfully
    [03/09/2023, 14:16:19] Loaded 0 cached accessories from cachedAccessories.0E7C2D126D68.
    [03/09/2023, 14:16:19] [Hygrometer] SwitchBotSensorBLE finished initializing!
    [03/09/2023, 14:16:19] Homebridge v2.0.0-beta.1 (HAP v1.0.0-beta.8) (Hygrometer) is running on port 44449.
    TypeError: Cannot read properties of undefined (reading '10')
        at SwitchBotSensorBLE.updateFromAdvertisement (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/src/accessory.ts:86:13)
        at Noble.<anonymous> (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/src/accessory.ts:72:12)
        at Noble.emit (node:events:514:28)
        at Noble.onDiscover (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/noble.js:218:10)
        at NobleBindings.emit (node:events:514:28)
        at NobleBindings.onDiscover (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:213:10)
        at Gap.emit (node:events:514:28)
        at Gap.onHciLeAdvertisingReport (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/gap.js:175:10)
        at Hci.emit (node:events:514:28)
        at Hci.processLeAdvertisingReport (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/hci.js:1148:12)
    [03/09/2023, 14:16:22] [Hygrometer] Child bridge process ended
    [03/09/2023, 14:16:22] [Hygrometer] Process Ended. Code: 1, Signal: null
    [03/09/2023, 14:16:29] [Hygrometer] Restarting Process...
    [03/09/2023, 14:16:30] [Hygrometer] Launched child bridge with PID 11626
    [03/09/2023, 14:16:30] Registering accessory 'homebridge-switchbot-sensor-ble.SwitchBotSensorBLE'
    [03/09/2023, 14:16:30] [Hygrometer] Loaded homebridge-switchbot-sensor-ble v1.3.2 child bridge successfully
    [03/09/2023, 14:16:30] Loaded 0 cached accessories from cachedAccessories.0E7C2D126D68.
    [03/09/2023, 14:16:31] [Hygrometer] SwitchBotSensorBLE finished initializing!
    [03/09/2023, 14:16:31] Homebridge v2.0.0-beta.1 (HAP v1.0.0-beta.8) (Hygrometer) is running on port 44449.
    TypeError: Cannot read properties of undefined (reading 'data')
        at SwitchBotSensorBLE.updateFromAdvertisement (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/src/accessory.ts:91:38)
        at Noble.<anonymous> (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/src/accessory.ts:72:12)
        at Noble.emit (node:events:514:28)
        at Noble.onDiscover (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/noble.js:218:10)
        at NobleBindings.emit (node:events:514:28)
        at NobleBindings.onDiscover (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:213:10)
        at Gap.emit (node:events:514:28)
        at Gap.onHciLeAdvertisingReport (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/gap.js:175:10)
        at Hci.emit (node:events:514:28)
        at Hci.processLeAdvertisingReport (/usr/local/lib/node_modules/homebridge-switchbot-sensor-ble/node_modules/@abandonware/noble/lib/hci-socket/hci.js:1148:12)
    [03/09/2023, 14:16:31] [Hygrometer] Child bridge process ended
    [03/09/2023, 14:16:31] [Hygrometer] Process Ended. Code: 1, Signal: null
    
  13. moritzmhmk commented on Sep 3, 2023

    @moritzmhmk
    Author

    Thanks for the feedback, this is now fixed in v1.3.3.

  14. removed
    awaiting-user-replyuse after review has started - awaiting user to reply to a comment
    on Sep 4, 2023
  15. 4 remaining items

  16. reopened this on Sep 13, 2023
  17. bwp91 commented on Sep 13, 2023

    @bwp91
    Contributor

    @moritzmhmk apologies i must have closed this accidentally

  18. moritzmhmk commented on Sep 15, 2023

    @moritzmhmk
    Author

    I wondered if closing the issue meant that verification was about to happen 😅

    Is there anything left that needs to be addressed code-wise?

  19. bwp91 commented on Sep 15, 2023

    @bwp91
    Contributor

    Yeah sorry about this i just happened to be going through closed issues and saw yours and remembered it hadn’t been verified.
    Must have just closed by mistake so apologies.
    Will have a look through the checklist a bit later 👍🏻

  20. bwp91 commented on Sep 21, 2023

    @bwp91
    Contributor

    /check

  21. github-actions commented on Sep 21, 2023

    @github-actions
    Contributor

    ✅ Pre-checks completed successfully.

  22. added and removed
    pendingthe label given to a new verification/icon request
    on Sep 21, 2023
  23. github-actions commented on Sep 21, 2023

    @github-actions
    Contributor
    • - The plugin must successfully install.
    • - The plugin must implement the Homebridge Plugin Settings GUI.
    • - The plugin must not start unless it is configured.
    • - The plugin must be of type dynamic platform.
    • - The plugin must not offer the same nor less functionality than that of any existing verified plugin.
    • - The plugin must not execute post-install scripts that modify the user's system in any way.
    • - The plugin must not contain any analytics or calls that enable you to track the user.
    • - The plugin must not throw unhandled exceptions, the plugin must catch and log its own errors.
    • - The plugin must be published to npm and the source code available on GitHub.
    • - A GitHub release should be created for every new version of your plugin, with patch notes.
    • - The plugin must run on all Active LTS versions of Node.js, at the time of writing this is Node v18 and v20.
    • - The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
    • - If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.

    Everything Looks Good!

  24. added
    verifieduse when a plugin meets the criteria - adds the verified badge text
    and removed on Sep 21, 2023
  25. github-actions commented on Sep 21, 2023

    @github-actions
    Contributor

    Congratulations! Your plugin has been verified.

    You can now add the Verified by Homebridge badge to your plugin's README:

    verified-by-homebridge

    [![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
    

    Your plugin is now also eligible to display a ❤️ Donate button on its tile in the Homebridge UI. See https://github.com/homebridge/homebridge/wiki/Donation-Links for instructions.

    If for any reason in the future you can no longer maintain your plugin, please consider transferring it to our unmaintained plugins repo. We can take ownership until another willing developer comes along.

    Don't forget to join the official Homebridge Discord server, where plugin developers can get tips and advice from other developers and the Homebridge project team in the #plugin-development channel!

    Thank you for your contribution to the Homebridge Community.
    https://homebridge.io

  26. bwp91 commented on Sep 21, 2023

    @bwp91
    Contributor

    sorry for the confusion in the interim re accidentally closing the issue

    nice 👍

  27. moritzmhmk commented on Sep 24, 2023

    @moritzmhmk
    Author

    Thank you - I just added the badge in the Readme 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifieduse when a plugin meets the criteria - adds the verified badge text

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions