-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homebridge-inkbird-wifi-gateway #537
Comments
The following pre-checks failed: ❌ Failed to import plugin: Cannot find module '/workspace/test-area/node_modules/homebridge-inkbird-wifi-gateway/src/index.js' imported from /workspace/index.ts Comment |
Any help here would be greatly appreciated... |
To start with, just had a look at your package json file and it looks absolutely wild! (maybe it works, but the formatting is wild!) https://github.com/richierockskool/homebridge-inkbird-wifi-gateway/blob/master/package.json It would be a lot easier to make a start of looking at the plugin if this was sorted into a nice formatted format |
stick your package json file into a formatter like this: |
@richierockskool |
Okay, We have run all the bug checks and there is nothing, except... No plugin was found for the platform "HomebridgeInkbirdWifiGateway" in your config.json. Please make sure the corresponding plugin is installed correctly. It is driving us crazy! |
I see you took my initial advice to format your package json |
the formatting obviously doesn't affect anything functionality-wise, but can really help if others look to see what could be causing any issues |
I hope so, because there are no issues with package-json |
no but i will repeat:
i for one cannot review this plugin if your package json file is all on one line |
I have no idea why that happened, new.. fixing it now, and have been asking for help for while
… On Apr 26, 2023, at 10:28 PM, Ben ***@***.***> wrote:
no but i will repeat:
but can really help if others look to see what could be causing any issues
i for one cannot review this plugin if your package json file is all on one line
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVUX7JLWM77WOFEEY63XDHKUTANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you were mentioned.
|
fixed now...wait 10 minutes |
Not sure if you are on the homebridge discord channel but happy to message on there, my username is |
discord RichieRockskool#7717 |
how are we going with this plugin and verification? |
Hi Ben,
Still having issues and problems, everything verifies in VS Code no errors or bugs. It loads in Homebridge and can find the plugin (but the Config Schema will not load) If you put it in manually it works kind of. We need someone to take a look and see what we missed. It probably something simple, please recommend how we can move forward,
Thank you,
Rich
… On May 26, 2023, at 7:12 PM, Ben ***@***.***> wrote:
how are we going with this plugin and verification?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVRTGOGXSK4SEJBK7W3XIE2E7ANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
/check |
The following pre-checks failed: ❌ Failed to test plugin. Comment |
First of all I would look through your dependencies and see which ones you actually need. In the package.json file you currently have this (I have added some comments):
|
Yes the one the plugin directory
… On Jun 16, 2023, at 1:09 PM, Ben ***@***.***> wrote:
which node_modules are you talking about? the one inside your plugin directory?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVV2CD6PRSDAEKZ334LXLSHMLANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
Your plugin does not need to also be inside this folder |
When I take it out I get this error: npm ERR! explore It doesn't look like npm is installed. |
do you still have |
This is all I have now
"dependencies": {
***@***.***/noble": "^1.9.2-21",
"hashmap": "^2.4.0",
"node-fetch": "^3.3.1"
},
… On Jun 16, 2023, at 1:58 PM, Ben ***@***.***> wrote:
do you still have npm in that list too?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVSYMFEEEXZG3OGI7FTXLSNFDANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
okay, and how are you trying to install the plugin? or how do you run it in dev, and where does this error come from? |
When I run
npm explore npm homebridge-inkbird-wifi-gateway
The plugin still installs no problem on Homebridge, but it fails to load the plugins config schema and
The *Inkbird Wifi Gateway* as an accessory
And of course not showing up on HomeKit
… On Jun 16, 2023, at 2:03 PM, Ben ***@***.***> wrote:
okay, and how are you trying to install the plugin? or how do you run it in dev, and where does this error come from?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVRC3OLMPJSPUVQDKE3XLSNYJANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
why are you running this command? normally is just |
Advice from Christian Clauss to make sure everything was pointed in the right direction (might not be relevant)
There are no issues when I run npm install
… On Jun 16, 2023, at 2:11 PM, Ben ***@***.***> wrote:
why are you running this command?
normally is just npm install inside your plugin folder
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVRUS5BFAKZUV642DJTXLSOU3ANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
/check |
The following pre-checks failed: ❌ Failed to test plugin. Comment |
I just did VS Debug and got this
/usr/local/bin/node ./
Process exited with code 1
Uncaught ReferenceError ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at <anonymous> (/Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/src/BleScanner.js:3:15)
at run (internal/modules/esm/module_job:192:25)
--- await ---
at runMainESM (internal/modules/run_main:53:21)
at executeUserEntryPoint (internal/modules/run_main:79:5)
at <anonymous> (internal/main/run_main_module:23:47)
… On Jun 16, 2023, at 2:11 PM, Ben ***@***.***> wrote:
why are you running this command?
normally is just npm install inside your plugin folder
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVRUS5BFAKZUV642DJTXLSOU3ANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
So i would look at addressing this 😊 |
Fixed
import noble from ***@***.***/noble";
let’s see what happens
… On Jun 16, 2023, at 5:36 PM, Ben ***@***.***> wrote:
So i would look at addressing this 😊
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVSPBLBPXGAWZXL5VETXLTGXRANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
Does your plugin rely on bluetooth to work? I mean, if a user installed the plugin who didn’t have a bluetooth module, would the plugin be useless? |
No and that could be my issue with getting thing to finally to work with the “inkbird wifi gateway” which is exactly that, it has an IP address that is logged into your router like any automation, from there the Bluetooth accessories are listed in the App and controlled. eg Bluetooth Pool Temperature all controlled by the Inkbird Pro App.
So, I am trying to mimic the app through this plugin. This app requires one to have an Inkbird Wifi Gateway IBSM1S for this plugin to work.
… On Jun 16, 2023, at 5:58 PM, Ben ***@***.***> wrote:
Does your plugin rely on bluetooth to work? I mean, if a user installed the plugin who didn’t have a bluetooth module, would the plugin be useless?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVX64TI3OO7FZ5LYS5TXLTJIFANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
So you need to design the plugin to account for anything going wrong.
This is not a full list, but in any case that a user doesn't have anything to make the plugin work, the plugin should just log an warning in the homebridge log and 'stop' without crashing the node process. |
Okay let me get back to work, and I think all the bluetooth dependencies must go, and all the src folders dedicated to it, and just focus on the wifi (ip address) and getting the Inkbird Wifi Gateway connected. Once that is connected in Homebridge I will be on a better route to getting it to work and verified.
… On Jun 16, 2023, at 6:28 PM, Ben ***@***.***> wrote:
So you need to design the plugin to account for anything going wrong.
what happens if a user is on a machine that can't install the abandonware/noble dependency?
what happens if a user can install the abandonware/noble dependency but doesn't have a ble module?
what happens if a user doesnt have an Inkbird Wifi Gateway IBSM1S?
This is not a full list, but in any case that a user doesn't have anything to make the plugin work, the plugin should just log an warning in the homebridge log and 'stop' without crashing the node process.
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVQ34NDSWQQS6NWHGSLXLTMYRANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you commented.
|
/check |
1 similar comment
/check |
The following pre-checks failed: ❌ Failed to test plugin. Comment |
I have to update src |
The issue here is the bluetooth package (noble) being listed in the dependencies section. As it can’t be installed on the github environment, so it fails. ideally you should put this into an “optionalDependencies” section of the package json, like i have with my govee plugin: |
Hi @richierockskool any update on this? |
Ben, we are still having difficulties getting Homebridge to load the accessory/accessories,
It does this fine
[InkbirdWifiGateway] Initializing homebridge-inkbird-wifi-gateway platform..
but when it tries “[InkbirdWifiGateway]Starting Inkbird Platform etc.” (API)
We have tried the API route and even though it loads the accessories it crashes with error.
We have found module/folder to control the Starting is here, but we are missing the “didFinishLaunching”, function () part after the constructors and do not understand how to use it properly.
homebridge-inkbird-wifi-gateway <https://github.com/richierockskool/homebridge-inkbird-wifi-gateway/tree/master>/src <https://github.com/richierockskool/homebridge-inkbird-wifi-gateway/tree/master/src>/InkbirdPlatform.js
with this code
import BleScanner from './BleScanner.js';
import IBSTH1Accessory from './IBSTH1Accessory.js';
import IBSPO1Accessory from './IBSPO1Accessory.js';
class InkbirdPlatform {
constructor(log, config, api) {
this.log = log;
this.config=config;
this.email=config.email;
this.password=config.password;
this.accessToken = config.accessToken;
this.device = config.devices;
this.myAccessories = [];
this.api=api;
//This has to be coded correctly to make this work
“didFinishLaunching”, function ()
// Boot scanner and register devices to scanner
new api.hap.Service.TemperatureSensor;
this.scanner = new BleScanner(this.log);
for (let device of this.devices = '2') {
this.scanner.addDevice(device.deviceId);
if (device.type === 'IBSTH1') {
// eslint-disable-next-line no-undef
let accessory = new IBSTH1Accessory(this.log, this.scanner, device, global.homebridge);
this.myAccessories.push(accessory);
}
if (device.type === 'IBSPO1') {
// eslint-disable-next-line no-undef
let accessory = new IBSPO1Accessory(this.log, this.scanner, device, global.homebridge);
this.myAccessories.push(accessory);
}
}
}
accessories(callback) {
callback(this.myAccessories);
}
}
export default InkbirdPlatform;
… On Jul 17, 2023, at 5:53 PM, Ben ***@***.***> wrote:
Hi @richierockskool <https://github.com/richierockskool> any update on this?
—
Reply to this email directly, view it on GitHub <#537 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AJE7PVRRDYUQZMCZQA6WSR3XQWX4DANCNFSM6AAAAAAXHEOOYQ>.
You are receiving this because you were mentioned.
|
Closing as not ready, will defer to richierockskool/homebridge-inkbird-wifi-gateway#24 |
/check |
Link To GitHub Repo
https://github.com/richierockskool/homebridge-inkbird-wifi-gateway
Link To NPM Package
https://www.npmjs.com/package/homebridge-inkbird-wifi-gateway
The text was updated successfully, but these errors were encountered: