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

Capsule count #1

Closed
bubez81 opened this issue Apr 15, 2021 · 35 comments
Closed

Capsule count #1

bubez81 opened this issue Apr 15, 2021 · 35 comments
Labels
enhancement New feature or request

Comments

@bubez81
Copy link

bubez81 commented Apr 15, 2021

Superb idea, would it be possible to implement the capsule count?

@bubez81 bubez81 added the enhancement New feature or request label Apr 15, 2021
@tritter
Copy link
Owner

tritter commented May 2, 2021

Hi @bubez81, Yes I think it is possible, I just don't know hot to expose it into a valueble info in homekit. Do you have any ideas? Battery level? 🤗

@DJay-X
Copy link

DJay-X commented May 2, 2021

@tritter Great project. Thanks for sharing with the community.
Unfortunately I don't own a Nespresso but maybe you want to join our community on SmartApfel.de forum?
https://forum.smartapfel.de/forum/thread/8205-homebridge-brewer-nespresso-kaffeemaschine/?postID=114134#post114134

People are always happy to help and share.
Would love to see you there. 👍
Thanks again and have a good time.

@bubez81
Copy link
Author

bubez81 commented May 2, 2021

Hi! The battery level could be perfect...and the descaling count...maybe alarm sensor for water and descaling? Like a smoke sensor

@bubez81
Copy link
Author

bubez81 commented May 2, 2021

Ah and I want inform you that I have a "prodigio" and it works perfectly...only one thing, I haven't the americano and only water option, it's possible to select only the types of coffee that I can do?

@tritter
Copy link
Owner

tritter commented May 2, 2021

Amazing! Great to hear that it works :) Yes I thought already about that feature! Will be much easier for now. Maybe switches for "no water" / "descaling" / "no cup" is an idea I need to try in a beta.
I just wanted to get the initial version stable. I will let you know when something new is ready to test!

@bubez81
Copy link
Author

bubez81 commented May 2, 2021

Perfect! Thank you!

@tritter
Copy link
Owner

tritter commented May 16, 2021

@bubez81 Just added support to disable beverages (v1.1.0)! I'm working on the other updates too.

@bubez81
Copy link
Author

bubez81 commented May 16, 2021

you are the best! Thank you, now I have to offer you an espresso ;)

@tritter
Copy link
Owner

tritter commented May 26, 2021

Hi @bubez81,

I added a bit more than just the capsule count 😇
The new sensors are:
Brewing
Descealing Needed
No Capsules
No Water
Slider
Tray Error

Please try the beta, if everything is fine I will publish to master!

Just add the suffix to install:
sudo npm install -g homebridge-brewer@beta

I use it already for some days, some fun use cases:
Turn lights to blue when 'No Water opens'
Turn lights on above the machine when 'Slider opens'
Turn 'coffee ready sound' on when 'Brewing closes'

Ah the battery is also added too! Please make sure to set the capsule count beforehand by app. Because I need to be connected all day the App won't be able to connect whenever home bridge is running... Inside the home bridge config you need to define the 'max_capsule_count' (default 1000) Battery percentage is calculated by that, let's say you set in the app you still have 950 capsules (setup in the app), and you define max_capsule_count 1000, battery percentage will be 95% The no capsule sensor is only triggered when capsules are 0, but there is a battery warning too if less than 10%.

Have fun testing,
Thom

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

Hi @tritter, awesome!!
unfortunately i recieve this error:
`====================
[5/27/2021, 8:08:59 AM] ERROR LOADING PLUGIN homebridge-brewer:
[5/27/2021, 8:08:59 AM] Error: Cannot find module './native/binding'
Require stack:

  • /usr/local/lib/node_modules/homebridge-brewer/node_modules/noble/lib/mac/bindings.js
  • /usr/local/lib/node_modules/homebridge-brewer/node_modules/noble/lib/resolve-bindings.js
  • /usr/local/lib/node_modules/homebridge-brewer/node_modules/noble/index.js
  • /usr/local/lib/node_modules/homebridge-brewer/dist/platform.js
  • /usr/local/lib/node_modules/homebridge-brewer/dist/index.js
  • /usr/local/lib/node_modules/homebridge/lib/plugin.js
  • /usr/local/lib/node_modules/homebridge/lib/pluginManager.js
  • /usr/local/lib/node_modules/homebridge/lib/server.js
  • /usr/local/lib/node_modules/homebridge/lib/cli.js
  • /usr/local/lib/node_modules/homebridge/bin/homebridge
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/usr/local/lib/node_modules/homebridge-brewer/node_modules/noble/lib/mac/bindings.js:4:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    [5/27/2021, 8:08:59 AM] ====================`

