Comments (14)
from homebridge-blueair.
@fjs21 I think I've got this all wrapped up. Can you review, version the code, and release when you have a chance?
from homebridge-blueair.
Hi @fjs21 - Just wanted to check in on this one again. If you're able to add me as a collaborator to the NPMJS package, I'm happy to try releasing this one on my own.
from homebridge-blueair.
Hi @fjs21 - Just wanted to check in on this one again. If you're able to add me as a collaborator to the NPMJS package, I'm happy to try releasing this one on my own.
What's your npm username?
from homebridge-blueair.
@fjs21 its the same as my GitHub username - @jonato1
from homebridge-blueair.
@epheterson V1.2.0 is officially out! Feel free to check it out and let me know if the feature toggles work to your satisfaction.
from homebridge-blueair.
Thanks for adding the feature! I've got to say though, since the update things have gotten very unstable.
Initially, it lead to my homebridge instance going into a crash loop until I removed the BlueAir config. It was just like this:
{
"username": "[email protected]",
"password": "password",
"enableAWS": true,
"region": "us",
"options": [
"showLED: false"
],
"platform": "BlueAir"
},
And behaved the same if I removed the options block, which I thought might be conflicting:
{
"username": "[email protected]",
"password": "password",
"enableAWS": true,
"region": "us",
"platform": "BlueAir"
},
Finally, I used the Homebridge-Config-UI-X to make a new config, and this got my homebridge stable. Now it looks like this:
{
"username": "[email protected]",
"password": "password",
"enableAWS": true,
"hideLED": true,
"hideAirQualitySensor": false,
"hideCO2Sensor": false,
"hideTemperatureSensor": false,
"hideHumiditySensor": false,
"hideGermShield": false,
"hideNightMode": false,
"region": "us",
"platform": "BlueAir"
}
Unfortunately the accessory was stuck Not Responding. I also see the logs frequently printing this:
[4/12/2023, 10:43:02 PM] [BlueAir] Checking token expiration date/time. Current token(s) expire at: Thu Apr 13 2023 22:37:25 GMT-0700 (Pacific Daylight Time)
[4/12/2023, 10:43:11 PM] [BlueAir] Checking token expiration date/time. Current token(s) expire at: Thu Apr 13 2023 22:37:25 GMT-0700 (Pacific Daylight Time)
[4/12/2023, 10:43:24 PM] [BlueAir] Checking token expiration date/time. Current token(s) expire at: Thu Apr 13 2023 22:37:25 GMT-0700 (Pacific Daylight Time)
[4/12/2023, 10:43:33 PM] [BlueAir] Checking token expiration date/time. Current token(s) expire at: Thu Apr 13 2023 22:37:25 GMT-0700 (Pacific Daylight Time)
[4/12/2023, 10:43:40 PM] [BlueAir] Checking token expiration date/time. Current token(s) expire at: Thu Apr 13 2023 22:37:25 GMT-0700 (Pacific Daylight Time)
I restarted Homebridge, and the accessory was finally stable! Those logs still print repeatedly.
So, in a nutshell, might want to look into:
- Causing homebridge to crash with the old config (missing new preferences that are expected?)
- Accessory not working reliably on first setup/migration until homebridge relaunch
- Constantly checking token expiration, should be done like once every 24h or so but is happening a lot
Edit: Spoke too soon, it got stuck Not Responding again :(
Also the "Feature Options" section still appears at the bottom of the UI-X config, which should probably be removed if the expectation is to use the checkboxes and that method doesn't work.
from homebridge-blueair.
Hi @epheterson - I'm so sorry for the trouble. I tested this thoroughly and didn't see any of these issues on my end locally. I just released v.1.2.1-0 as an alpha version. Can you try updating and seeing if this resolves the majority of the instability?
As a note - the "Checking token expiration date/time" message isn't actually trying to refresh the tokens; it's a local check. However, it is excessive in the logging. I can look at changing the logging level for this in the next release.
from homebridge-blueair.
Thanks, I’ll check tonight!
I realize it’s not refreshing the token, instead of suppressing the logs the check should be done once on launch then set a timer, or periodically, to renew it. I guess you’re checking every on every API call now? If you’re doing that you can store it in cache and compare to the cached value each API call?
from homebridge-blueair.
Thanks so much for the update! I didn't try with the old config, but on the Mac hosting homebridge things are working well. For some reason it's No Response on other devices, guessing that's an issue elsewhere in homebridge or the network will look into it.
from homebridge-blueair.
Of course - so it sounds like it's working well for you so far? If so, I'll look at releasing an official 1.2.1. Also, on the not about the "checking token expiration", the overall logic is:
- Use username/password to login and get token
- Record date/time when token will expire (24 hours in the future)
- Each time the API is called, check to see if it is earlier than the token expiration; if not, then re-login and refresh token
I haven't been able to figure out how to rotate the access token with the refresh token. If you're able to help, I'd love to figure that out!
from homebridge-blueair.
Thanks yeah it's working you should be good to release it officially! That logic sounds sensible, I guess it is just a little verbose on the logging.
from homebridge-blueair.
Sounds great - v1.2.1 is officially out! I will close this issue, but feel free to reopen or create a new issue if you are seeing any issues. Thanks again, @epheterson!
from homebridge-blueair.
Let me know if you'd like to open a new issue, but I'm actually seeing this go No Response even on the Mac hosting homebridge. I tried switching the plugin to a bridged accessory to see if that would help but it behaves the same. Is there any way to enable some extra logging to see what's going on?
from homebridge-blueair.
Related Issues (20)
- Add Support for Model: 411i MAX HOT 7
- Add Support for Classic 480i / Classic 490i HOT 3
- Add Support for 311i Max HOT 7
- Crash while using 480i
- Asking Siri to turn on all lights in a room sets BlueAir LED brightness to zero
- Warnings generated in logs
- Add switch for 'auto' mode HOT 2
- 1.3.1 crashes when multiple air purifiers are found on AWS HOT 3
- More Frequent Token Refreshes
- Please add support for 211i Max HOT 1
- Support for Blue Max 3250i
- AWS TW region support HOT 1
- Out of Compliance HOT 1
- AWS china/cn region support HOT 3
- Transfer to Homebridge Organization
- Fix auto behavior
- Add new region Malaysia
- Hide CO2 Sensor Crashes on 680i HOT 1
- Air purifier no response in homekit
- Error reading device since latest Homebridge update HOT 5
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-blueair.