I managed to integrate the Smarter Coffee machine with openHAB using the iBrew API. I didn’t use the machine much however so I sold it, but this config might be useful for someone else
First, clone iBrew from my fork: https://github.com/idserda/iBrew.git (some changes are not (yet) in the main repo)
Then, download additional files (script, icons, maps) here: https://www.dropbox.com/sh/ri93wrny82e0uf7/AABFBzcaR03IuxgvUeuv3dSDa?dl=0
From the command line, execute the following commands. These will add triggers so information is pushed to openHAB. It’s not possible to do this from the ‘console’ mode of iBrew because of the several spaces in the commands. The <script location>
is the complete path to the openhab.sh script on the Dropbox link.
./ibrew trigger openHAB switch ON
./ibrew trigger add openHAB HOTPLATE "<script location> SmarterCoffeeHotplate §N" <coffeemaker IP>
./ibrew trigger add openHAB CUPS "<script location> SmarterCoffeeCups §N" <coffeemaker IP>
./ibrew trigger add openHAB STRENGTHTEXT "<script location> SmarterCoffeeStrength §N" <coffeemaker IP>
./ibrew trigger add openHAB GRIND "<script location> SmarterCoffeeGrind §N" <coffeemaker IP>
./ibrew trigger add openHAB WATERLEVEL "<script location> SmarterCoffeeWaterLevel §N" <coffeemaker IP>
./ibrew trigger add openHAB COFFEEBUSY "<script location> SmarterCoffeeBusy §N" <coffeemaker IP>
./ibrew trigger add openHAB COFFEEHEATER "<script location> SmarterCoffeeCoffeeHeater §N" <coffeemaker IP>
./ibrew trigger add openHAB WORKING "<script location> SmarterCoffeeWorking §N" <coffeemaker IP>
./ibrew trigger add openHAB READY "<script location> SmarterCoffeeReady §N" <coffeemaker IP>
./ibrew trigger add openHAB COFFEESTATUS "<script location> SmarterCoffeeStatus '§N'" <coffeemaker IP>
./ibrew trigger add openHAB ENOUGHWATER "<script location> SmarterCoffeeEnoughWater §N" <coffeemaker IP>
./ibrew trigger add openHAB CARAFE "<script location> SmarterCoffeeCarafe §N" <coffeemaker IP>
(example: ./ibrew trigger add openHAB CUPS "/home/jeroen/Applications/iBrew/openhab.sh SmarterCoffeeCups §N" 192.168.1.85
)
Then start ibrew with ./iBrew dump events web
I used these items:
Items:
Switch SmarterCoffeeHotplate "Warmhoudplaat" <stove> (SaveState) {http=">[ON:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/hotplate/on/40] >[OFF:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/hotplate/off]", autoupdate="false"}
Number SmarterCoffeeCups "Aantal kopjes" <coffeecups> (SaveState) {http=">[*:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/cups/%2$s]", autoupdate="false"}
String SmarterCoffeeStrength "Sterkte" <coffeebeans> (SaveState) {http=">[*:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/%2$s]", autoupdate="false"}
Switch SmarterCoffeeBrew "Zet koffie" <coffeemachine> (SaveState) {http=">[ON:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/start] >[OFF:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/stop]", autoupdate="false"}
Switch SmarterCoffeeGrind "Gebruik bonen" <coffeebean> (SaveState) {http=">[ON:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/beans] >[OFF:GET:http://<iBrew ip:host>/api/<coffeemaker IP>/filter]", autoupdate="false"}
Switch SmarterCoffeeWorking "Bezig [MAP(aanuit.map):%s]" <info> (SaveState)
Switch SmarterCoffeeReady "Klaar [MAP(aanuit.map):%s]" <coffee> (SaveState)
Switch SmarterCoffeeCoffeeHeater "Verwarmingselement [MAP(aanuit.map):%s]" <heater> (SaveState)
Switch SmarterCoffeeBusy "Bonen malen [MAP(aanuit.map):%s]" <coffeegrinder> (SaveState)
Number SmarterCoffeeWaterLevel "Hoeveelheid water [MAP(waterlevel.map):%s]"<measuringcup> (SaveState)
String SmarterCoffeeStatus "Status [%s]" <info> (SaveState)
Switch SmarterCoffeeEnoughWater "Genoeg water [MAP(aanuit.map):%s]" <water> (SaveState)
Switch SmarterCoffeeCarafe "Pot geplaatst [MAP(aanuit.map):%s]" <coffeepot> (SaveState)
Replace <iBrew ip:host>
and <coffeemaker IP>
. Example: http://192.168.1.15:2080/api/192.168.1.85/hotplate/off. The state of all items in group SaveState
are persisted, you’ll need to configure this yourself.
Sitemap:
Frame label="Smarter Coffee" {
Selection item=SmarterCoffeeCups mappings=[ 1="1", 2="2", 3="3", 4="4", 5="5", 6="6", 7="7", 8="8", 9="9", 10="10", 11="11", 12="12" ]
Switch item=SmarterCoffeeHotplate
Switch item=SmarterCoffeeBrew mappings=[ ON="Start", OFF="Stop" ]
Text item=SmarterCoffeeStatus label="Status [MAP(smarterstatus.map):%s]" {
Frame label="Instellingen" {
Selection item=SmarterCoffeeStrength mappings=[ weak="Mild", medium="Normaal", strong="Sterk"] visibility=[SmarterCoffeeGrind==ON]
Switch item=SmarterCoffeeGrind
}
Frame label="Status" {
Text item=SmarterCoffeeWaterLevel
Text item=SmarterCoffeeReady
Text item=SmarterCoffeeEnoughWater
Text item=SmarterCoffeeCarafe
}
Frame label="Acties" {
Text item=SmarterCoffeeBusy
Text item=SmarterCoffeeCoffeeHeater
}
}
}
This looks like this:
Let me know if you have any questions