aschzero / homebridge-airmega

Homebridge plugin for the Coway Airmega air purifier.
34 stars 19 forks source link

Error reading filter status #13

Open gtg465x opened 4 years ago

gtg465x commented 4 years ago

The controls are working fine in HomeKit, but I didn't see any filter status indicators, so I looked in the Homebridge logs and found this being printed quite often.

Model: Airmega 400S Node version: 10.16.0

[Homebridge] [2/20/2020, 4:42:17 PM] [Airmega] [ERROR] Unable to get filter change indication for Max2 Filter. Cannot read property 'lifeLevel' of undefined
[Homebridge] [2/20/2020, 4:42:17 PM] [Airmega] [ERROR] Unable to get filter life level for Max2 Filter. Cannot read property 'lifeLevel' of undefined
[Homebridge] [2/20/2020, 4:42:17 PM] [Airmega] [ERROR] Unable to get filter change indication for Pre Filter. Cannot read property 'lifeLevel' of undefined
[Homebridge] [2/20/2020, 4:42:17 PM] [Airmega] [ERROR] Unable to get filter life level for Pre Filter. Cannot read property 'lifeLevel' of undefined
zebzbranek commented 4 years ago

Ditto. Otherwise, I really like the plug-in. Can anything be done?

shamanskyh commented 4 years ago

12 should fix this issue FWIW

paqpaqpaq commented 4 years ago

same here. I don't see how #12 is a fix?

zebzbranek commented 4 years ago

I couldn't get it to work. I tried "npm install -g git+https://github.com/shamanskyh/homebridge-airmega.git” and with sudo. I will need to be spoon fed at this point. Would really like to get it working. Zeb Zbranek Zbranek Firm, P.C. 1937 Trinity Street Liberty, Texas 77575-2050 Telephone: 936-336-6454 Facsimile:  936-336-6039     The information contained in this message from Zbranek Firm, P.C. and any attachments are confidential and intended only for the named recipients. If you have received this message in error, you are prohibited from copying, distributing or using the information. Please contact the sender immediately by reply e-mail and delete the original message.

On Monday, May 25, 2020, 03:31:09 AM CDT, paqpaqpaq <notifications@github.com> wrote:  

same here. I don't see how #12 is a fix?

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

shamanskyh commented 4 years ago

Hey @paqpaqpaq -- The reason this broke is that Coway changed the name of the filter that is reported from the API and the existing plugin (without #12) looks for the filter by its name. #12 looks up the filter status using an identifier that is hopefully more stable, meaning it's less likely to change, than a name.

Separately, Apple's Home app doesn't seem to indicate when a filter needs to be changed, even when a plugin/integration is working as expected and the filter status is readable in other apps that use the HomeKit framework like Eve or Home+. I've verified this by using Apple's HomeKit Accessory Simulator to simulate an air purifier accessory with a filter service, and setting the filter status to need a change. It's up to Apple whether they want to implement filter status reporting in their Home app or not; the Home app only implements a subset of the full HomeKit framework.

paqpaqpaq commented 4 years ago

Hey @paqpaqpaq --

Separately, Apple's Home app doesn't seem to indicate when a filter needs to be changed, even when a plugin/integration is working as expected and the filter status is readable in other apps that use the HomeKit framework like Eve or Home+. I've verified this by using Apple's HomeKit Accessory Simulator to simulate an air purifier accessory with a filter service, and setting the filter status to need a change. It's up to Apple whether they want to implement filter status reporting in their Home app or not; the Home app only implements a subset of the full HomeKit framework.

Despite that, there are apps that are able to read and and use the filter status in an automation, which I did. Filter running out, trigger an alarm. This always worked.

cirrusflyer commented 4 years ago

Any news on this fix?

shamanskyh commented 4 years ago

Just waiting on @aschzero to take a look at the pull request. The alternative is to create a more maintained fork of my own, but I'm not really a Node developer by trade and I'd really prefer to contribute back to the original author's work if he's willing to take a look at the pull request.

tillkruss commented 4 years ago

The last commit was on Apr 24, 2019 so this repo is probably abandoned.

paqpaqpaq commented 4 years ago

Just waiting on @aschzero to take a look at the pull request. The alternative is to create a more maintained fork of my own, but I'm not really a Node developer by trade and I'd really prefer to contribute back to the original author's work if he's willing to take a look at the pull request.

If I sudo npm install -g git+https://github.com/shamanskyh/homebridge-airmega.git then I get this error in return:

[2020-6-30 10:24:22] Error: The requested platform 'Airmega' was not registered by any plugin. at PluginManager.getPluginForPlatform (/usr/lib/node_modules/homebridge/src/pluginManager.ts:224:15) at /usr/lib/node_modules/homebridge/src/server.ts:387:37 at Array.forEach () at Server.loadPlatforms (/usr/lib/node_modules/homebridge/src/server.ts:374:27) at Server.start (/usr/lib/node_modules/homebridge/src/server.ts:153:29) at cli (/usr/lib/node_modules/homebridge/src/cli.ts:80:10) at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 [2020-6-30 10:24:22] Got SIGTERM, shutting down Homebridge...

tillkruss commented 4 years ago

@shamanskyh: Will you open issues on your fork? Also can you publish that as a NPM package, so we can install it easily?

WJKramer commented 3 years ago

Many months later. I am still having this issue. Any work being done?

dpesetsky commented 3 years ago

I would also appreciate an update that eliminates the filter errors. Or a way to stop homebridge from checking for them. Thank you!! @aschzero @shamanskyh

paqpaqpaq commented 3 years ago

Maybe you could comment out lines 47 to 53 of homebridge-airmega/lib/Purifier.ts