AlexxIT / Jura

Home Assistant custom component for control Jura Coffee Machines via Bluetooth module
53 stars 3 forks source link

Disconnect every 20 seconds #7

Open jflefebvre06 opened 10 months ago

jflefebvre06 commented 10 months ago

Hello, Thanks a lot for the job, perfectly works with my Jura S80, the only problem I have is it disconnect every 20 seconds

image

I use atom bluetooth proxy

substitutions:
  name: atom-bluetooth-proxy
  board: m5stack-atom
  mac: 0d350c

esphome:
  name: ${name}
  name_add_mac_suffix: true

esp32:
  board: ${board}
  framework:
    type: esp-idf

# Enable Home Assistant API
api:

# Enable logging
logger:

ota:

improv_serial:

# captive_portal:

bluetooth_proxy:
  active: true

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: ${name}-${mac}.local

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

Do you have implemented the heartbeat ?

AlexxIT commented 10 months ago

On a good bluetooth adapter everything works fine https://github.com/AlexxIT/Jura#bluetooth

jflefebvre06 commented 10 months ago

I have a good ble adapter : Sena UD100-G03

AlexxIT commented 10 months ago

I know nothing about your model. If it has good and original chip inside. Also you said about ESP proxy. You need to make sure that the connection happens via adapter and not via proxy.

jflefebvre06 commented 10 months ago

It is referenced as KNOWN WORKING HIGH-PERFORMANCE ADAPTERS

Yes I use ESP proxy tool (Atom lite), I have tried with BLE proxy and direct bluetooth, same result. Do you have implemented the heartbeat ?

AlexxIT commented 10 months ago

I have implemented another version of holding connection. It works great with my model of coffee maker.

It is important that you perform a quality direct connection test through the CSR8510A10 adapter. It must be connected to a USB extension cable and be 1/2 metre away from other devices, including your server. And the range to the coffee machine should be no more than a few metres.

It is advisable to switch off the power of the proxy when doing test.

drstil commented 6 months ago

@AlexxIT Thank you very much for creating and sharing this nice library! =)

As also mentioned in your documentation, I'm using a Bluetooth proxy (HA Core 2024.3.0, ESP32 with ESPHome Integration 2024.2.1) to the connection to my Jura Giga 10. If I setup with recommend configuration for an ethernet-connected Bluetooth proxy: https://esphome.io/components/bluetooth_proxy.html, I got an error ERROR (MainThread) [homeassistant.components.config] The bluetooth integration does not support any configuration parameters ... So I removed those.

It is also possible to use a Bluetooth Proxy with active mode supported.

As seen at others the Connection to the machine is lost after different time periods (minutes):

image image

If I change some entity value (e. g. Product) in HA in the Jura integration the connection is back again. In principle the other communication with the machine is working perfect!

I enabled the setting Enable polling for updates..

So my questions:

  1. Is my bluetooth setup / hardware really supported?
  2. How should I set the active bluetooth connection?
  3. Is it normal that the connection is lost after some time but reestablished if I change some entity value in the integration?
AlexxIT commented 6 months ago

Is my bluetooth setup / hardware really supported?

Probably supported, but it is not sure that the operation will be stable.

Is it normal that the connection is lost after some time but reestablished if I change some entity value in the integration?

That's the way it's designed. The component does not maintain a 24/7 connection to the coffee maker. It connects when the user customizes the drink. And disconnects after 2 minutes of idle time.

PS. Disconnecting after 20 seconds (this issue) is a bug. I don't know why it happens and how to fix it.