Skip to content
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

Add night mode support #81

Closed
jonathanrobichaud4 opened this issue Mar 15, 2024 · 10 comments
Closed

Add night mode support #81

jonathanrobichaud4 opened this issue Mar 15, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jonathanrobichaud4
Copy link
Contributor

Hi,
I have a 411i that works perfectly other than the fact I can’t set night mode from the integration. Is there any way it could be added or could I help add it?

Thanks

@dahlb dahlb added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 16, 2024
@dahlb
Copy link
Owner

dahlb commented Mar 16, 2024

I no longer work on features I don't have the hardware to verify, but adding a switch for night mode on the 411i should be pretty straight forward.

first step would be to add the feature in https://github.com/dahlb/blueair_api which wraps the raw api and would need a new method to set the value in https://github.com/dahlb/blueair_api/blob/main/src/blueair_api/http_blueair.py finding the correct endpoint is the trickiest part and would probably require an android emulator and a jailbroken apk for blue air, mitm apk proxy is how I've done it in the past

once it is added to the api repo you can add a switch in this repo that exposes and updates the value

@jonathanrobichaud4
Copy link
Contributor Author

Ok so I figured it out pretty quickly by using stub.py and looking at the output. Like 'automode. the endpoint is just 'nightmode'. Not sure if this needs to be disabled depending on the model? I don't know what the others support. I can open a PR so you can take a look!

@jonathanrobichaud4
Copy link
Contributor Author

I'll work on adding support to the home assistant integration now!

@jonathanrobichaud4
Copy link
Contributor Author

Ok I have opened PR's in both repos. It seems to be working quite well right now when testing.

@dahlb
Copy link
Owner

dahlb commented Mar 18, 2024

great new feature, thanks for adding this. I made a small change to handle models like the classic series that don't have a night mode. v1.9.1

@dahlb dahlb closed this as completed Mar 18, 2024
@SoccerCore11
Copy link

finding the correct endpoint is the trickiest part and would probably require an android emulator and a jailbroken apk for blue air, mitm apk proxy is how I've done it in the past

I finally got the proxy working, but the Blueair app doesn't want to connect through the proxy. Can you give me another pointer on how to get the app to work through the proxy? I'd like to get the PM1, PM2.5, PM10, tVOC, temperature, and humidity sensors working.

[20:27:11.202][192.168.50.18:63241] server connect 172.217.0.170:443
[20:27:11.242][192.168.50.18:63241] Client TLS handshake failed. The client does not trust the proxy's certificate for play.googleapis.com (OpenSSL Error([('SSL routines', '', 'ssl/tls alert certificate unknown')]))
[20:27:11.243][192.168.50.18:63241] client disconnect
[20:27:11.244][192.168.50.18:63241] server disconnect 172.217.0.170:443
[20:27:40.801][192.168.50.18:63263] client connect
[20:27:40.837][192.168.50.18:63263] server connect 54.205.38.104:443
[20:27:40.918][192.168.50.18:63263] Client TLS handshake failed. The client does not trust the proxy's certificate for api-us-east-1.blueair.io (OpenSSL Error([('SSL routines', '', 'ssl/tls alert certificate unknown')]))
[20:27:40.919][192.168.50.18:63263] client disconnect

@jonathanrobichaud4
Copy link
Contributor Author

What model do you have? Some don't support it like the 411i Max. Check blueair's website maybe? I also didn't use the proxy, I just used stub.py which returns a bunch of debug info in the console.

@SoccerCore11
Copy link

I have the Classic 680i, and all those sensors show in the BlueAir app. Sorry for being dense, but where do I find 'stub.py'?

@dahlb
Copy link
Owner

dahlb commented Mar 21, 2024

@SoccerCore11 this ticket is closed, please open a new ticket rather than discussing unrelated issues on a closed ticket

@jonathanrobichaud4
Copy link
Contributor Author

I have the Classic 680i, and all those sensors show in the BlueAir app. Sorry for being dense, but where do I find 'stub.py'?

Sorry last reply and then I’ll leave this issue since it’s closed but it’s under the Blueair_api repository that this integration uses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants