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

Connect to and use Decent Scale #209

Open
Blechpirat opened this issue Aug 14, 2023 · 10 comments
Open

Connect to and use Decent Scale #209

Blechpirat opened this issue Aug 14, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@Blechpirat
Copy link

Is your feature request related to a problem? Please describe.
Connecting to a good bluetooth scale would allow the app to be even greater, since being exact is very important - esp. flowrates are hard to hit (V60)

Describe the solution you'd like
The Decent Scale is open source and has a well documented API. Decent even offers a free scale for app developers (https://youtu.be/IpjN_FzjUW8?t=457) and is made for coffee lovers.

Describe alternatives you've considered
There are other bluetooth scales, but I don't know them well enough to recommend.

Additional context
Especially getting shown the flowrates of the water you put into your V60 would be awesome. But also automatically calculating how much water you need for the exact amount of coffee the scale registers, etc - awesome!

@Blechpirat Blechpirat added the enhancement New feature or request label Aug 14, 2023
@rozPierog
Copy link
Owner

Thanks for bringing to my attention that Decent has a developer program, and that they can send free scale to help with the implementation. I've sent them an email and I'll wait for the response. It would be nice to have features you are talking about

@decentjohn
Copy link

Yeah, absolutely, and double-plus absolutely because you're a FLOSS app.

I'm in France, so if you don't mind I'll send you one of my own, kinda scratched up, Decent Scales, so we can avoid any EU tax fun.

API docs here:
https://decentespresso.com/decentscale_api

and I can help if any questions.

@Blechpirat
Copy link
Author

Thanks John!

@mtrewartha
Copy link

@rozPierog I'm not sure how much BLE experience you have, but I've worked professionally with Android BLE for years and I'm happy to be a resource if that's helpful. I'd also be happy to contribute!

Here's another link for you: JuulLabs/Kable is a fantastic multi-platform Kotlin library for working with BLE. We use it to great effect at @parsyl on both Android and iOS. It translates all of the callback-based Android APIs to a great Kotlin coroutines-based API that makes development much easier.

@rozPierog
Copy link
Owner

Oooooh, that's amazing thanks @mtrewartha I'll definitely look into this as my experience with BLE is non-existent.

@decentjohn
Copy link

It's super easy, though. The steps are:

  1. scan for devices, get a bluetooth device id
  2. connect to that device id
  3. "subscribe" to data from one of the numbered services
  4. receive weight data
@rozPierog
Copy link
Owner

rozPierog commented Sep 29, 2023

I'm sure that it's easy, but sadly I don't have time to learn ins and outs of Android bluetooth stack, right now, so to have that burden lifted via already battle tested library will be a great help

@decentjohn
Copy link

oh, totally think you should use the library, but the steps will likely be the same. It's just that the library will hide some complexity of the implementation, and (nicely) avoid you having to learn the different platform issues.

I'm reading the docs:
https://github.com/JuulLabs/kable

and my 1-2-3-4 steps will still apply. But you'll likely have code from Kable that you can copy/paste.

@mtrewartha
Copy link

Yup, I think those same steps likely apply (admittedly haven't looked at the scale BLE API). There's definitely a learning curve to BLE so if you beat me to this, don't hesitate to ping me with questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
4 participants