with the beta

@tritter
Copy link
Owner

tritter commented May 27, 2021

@bubez81 Please try to remove your old plugin:

rm -rf /usr/local/lib/node_modules/homebridge-brewer

After that run:
sudo npm install -g homebridge-brewer@beta

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

mmm strange, same error...

@tritter
Copy link
Owner

tritter commented May 27, 2021

Hmm strange, I just checked on my homebridge Mac. Maybe your home bridge runs under your user so you shouldn't install it with sudo? So just npm install -g homebridge-brewer@beta? And how does your installation log look like? Any errors?

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

ok found the problem, npm install -g --unsafe-perm homebridge-brewer@beta is the right command to give, perfect!

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

ok think there are some problems, can't brew anymore and recieve this error?
noble: unknown peripheral fcd4512b5b1440738381002dddc269cc, 06aa1920f22a11e39daa0002a5d5c51b, 06aa3a22f22a11e39daa0002a5d5c51b read!

@tritter
Copy link
Owner

tritter commented May 27, 2021

Hmm could you try to toggle bluetooth? Could you send me the debug logs? enable -D in homebridge? Do you have more than one machine?? Homebridge Settings > Homebridge Debug Mode -D

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

no only one, ok let's try debugging

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

[5/27/2021, 9:34:13 AM] [Brewer] Set Characteristic On -> true [5/27/2021, 9:34:13 AM] [Brewer] Temperature is 0 [5/27/2021, 9:34:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:35:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:35:44 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:35:54 AM] [Brewer] Disconnecting... [5/27/2021, 9:35:54 AM] [Brewer] Disconnecting... [5/27/2021, 9:35:54 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:35:54 AM] [Brewer] Start scan... [5/27/2021, 9:35:57 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:35:59 AM] [Brewer] Request reading states [5/27/2021, 9:35:59 AM] [Brewer] Start Authentication [5/27/2021, 9:35:59 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:35:59 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:35:59 AM] [Brewer] Start subscribe status [5/27/2021, 9:35:59 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:36:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:37:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:37:57 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:38:07 AM] [Brewer] Disconnecting... [5/27/2021, 9:38:07 AM] [Brewer] Disconnecting... [5/27/2021, 9:38:07 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:38:07 AM] [Brewer] Start scan... [5/27/2021, 9:38:07 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:38:09 AM] [Brewer] Request reading states [5/27/2021, 9:38:09 AM] [Brewer] Start Authentication [5/27/2021, 9:38:09 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:38:09 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:38:09 AM] [Brewer] Start subscribe status [5/27/2021, 9:38:09 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:38:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:39:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:40:07 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:40:17 AM] [Brewer] Disconnecting... [5/27/2021, 9:40:17 AM] [Brewer] Disconnecting... [5/27/2021, 9:40:17 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:40:17 AM] [Brewer] Start scan... [5/27/2021, 9:40:18 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:40:20 AM] [Brewer] Request reading states [5/27/2021, 9:40:20 AM] [Brewer] Start Authentication [5/27/2021, 9:40:20 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:40:20 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:40:20 AM] [Brewer] Start subscribe status [5/27/2021, 9:40:20 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:40:38 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:41:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:42:19 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:42:29 AM] [Brewer] Disconnecting... [5/27/2021, 9:42:29 AM] [Brewer] Disconnecting... [5/27/2021, 9:42:29 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:42:29 AM] [Brewer] Start scan... [5/27/2021, 9:42:34 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:42:36 AM] [Brewer] Request reading states [5/27/2021, 9:42:36 AM] [Brewer] Start Authentication [5/27/2021, 9:42:36 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:42:36 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:42:36 AM] [Brewer] Start subscribe status [5/27/2021, 9:42:36 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:42:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:42:49 AM] [Brewer] Received machine status change!, [5/27/2021, 9:42:49 AM] [Brewer] Ready:false, brewing:false, no water:false, tray error:false [5/27/2021, 9:43:17 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:43:27 AM] [Brewer] Disconnecting... [5/27/2021, 9:43:27 AM] [Brewer] Disconnecting... [5/27/2021, 9:43:27 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:43:27 AM] [Brewer] Start scan... [5/27/2021, 9:43:28 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:43:30 AM] [Brewer] Request reading states [5/27/2021, 9:43:30 AM] [Brewer] Start Authentication [5/27/2021, 9:43:30 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:43:30 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:43:30 AM] [Brewer] Start subscribe status [5/27/2021, 9:43:30 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:43:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:44:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:45:28 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:45:38 AM] [Brewer] Disconnecting... [5/27/2021, 9:45:38 AM] [Brewer] Disconnecting... [5/27/2021, 9:45:38 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:45:38 AM] [Brewer] Start scan... [5/27/2021, 9:45:39 AM] [Brewer] [WATCH] Machine Prodigio_C385818C9BD7 disconnected, but reachable [5/27/2021, 9:45:42 AM] [Brewer] Connected to Prodigio_C385818C9BD7 [5/27/2021, 9:45:43 AM] [Brewer] Request reading states [5/27/2021, 9:45:43 AM] [Brewer] Start Authentication [5/27/2021, 9:45:43 AM] [Brewer] Token: 8e03f7136349c4fc [5/27/2021, 9:45:43 AM] [Brewer] Token buffer: 8e03f7136349c4fc [5/27/2021, 9:45:43 AM] [Brewer] Start subscribe status [5/27/2021, 9:45:43 AM] [Brewer] Found notify status characteristic {"uuid":"06aa3a12f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]} [5/27/2021, 9:46:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:47:39 AM] [Brewer] [WATCH] Connected [5/27/2021, 9:47:41 AM] [Brewer] Machine did disconnect! [5/27/2021, 9:47:51 AM] [Brewer] Disconnecting... [5/27/2021, 9:47:51 AM] [Brewer] Disconnecting... [5/27/2021, 9:47:51 AM] [Brewer] Bluetooth state:poweredOn [5/27/2021, 9:47:51 AM] [Brewer] Start scan... [5/27/2021, 9:48:38 AM] [Brewer] Get Characteristic On -> Promise { false } [5/27/2021, 9:48:38 AM] [Brewer] Get Characteristic On -> Promise { false } [5/27/2021, 9:48:38 AM] [Brewer] Get Characteristic On -> Promise { false } [5/27/2021, 9:48:39 AM] [Brewer] [WATCH] Machine Prodigio_C385818C9BD7 disconnected, but reachable

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

now the accessory doesn't respond

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

argh can't connect to the machine anymore:
[Brewer] Device not connected!
[5/27/2021, 10:06:48 AM] [Brewer] Device not connected!
[5/27/2021, 10:06:48 AM] [Brewer] Device not connected!
[Brewer] [WATCH] Machine Prodigio_C385818C9BD7 unreachable, still scanning

@tritter
Copy link
Owner

tritter commented May 27, 2021

@bubez81 run again beta install, you should get homebridge-brewer@2.0.3-beta.0
I found the problem, because I fixed it for Raspberry I broke it on the Mac. Should work now, sorry for the cumbersome... And again every 2 min the machine disconnects this is by design, also after brewing it will disconnect by design. Thats why I also put those logs only in DEBUG. There is a new "reachability" feature which shows in HomeKit the unreachable state now too, whenever the machine is not discovered within 5min...

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

Sorry can't understand, now I receive this

[Brewer] [WATCH] Machine Prodigio_C385818C9BD7 unreachable, still scanning

And the accessory isn't reachable, have to wait 5?

@tritter
Copy link
Owner

tritter commented May 27, 2021

Yes it may take some time... Sometimes it needs a second run but it should work now!

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

same message: [Brewer] [WATCH] Machine Prodigio_C385818C9BD7 unreachable, still scanning
could be a bluetooth problem? from the Mac mini I can reach the machine I'm sure
Schermata 2021-05-27 alle 11 25 21

@tritter
Copy link
Owner

tritter commented May 27, 2021

Could you send a complete log? So it never connects again?

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

unbelievable, it no longer even connects with the stable version WTF???
Ok what log do you need?

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

[5/27/2021, 3:12:22 PM] [Brewer] Adding coffee type 0
[5/27/2021, 3:12:22 PM] [Brewer] Adding coffee type 1
[5/27/2021, 3:12:22 PM] [Brewer] Adding coffee type 2
[5/27/2021, 3:12:22 PM] [Brewer] Removing coffee type 5
[5/27/2021, 3:12:22 PM] [Brewer] Removing coffee type 4
[5/27/2021, 3:12:23 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:12:23 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:12:23 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:14:26 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:14:26 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:14:26 PM] [Brewer] Get Characteristic On -> Promise { false }
[5/27/2021, 3:14:32 PM] [Brewer] Set Characteristic On -> true
[5/27/2021, 3:14:32 PM] [Brewer] Temperature is 0
[5/27/2021, 3:14:32 PM] [Brewer] Start scan...

an idea..could be a permission problem? recently there was a macos update

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

ok solved with the latest version....in Preferences---Bluetooth I had to delete the Prodigio device, now:

Writing brew Espresso - Medium command
[5/27/2021, 3:43:28 PM] [Brewer] Write characteristics:{"uuid":"06aa3a42f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["write"]}
[5/27/2021, 3:43:28 PM] [Brewer] Sending buffer: 03050704000000000001
[5/27/2021, 3:43:28 PM] [Brewer] Received response: 8305012080800000000000000000000000000000 true
[5/27/2021, 3:43:28 PM] [Brewer] Response [object Object]
[5/27/2021, 3:43:28 PM] [Brewer] Received response!
[5/27/2021, 3:43:28 PM] [Brewer] Received response true
[5/27/2021, 3:43:28 PM] [Brewer] Successfully brewed!

let's try with the beta

@bubez81
Copy link
Author

bubez81 commented May 27, 2021

yatta!
[5/27/2021, 3:46:13 PM] [Brewer] Found notify slider characteristic {"uuid":"06aa3a22f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","write","notify"]}
[5/27/2021, 3:46:13 PM] [Brewer] New notify true
[5/27/2021, 3:46:13 PM] [Brewer] Start subscribe capsule counter
[5/27/2021, 3:46:13 PM] [Brewer] Found capsule count characteristic {"uuid":"06aa3a15f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","write","notify"]}
[5/27/2021, 3:46:13 PM] [Brewer] New notify true
[5/27/2021, 3:46:13 PM] [Brewer] Start subscribe response
[5/27/2021, 3:46:13 PM] [Brewer] Found response characteristic {"uuid":"06aa3a52f22a11e39daa0002a5d5c51b","name":null,"type":null,"properties":["read","notify"]}
[5/27/2021, 3:46:14 PM] [Brewer] New notify true
[5/27/2021, 3:46:14 PM] [Brewer] Request reading states
[5/27/2021, 3:46:14 PM] [Brewer] Received machine status change!, 4002068b00000ed0
[5/27/2021, 3:46:14 PM] [Brewer] Ready:true, brewing:false, no water:false, tray error:false
[5/27/2021, 3:46:14 PM] [Brewer] Received capsule count change! 0034
[5/27/2021, 3:46:14 PM] [Brewer] Capsule counter:enabled capsules left:52
[5/27/2021, 3:46:14 PM] [Brewer] max_capsule_count not configured using 1000
[5/27/2021, 3:46:14 PM] [Brewer] Percentage 5
[5/27/2021, 3:46:14 PM] [Brewer] Received slider status change! 02
[5/27/2021, 3:46:14 PM] [Brewer] Slider:closed
[5/27/2021, 3:46:23 PM] [Brewer] [WATCH] Connected

@bubez81
Copy link
Author

bubez81 commented May 31, 2021

ok seems to work very well, but the tray error sensor I think refers to a full capsule container

@tritter
Copy link
Owner

tritter commented May 31, 2021

@bubez81 Good to hear after the initial problems 👍
Yes it is tray == container, it can be an error or full. So Tray Error was the shortest description I came up with. Do you have any name suggestion? I think its called a "drip tray" officially https://www.nespresso.com/us/en/machine-assistance#!/Expert/instructions/emptying-the-system/guide

@bubez81
Copy link
Author

bubez81 commented May 31, 2021

The drip tray is the container for drops, the name is fine for me then...could the plug-in be faster now? it seems like a flash to me

@tritter
Copy link
Owner

tritter commented May 31, 2021

Yes because it's constantly connected. That was the difficult part... In v1.0 it only connects to brew. Now it's connected all the time to get change of states like slider and if the coffee is ready etc.

@bubez81
Copy link
Author

bubez81 commented May 31, 2021

Excellent work

@tritter
Copy link
Owner

tritter commented Jun 6, 2021

Thanks a lot! :) Merged to master now! Will close this ticket for now. Dreaming of 'custom recipes' as next feature ;-)

@tritter tritter closed this as completed Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants