Controlling Delonghi Primadonna Elite through ST

@manekinekko
any ideas ?

@mrmrmrmr Can you try this command?

0d 0f 83 f0 04 01 01 00 28 02 02 00 00 06 ab 53

@manekinekko
thanks. that works as 2x espresso

btw, is there an ready function (js/nodejs) to calculate checksum bytes ?

I started working on a Web application that connects directly to the coffee machine. I will share the first version once I have some time.

@mrmrmrmr here is the draft of the app I am working on. Let me know if the command that are generated are working as expected for you:

https://calm-field-0ead81403.azurestaticapps.net

Thanks.

@manekinekko

this is very nice. and it works.
thx.

I just didn’t understand what the below 2 boxes (operation status & monitoring) are for.
are they usable ?

Thank you. The UI is still under development. These boxes will be used in the feature for logging.

@manekinekko, I wanted to start with saying thank you for your work so far!
I’ve been looking into this with the end game being an integration into Home Assistant so I can control my PrimaDonna Elite via Google Home.
Being a software developer myself (Java certified, but really language agnostic) I’m looking in to where I might be able to help with the (very limited unfortunately) time that I have available at the moment… However, I’m still getting my head around the whole structure. Granted, I’ve spent less than 15 minutes looking into it over my lunch break :wink:
Are there areas that you need an extra pair of hands? And is this meant to integrate with HA at some stage, or more as a stand-alone solution for now? (Apologies, I’m not entirely familiar with HA <-> SmartThings yet)

PS. My first pull request will probably be fixing the spelling of Espresso :wink:

1 Like

Hey @Peter_Davids

The project is still under exploration, and hacking phase, nothing is set in stone. And I only work on it a few hours per month. My hope is to build a Node.js library that can simplify the work of the developers and help them integrate their apps with other services (that’s the ultimate goal).

I am not either familiar with HA, but I have a lot of experience with the Google Assistant runtime and ecosystem.

I’d really love any help with the project, there are no good or bad contributions, every contribution is appreciated :slight_smile:

2 Likes

Awesome! I’m having to burn some midnight oil over the next week or so to finish a project on a deadline for work, but happy to connect afterwards somewhere/somehow so you can point me in the direction where I can add most value as an experienced developer, knowing nothing about your project :slight_smile: Some low hanging fruit maybe that just needs some hands?

1 Like

@manekinekko ,

I’m controlling the device using “noble” on my PI server.
it is continuosly connected to the coffee machine.
Sometimes, it starts to fail receiving packets from the coffee machine.
when that happens, I can only restore connection by power-off/power-on of the coffee machine.

restarting bluetooth on PI , or even rebooting PI does not help with this situation.

do you have any idea what happens that blocks the coffee machine communication with my PI server ?

on what type of device are you controlling the coffee machine ?

Btw, my nodejs code is a very amateur code. If you want I can share it with you.

@manekinekko , do you have such problem on BLE ?
I’m really struggling with this and I don’t know how to solve it, or what I’m doing wrong.

@mrmrmrmr I don’t have this issue.

Have you tried pinging this char 0d 05 75 0f da 25 every 5s to keep the connection active! Maybe the BLE server on the machine stops the connection if no requests are made during a certain amount of time.

Also, do you see the Bluetooth logo on the machine?

@manekinekko
I ping it with that command, but not every 5 seconds. I do that every 30 seconds.
Do you have any reason to ping it so frequently ?

yes I see the bluetooth logo normally , but I did not check it when the problem happened.

I have noticed that the Android app is pinging the machine every 5s.

@manekinekko
that’s too frequent but anyway, I’ll try that.

btw, even if it is a disconnect issue, then stopping and restarting Bluetooth device on linux server should disconnect from Coffemachine normally and then reconnect. Am I wrong ?
can I continue pinging even when there is an order ongoing ?

btw, even if it is a disconnect issue, then stopping and restarting Bluetooth device on linux server should disconnect from Coffemachine normally and then reconnect. Am I wrong ?

I am not quite sure. Maybe this depends on the Bluetooth adapter being used.

can I continue pinging even when there is an order ongoing ?

Yes, because the machine will send back the status of the order (as I mentioned in my GitHub repo)

well, the 5 second ping trick did not help.
it still starts failing after some time (random)

so maybe the library I use is not good (noble)
I would like to try your implementation.
However, I need to create http endpoints to call, on your code.
At what file should I create the endpoint ?
and how can I call your functions ?

basically I want to add something like :

var path = require('path')
var express = require('express')
var bodyParser = require('body-parser')
var parameterize = require('parameterize')
var app = express()

app.use(bodyParser.urlencoded({ extended: false }))
app.use(express.static(path.join(__dirname, 'public')));

app.listen(9123)


app.get('/coffee/:type',  function(req, res){
 var type = req.params.type

  Coffee(type, function() {
   console.log('callback from func');
   if (condition) {
    responsestate = "state:" + "on";
   } else {
    responsestate = "state:" + "off";
   }   
    res.send(responsestate);
   });
})

function Coffee(cmd, callback) {
                 if(cmd=="poweron") {
                  cmd="";
                  var crust = new Buffer("0d07840f02015512", "hex")
                  CH.write(crust, false, function(err) { });
                  responsestate+="state:turningOn";
                 }
                 if(cmd=="capuccino") {
                  cmd="";
                  setTimeout(makecapuccino, 2000);
                 }
                 if(cmd=="capuccinomix") {
                  cmd="";
                  setTimeout(makecapuccinomix, 2000);
                 }
                 if(cmd=="espresso") {
                  cmd="";
                  setTimeout(makeespresso, 2000);
                 }
                 if(cmd=="americano") {
                  cmd="";
                  setTimeout(makeamericano, 2000);
                 }
                 if(cmd=="doubleespresso") {
                  cmd="";
                  setTimeout(makedoubleespresso, 2000);
                 }      

  setTimeout(callback, 5000);
}

I’m really stuck.
maybe my nodejs code is problematic.
because in this state , if I send a “power on” command it seems to work.

Could you open an issue on my github project so we can look through this together? For now, my package does not expose any public API. Let’s chat about how you want this to be. Cheers.

1 Like