rozPierog / Cofi

Free and open-source coffee brew timer. Customizable time settings and an easy-to-use interface. Perfect cup every time.

Home Page:https://rozpierog.github.io/Cofi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connect to and use Decent Scale

Blechpirat opened this issue · comments

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!

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

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.

Thanks John!

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

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

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

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

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.

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!