Page 1 of 1

Domoticz to control my coffee machine

Posted: Monday 13 July 2015 10:04
by bntdumas
Hello all,

I added WiFi to my coffee machine and connected it to Domoticz so I can prepare myself a coffee while I'm sitting at my desk or setup a timer to have a fresh coffee ready when I wake up :)



Adding WiFi to the machine
Image
Using an esp8266 for the WiFi connection, I connected a transistor to each button of the machine, and connected the screen back light signal to my circuit in order to get the current status of the machine (back light color changes from green to red to yellow depending on what's going on).


Image
The circuit is completely embedded in the machine and is totally invisible, it is connected to the machine power so it doesn't need any external buttons or anything. of course the machine works exactly as before, each button is still fully functional.


Programming
I use LUA (with a NodeMCU formware) on the esp8266, with a TCP client (to get commands from Domoticz) and a TCP server (to send out status at regular intervals).
On Domoticz I have four defined devices, three outputs and one input:
- Machine power
- Machine status
- Small coffee
- Large coffee

I'm using Dashticz as an alternative dashboard, and I made a custom bloc that gather information from these 4 devices into one, resulting in a nice looking and easy to use interface for my WiFi coffee machine:
Image

Some links
Source code is here https://github.com/Bntdumas/DomoticzCoffeeMachine
My Dashticz fork is here: https://github.com/Bntdumas/Dashticz (I made some bug fixing in the original code and started adding a French translation for it, will do a pull request once it's a bit more polished)
Detailled project log is here: http://www.bntdumas.com/2015/07/15/how- ... e-part-1//
Imgur album: https://imgur.com/a/NZQ1L
It was a very fun project to work on, I'd love to hear your thoughts on it!
Benoit

Re: Domoticz to control my coffee machine

Posted: Monday 13 July 2015 11:07
by Thomasdc
great project! hanks for sharing!

Re: Domoticz to control my coffee machine

Posted: Monday 13 July 2015 12:19
by jjnj
Awesome, will try to work it out soon! Thank you very much for sharing

Re: Domoticz to control my coffee machine

Posted: Tuesday 14 July 2015 13:38
by kivster
You Sir, are my hero!

Great job! I'm going to have to try and replicate this!

Re: Domoticz to control my coffee machine

Posted: Wednesday 15 July 2015 7:43
by jannl
A question. When I start my coffee machine it starts first cleaning. After that i have to put an empty cup. How did you deal with this?

Re: Domoticz to control my coffee machine

Posted: Wednesday 15 July 2015 9:50
by bntdumas
I had the same issue, the machine rinses both when turned on and off.
However, the process can be stopped, during the rinsing cycle a stop button appears, which prevents any water from dripping.
Because there's no way for me to read the screen and look for the "stop" being displayed, I (programmatically) click on the button until the screen turns green. It worked great so far.
Because the rinse function is still useful, I turn on the machine during the night and let it turn itself off automatically (that's two rinse cycles).

Re: Domoticz to control my coffee machine

Posted: Wednesday 15 July 2015 18:16
by jannl
But then you can't wake up with fresh coffee.
But still a very neath idea.

Re: Domoticz to control my coffee machine

Posted: Wednesday 15 July 2015 22:19
by bntdumas
jan_nl wrote:But then you can't wake up with fresh coffee.
But still a very neath idea.
Oh but I can :)

Check the function "tryStopRinse" in my lua code: https://github.com/Bntdumas/DomoticzCof ... achine.lua

Code: Select all

-- Try to interrupt the rinsing cycle
function coffeeMachine.tryStopRinse()
    print("tryStopRinse")
    -- after one minute, stop clicking, there's something wrong...
    tmr.alarm(1, 40000, 0, function()
        tmr.stop(2)
    end)
    tmr.alarm(2, 1500, 1, function()
        -- every 1.5s, try pushing the button stop if the screen
        -- color is still yellow
        if coffeeMachine.colorStr() == "yellow" then
            coffeeMachine.pushButton(pinTopLeftButton)
        elseif coffeeMachine.colorStr() == "green" or
                coffeeMachine.colorStr() == "red" then
            tmr.stop(2)
        end
    end)
end
I automatically stop the rinsing cycle before any water starts dripping.

Re: Domoticz to control my coffee machine

Posted: Wednesday 15 July 2015 22:54
by Raspberry Piet
Just want to say this is very awesome!!!

Re: Domoticz to control my coffee machine

Posted: Friday 17 July 2015 8:44
by dieseljohn
Wow nice video its simply great for preparing coffee.

Simple Electronic Question

Posted: Monday 26 October 2015 11:30
by bewo
Great project bntdumas! :D

Re: Domoticz to control my coffee machine

Posted: Sunday 15 November 2015 19:33
by u01pei
Nice!
Parts are on order as we speak!

Thanks!

Re: Domoticz to control my coffee machine

Posted: Thursday 24 December 2015 15:44
by dynasticorpheus
This is so COOL, great job!