This small python package makes it possible to brew coffee with a Jura E6 machin.
It is (will be) used in app that tracks how many coffees each employee takes. Therefore, it aims for high reliability and low maintenance.
Note
This code was tested on a Jura responding ty:EF532M V02.03 to TY: and tl:BL_RL78 V01.31 to TL:.
To be able to download the app, add the relevant pypi index in /etc/pip.conf:
[global]
extra-index-url =
https://www.piwheels.org/simple
https://__token__:[token]@gitlab.ensta.fr/api/v4/groups/3178/-/packages/pypi/simpleNote
The token needs to be created here with read_api scope and developer role.
Then install pipx with the official tutorial.
Finally, install this app with pipx install juracoffeemachine.
Note
pipx is the recommended installation method, but you can also use regular python virtual environment
For the wiring, please look at the diagram here. Don't forget that the TX/RX of the controller should be connected to the RX/TX of the machin.
To brew a coffee juracoffeemachine --port /dev/ttyUSB0, then while the coffee machine
is running (there is no safety regarding this for now), press +/- to increase/decrease coffee beans/water.
The minimal example to brew a coffee is as follows:
from juracoffeemachine.coffee_machine import CoffeeMaker
from juracoffeemachine.jura import JuraProtocol
machin = CoffeeMaker(JuraProtocol("/dev/ttyUSB0"))
machin.brew_coffee(machin.CoffeeType.COFFEE)If you're only interested in the protocol itself and which information can be retrieved, check out:
- encode, decode: functions to send message to the jura
- JuraCommand: the list of message that is used in this package
- GROUP_REGEX: part of the signification of the response from the jura
The python package is automatically built when a branch is merged on main, a release is created here, and it is published to the GitLab pypi index to be available for download.
The pipeline first tests and then builds the package with the build module, then with GitLab API and the twine module publishes the release and the package. Please refer to .gitlab-ci.yml for the exact details of the pipeline.
Tip
To allow releases creation, create a token here with the permission
api, write_repository with the role Developer, then create the variable
RELEASE_TOKEN here.
Other work exists to try and control Jura coffee machines. All the protocol used in this project was decoded by COM8 in his project protocol-cpp (see also the organisation JuttaProto). Juramote, q42, at.ua was also of great help to extract relevant information from the Jura.
All contribution are welcomed, submit an issue for bug reports/feature requests (or open a pull request if you already implemented the feature).
See LICENSE