Skip to content

bulldog5046/ha_nespresso_integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee

Nespresso

Nespresso Bluetooth integration for Home Assistant.

Originally intended to be a fork of the work from tikismoke but has morphed significantly and the original work is no longer under development i've decided to create a new project home.

Thank you to tikismoke and all those before him who helped reverse engineer the protocols.

https://github.com/tikismoke/home-assistant-nespressoble

This project is still a work in progress

Features

  • Native configuration flow for Home Assistant
  • Device discovery
  • Direct pairing/auth (No need to extract auth_key from mobile app)
  • Option to reuse an exiting auth_key if you have one
  • Reworked to use the native Home Assistant bleak bluetooth library

Requirements

  • The integration can either reuse an existing auth_key, if known. Or can begin a new paring process.

WARNING: I discovered an oversight in the machines bluetooth programming that can lead to the machine falling into a state where it cannot be paired with any more devices. The number seems to be around 25 before the bluetooth module runs out of memory to store the pairing keys and will fail to operate correctly. The only way to restore the machine if this happens is to hook up a JTAG programmer and manually erase the flash sectors. Therefore, its preferable if you already know an existing auth key to reuse it for this integration.

Examples

Basic button

Basic Card

A basic button card can directly call the service with the data provided if you only want a simple button option, or if you want a dashboard with various button options.

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: sensor.expert_milk_d1e1037c4a9d_always_1
hold_action:
  action: call-service
  service: nespresso.coffee
  target: {}
  data:
    brew_temp: Medium
    brew_type: Lungo
show_state: false
icon: mdi:coffee
name: Brew Americano

Selectable Options

Example Card

Create two helpers for the dropdown lists with the values available in the machines.BrewType and machines.Temprature enums. Low or mixed case values on the dropdown for appearance. The text values will be converted up uppercase within the service call.

Helpers

Add the following to your scripts.yaml to wrap the input selectors with the service call.

scripts.yaml

brew_coffee:
  sequence:
    - service: nespresso.coffee
      data:
        brew_type: "{{ states('input_select.brew_type') }}"
        brew_temp: "{{ states('input_select.brew_temp') }}"
  alias: Brew Coffee

Create the card.

type: entities
title: Coffee Maker Controls
entities:
  - entity: input_select.brew_type
  - entity: input_select.brew_temp
  - type: button
    tap_action:
      action: call-service
      service: script.brew_coffee
    name: Brew Coffee

Custom recipes

Custom Recipes

The service supports optional configuration parameters to allow you to create your own ideal recipe. When adding the call service to a button card you can define the quantity of coffee and water in mililiters to dispense.

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: nespresso.coffee
  target: {}
  data:
    coffee_ml: 123
    water_ml: 69
    brew_temp: Medium
entity: sensor.expert_milk_d1e1037c4a9d_always_1
name: Custom Recipe
icon_height: 50px
show_state: false
icon: mdi:coffee-outline

Caps Counter

Caps Counter

Reading/writing the caps counter is supported. Be aware that the counter doesn't update until the next time the machine is polled for sensor data (every 5 minutes).

Example card

type: vertical-stack
cards:
  - show_state: true
    show_name: false
    camera_view: auto
    type: picture-entity
    entity: sensor.expert_milk_d1e1037c4a9d_caps_number
    image: /local/NespressoCaps.png
  - type: entities
    entities:
      - entity: input_number.caps_counter
        name: Set New Counter Total
      - type: call-service
        name: Update Capsule Count
        action_name: Set Counter
        service: script.update_capsule_count
    show_header_toggle: false

scripts.yaml

update_capsule_count:
  alias: Update Capsule Count
  sequence:
    - service: nespresso.caps
      data:
        caps: "{{ states('input_number.caps_counter') }}"
  mode: single

Troubleshooting

While working on this project I've observed some quirks with Home Assistant and Bluetooth. In an effort to help people resolve their own problems, here are the most common things i've come across.

  1. The machine only brews once

This is an easy one. The lid must be cycled between brew events when controlled over bluetooth.

  1. The pairing process fails

I've seen various combinations of systems and bluetooth dongles that seem to fail the standard bluetooth pairing. The easiest way to verify this on your system is to run bluetoothctl and manually attempt to pair. You should see the same error in the Home Assistant logs.

bluetoothctl failing

Frustratingly, this issue may go away if you try the same dongle on a different system. I can only assume its a driver related issue.

  1. The device is setup but there are no entities

Something went wrong when installing the new auth_key. Delete the device from Home Assistant, factory reset the machine and try again.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages