Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Pete Stothers
Published © GPL3+

Hack a Breville Espresso Machine for Home Assistant Control

A quick guide on how to add a Shelly 1 WiFi relay inside a Breville BES870 espresso machine to mimic the on/off switch.

IntermediateFull instructions provided2 hours23,423
Hack a Breville Espresso Machine for Home Assistant Control

Things used in this project

Hardware components

Shelly1 WiFi Relay
×1

Software apps and online services

Home Assistant
Home Assistant

Story

Read more

Code

Home Assistant Coffee Machine Package

YAML
The three elements required for the code to work. A MQTT switch (Shelly), some kind of powering monitoring switch and a template switch. With the addition of the power monitoring switch, Home Assistant now has feedback to determine whether the machine is on or off based on power draw. This info is fed directly into the template switch.

For this coffee machine (and others I suspect, the switch state in HA but bounce around a bit when the machine is turned off as there is a 'cool-down' period and the unit keeps drawing power for quite a few seconds after the power is turned off.
switch:
  - platform: template
    switches:
      coffee_machine:
        friendly_name: Espresso Machine
        # A value template can only report true or false #
        value_template: "{{ states('sensor.xiaomi_coffee_machine_power') | float > 3 }}"
        ## > sign in float indicated on if above. If you use <, that means off if above ##
        turn_on: &toggle_coffee
          - service: switch.turn_on
            entity_id: switch.coffee_machine_shelly_relay
          - delay:
              milliseconds: 400
          - service: switch.turn_off
            entity_id: switch.coffee_machine_shelly_relay
        turn_off: *toggle_coffee

  - platform: mqtt
    name: "Coffee Machine Shelly Relay"
    state_topic: "shellies/shelly1-<deviceID>/relay/0"
    command_topic: "shellies/shelly1-<deviceID>/relay/0/command"
    availability_topic: shellies/shelly1-<deviceID>/online
    payload_available: "true"
    payload_not_available: "false"
    qos: 2
    payload_on: "on"
    payload_off: "off"
    retain: false
    optimistic: false

Credits

Pete Stothers

Pete Stothers

1 project • 4 followers

Comments