Giter Club home page Giter Club logo

Comments (14)

fjs21 avatar fjs21 commented on August 17, 2024

from homebridge-blueair.

jonato1 avatar jonato1 commented on August 17, 2024

@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.

jonato1 avatar jonato1 commented on August 17, 2024

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.

fjs21 avatar fjs21 commented on August 17, 2024

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.

jonato1 avatar jonato1 commented on August 17, 2024

@fjs21 its the same as my GitHub username - @jonato1

from homebridge-blueair.

jonato1 avatar jonato1 commented on August 17, 2024

@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.

epheterson avatar epheterson commented on August 17, 2024

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.

jonato1 avatar jonato1 commented on August 17, 2024

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.

epheterson avatar epheterson commented on August 17, 2024

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.

epheterson avatar epheterson commented on August 17, 2024

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.

jonato1 avatar jonato1 commented on August 17, 2024

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.

epheterson avatar epheterson commented on August 17, 2024

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.

jonato1 avatar jonato1 commented on August 17, 2024

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.

epheterson avatar epheterson commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.