Giter Club home page Giter Club logo

hass-ember-mug-component's People

Contributors

bwduncan avatar dependabot[bot] avatar sopelj avatar winstona avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-ember-mug-component's Issues

Feature request: estimated battery life remaining

If anyone could help, it would be cool to have an entity that tracks the battery percentage over time to give us an estimated number of minutes remaining before the battery runs out.

It could be part of the integration, or I guess could be done with a template of some sort in home assistant outside of the integration. Its a bit beyond my skill set to figure out... Thanks!

Feature request: predefined temperatures like in the Ember mobile app

  • Home Assistant Version (eg. 2023.11):
  • Ember Mug Component Version (eg. 0.8.0):
  • Which device(s) are you using for Bluetooth: ESPHome Proxy

Description

I would like to be able to quickly select temperature from a predefined list of temperatures like in the Ember mobile app.

What I Did

I've managed to achieve this by adding an input_select:

input_select:
  target_temperature:
    name: Ember Mug Target Temperature
    options:
      - Latte - 55⁰C
      - Cappuccino - 56⁰C
      - Coffee - 57⁰C
      - Black Tea - 58.5⁰C
      - Green Tea - 59⁰C
    initial: Black Tea - 58.5⁰C
    icon: mdi:tea

And an automation:

automation:
  - id: mug_target_temperature_changed
    alias: Mug Target Temperature Changed
    trigger:
      platform: state
      entity_id: input_select.target_temperature
    action:
      service: number.set_value
      data:
        value: "{{ states('input_select.target_temperature') | regex_replace(find='[^0-9.]', replace='', ignorecase=False) }}"
      target:
        entity_id: number.ember_mug_target_temp

Even though this custom component is already amazing (and I thank you for making it), this would make it even more awesome imho.

No reconnecting after a restart of Home Assistant

  • Home Assistant Version (eg. 2023.2): 2023.6
  • Ember Mug Component Version (eg. 0.5.0): 0.7.1

Description

After restarting Home Assistant, the integration cannot complete the setup because it fails to re-establish a Bluetooth connection to the Mug/Cup.

What I Did

To complete the setup, the Mug/Cup must be set to pairing mode. This is necessary each time after a restart. Before this, all entities are not available.

Logs / Errors

This error was caused by a custom integration
Logger: ember_mug.mug
Source: custom_components/ember_mug/coordinator.py:62
Integration: Ember Mug (documentation, issues)
First occurred: 19:10:40 (6 occurrences)
Last logged: 19:20:10

EF:70:A4:DA:3F:B0: Ember Cup 2: Failed to connect to the mug: (EF:70:A4:DA:3F:B0) - EF:70:A4:DA:3F:B0: Failed to connect:

This error was caused by a custom integration

Logger: custom_components.ember_mug.coordinator
Source: custom_components/ember_mug/coordinator.py:72
Integration: Ember Mug (documentation, issues)
First occurred: 19:10:40 (6 occurrences)
Last logged: 19:20:10

An error occurred whilst updating the Ember Cup 2: (EF:70:A4:DA:3F:B0) - EF:70:A4:DA:3F:B0: Failed to connect:

picking up random bluetooth devices, not ember mug

I have an ember 2 bug and can't get it connected. It is not showing up automatically. When I click + Add Integration the wizard runs and it tries to connect to misc bluetooth devices I have that I know are not the ember mug. (One is my bhyve sprinkler, and it also tries to add my Xiaomi miija plant 'flower care' sensors.

I have followed all the steps, removing the mug from the ember app, then forgetting bluetooth entry from iPhone, then full reset to flashing red.

The mug stays in pairing mode flashing blue and nothing coming in from home assistant.

running 0.4.0 beta 2 version

Failed to pair: org.bluez.Error.AuthenticationFailed

I am trying to pair my mug and I followed all the steps. Can you elaborate on this step here from the README?

  1. Home Assistant should auto-detect the mug and prompt you to configure it.
    Choose "Configure"
    And then hit "Next"

I might be misunderstanding so I was trying to connect my mug directly from the command line with bluetoothctl pair XXXXX but not succeeding.

Should I be able to somehow configure the connection to the mug from my HA UI?

Thanks

Home assistant - mug integrates, but can't write to it.

  • Home Assistant Version (2024.43):
  • Ember Mug Component Version firmware 352, hardware 10)
  • Which device(s) are you using for Bluetooth ( ESPHome Proxy):

Description

The integration is fine and I can see all the entities and they are correct.

I tried reinstalling the integration, also deleting my proxy data and reinstalling.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Logs / Errors

I cannot change any (i.e. temperature) because I get this error message Failed to call service number/set_value. Unable to write to mug I get this error if I try to change to latte/coffee Failed to call service select/select_option. Bluetooth GATT Error address=F5:03:AB:05:4D:B3 handle=18 error=3 description=Write not permitted)

Integration slow to load

  • Home Assistant Version (eg. 2023.11): 2024.04
  • Ember Mug Component Version (eg. 0.8.0): 1.0.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): ESPHome Proxy

Description

This is a great integration! However, it is also the slowest (by far) of any of my integrations to load. I am now even seeing errors in the logs from it. Anything that can be done to speed it up? By the way, it is always the slowest and worse when the Mug is outside the range of bluetooth during the restart (e.g. most recently 112s with everything else <10s.

What I Did

Rebooted

Logs / Errors

2024-04-04 08:52:00.382 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: {('ember_mug', 'redacted'): redacted}

If possible/applicable, please enable logging, reproduce the issue and include any related errors below.
This greatly helps with debugging and is much appreciated.
(If you aren't sure how to enable it, please see the debugging section in the README)

Device not found

This error originated from a custom integration.

Logger: custom_components.ember_mug.mug
Source: custom_components/ember_mug/mug.py:263
Integration: Ember Mug (documentation)
First occurred: 20:14:23 (7 occurrences)
Last logged: 20:18:23

Init: Device with address E1:6E:67:C7:B0:93 was not found. on attempt 3. waiting 30sec
Init: Device with address E1:6E:67:C7:B0:93 was not found. on attempt 4. waiting 30sec

This occurs right after pairing, but persists after reboot of HassOS.

Ember mug wont reconnect after resting HA from backup

  • Home Assistant Version: 2023.11.2
  • Operating System: 11.1
  • Ember Mug Component Version: 0.8.0
  • Intel NUC built in bluetooth

Description

After restoring from backup ember mug does not connect to home assistant

What I Did

I reset the mug, I uninstalled and re-installed both hacs integration and ha  integration and attempted repair. I also ran bluetoothctl and put the mug into pairing mode but still it wont connect

Logs / Errors

2023-11-17 20:52:43.351 DEBUG (MainThread) [ember_mug.mug] Set new device from DB:7C:3C:36:0C:88: Ember Ceramic Mug to DB:7C:3C:36:0C:88: Ember Ceramic Mug
2023-11-17 20:52:43.351 DEBUG (MainThread) [ember_mug.mug] Callback <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f040cea6010>> already registered
2023-11-17 20:52:43.351 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Updating
2023-11-17 20:52:43.351 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'meta', 'firmware'}
2023-11-17 20:52:43.351 DEBUG (MainThread) [ember_mug.mug] Establishing a new connection from mug (ID: 139655508168464) to DB:7C:3C:36:0C:88: Ember Ceramic Mug
2023-11-17 20:52:44.375 DEBUG (MainThread) [ember_mug.mug] DB:7C:3C:36:0C:88: Ember Ceramic Mug: Failed to connect to the mug: (DB:7C:3C:36:0C:88) - DB:7C:3C:36:0C:88: Failed to connect after 8 attempt(s): [org.bluez.Error.Failed] Operation already in progress
2023-11-17 20:52:44.375 DEBUG (MainThread) [custom_components.ember_mug] Finished fetching ember-mug-db7c3c360c88 data in 12.542 seconds (success: False)
2023-11-17 20:52:44.375 DEBUG (MainThread) [ember_mug.mug] Unregistered callback: <function async_setup_entry.. at 0x7f04093ec2c0>

BleakNotFound Error

Having just discovered this integration and being a long-time Ember owner, I was excited at the prospect of having days about the cup available in HA.

I added the integration and when the cup showed up in autodiscovery, I added it. Per the instructions, I put the cup in pairing mode and waited. After a minute or so of the integration saying "Initializing", I got the attached error message.

Deets:

  • HassOS running on rpi 4B
  • BT integration enabled in HA
  • not the first HACS integration I've added
  • not the first BT device I've added to HA
  • I had previously set up the mug on my phone and had BT turned off on the phone before trying this
  • after getting this error, the integration want back to "Initializing" and I went into the terminal and ran bluetoothctl per Troubleshooting instructions; the integration just kept going back and forth between initializing and this error

Puzzled,
Nathan

Screenshot_20221230-085124.png

Object of type MugFirmwareInfo is not JSON serializable

  • Home Assistant Version: 2024.1.5
  • Ember Mug Component Version: 0.9.1
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Bluetooth Dongle

Description

I have MQTT Statestream enabled in Home Assistant, and the Ember Mug Integration is causing errors each time the mug state changes because MugFirmwareInfo is not JSON serializable. I have had to temporarily exclude the mug state in the MQTT statestream config using an entity glob, this prevents the errors.

Logs / Errors

2024-02-03 18:11:12.415 INFO (MainThread) [ember_mug.mug] Subscribe to Push Events
2024-02-03 18:11:19.763 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 86, in _state_publisher
    encoded_val = json.dumps(val, cls=JSONEncoder)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/json.py", line 40, in default
    return json.JSONEncoder.default(self, o)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type MugFirmwareInfo is not JSON serializable

New ember mug does not connect

  • Home Assistant Version (eg. 2023.11): 2023.11
  • Ember Mug Component Version (eg. 0.8.0): 0.8.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Bluetooth Dongle

Description

I've been using this integration successfully for a while now. Unfortunately, my Ember Mug died, so after looking at the market I got a new one (Ember Mug 2) since this is the (only?) coffee mug that integrates with HA. (so thank you for this integration!)

Unfortunately, I can't seem to get my new mug working, after repeated tries and debugging steps.

What I Did

Starting from a restart with the ember mug not added yet, I see the newly discovered mug. I tap configure, and get to the configuration screen where I change the unit to F, and then Submit. This takes a while, and then eventually reports "Success!". However, the success dialog does not show any new devices found which differs from the expected experience.

At this point, the Ember integration is listed, but it just keeps erroring repeatedly. I've tried putting the device into pairing mode, but that doesn't help. (I don't think pairing mode should be needed since I can confirm with bluetoothctl that the device is actually paired.

Logs / Errors

First, here's some out from bluetoothctl that shows the device as paired:

➜  ~ bluetoothctl devices Paired        
Device F3:BB:7F:08:D1:EF Ember Ceramic Mug
➜  ~ bluetoothctl info f3:bb:7f:08:d1:ef
Device F3:BB:7F:08:D1:EF (random)
        Name: Ember Ceramic Mug
        Alias: Ember Ceramic Mug
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: no
        LegacyPairing: no
        UUID: Vendor specific           (00001530-1212-efde-1523-785feabcd123)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (fc543622-236c-4c94-8fa9-944a3e5353fa)

And here's logging from Home Assistant. I've trimmed the log to just keep relevant lines from Ember.

2023-11-29 08:42:43.133 DEBUG (MainThread) [bleak.backends.bluezdbus.manager] initial properties: {'/org/bluez': {'org.freedesktop.DBus.Introspectable': {}, 'org.bluez.AgentManager1': {}, 'org.bluez.ProfileManager1': {}}, '/org/bluez/hci0': {'org.freedesktop.DBus.Introspectable': {}, 'org.bluez.Adapter1': {'Address': 'C0:FB:F9:60:3C:76', 'AddressType': 'public', 'Name': 'homeassistant', 'Alias': 'homeassistant', 'Class': 7077888, 'Powered': True, 'PowerState': 'on', 'Discoverable': False, 'DiscoverableTimeout': 180, 'Pairable': False, 'PairableTimeout': 0, 'Discovering': False, 'UUIDs': ['0000110e-0000-1000-8000-00805f9b34fb', '00001200-0000-1000-8000-00805f9b34fb', '0000111f-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb', '00001108-0000-1000-8000-00805f9b34fb', '0000110c-0000-1000-8000-00805f9b34fb', '0000184f-0000-1000-8000-00805f9b34fb', '00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '00001844-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', '0000184d-0000-1000-8000-00805f9b34fb', '00001845-0000-1000-8000-00805f9b34fb', '0000110a-0000-1000-8000-00805f9b34fb'], 'Modalias': 'usb:v1D6Bp0246d0546', 'Roles': ['central', 'peripheral']}, 'org.freedesktop.DBus.Properties': {}, 'org.bluez.BatteryProviderManager1': {}, 'org.bluez.GattManager1': {}, 'org.bluez.AdvertisementMonitorManager1': {'SupportedMonitorTypes': ['or_patterns'], 'SupportedFeatures': []}, 'org.bluez.Media1': {'SupportedUUIDs': ['0000110a-0000-1000-8000-00805f9b34fb', '0000110b-0000-1000-8000-00805f9b34fb']}, 'org.bluez.NetworkServer1': {}, 'org.bluez.LEAdvertisingManager1': {'ActiveInstances': 0, 'SupportedInstances': 5, 'SupportedIncludes': ['tx-power', 'appearance', 'local-name'], 'SupportedFeatures': [], 'SupportedCapabilities': {'MaxAdvLen': 31, 'MaxScnRspLen': 31}}}, '/org/bluez/hci0/dev_F3_BB_7F_08_D1_EF': {'org.freedesktop.DBus.Introspectable': {}, 'org.bluez.Device1': {'Address': 'F3:BB:7F:08:D1:EF', 'AddressType': 'random', 'Name': 'Ember Ceramic Mug', 'Alias': 'Ember Ceramic Mug', 'Paired': True, 'Bonded': True, 'Trusted': True, 'Blocked': False, 'LegacyPairing': False, 'Connected': False, 'UUIDs': ['00001530-1212-efde-1523-785feabcd123', '00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', 'fc543622-236c-4c94-8fa9-944a3e5353fa'], 'Adapter': '/org/bluez/hci0', 'ServicesResolved': False}, 'org.freedesktop.DBus.Properties': {}}}
2023-11-29 08:42:44.962 DEBUG (MainThread) [bleak_retry_connector] Restored 1 discoveries for hci0
2023-11-29 08:42:44.967 DEBUG (MainThread) [bleak.backends.bluezdbus.advertisement_monitor] Activate
2023-11-29 08:46:20.249 DEBUG (MainThread) [ember_mug.mug] New mug connection initialized.
2023-11-29 08:46:20.249 DEBUG (MainThread) [ember_mug.mug] Registered callback: <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0xffff6b121390>>
2023-11-29 08:46:20.250 INFO (MainThread) [custom_components.ember_mug.coordinator] Ember Ceramic Mug ember-mug-f3bb7f08d1ef Setup
2023-11-29 08:46:20.250 DEBUG (MainThread) [ember_mug.mug] Registered callback: <function async_setup_entry.<locals>.<lambda> at 0xffff51430040>
2023-11-29 08:46:20.250 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Bluetooth event. Service Info: <home_assistant_bluetooth.models.BluetoothServiceInfoBleak object at 0xffff72e389c0>, change: BluetoothChange.ADVERTISEMENT
2023-11-29 08:46:20.250 DEBUG (MainThread) [ember_mug.mug] Set new device from F3:BB:7F:08:D1:EF: Ember Ceramic Mug to F3:BB:7F:08:D1:EF: Ember Ceramic Mug
2023-11-29 08:46:20.250 DEBUG (MainThread) [ember_mug.mug] Callback <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0xffff6b121390>> already registered
2023-11-29 08:46:20.251 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Updating
2023-11-29 08:46:20.251 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'firmware', 'meta'}
2023-11-29 08:46:20.251 DEBUG (MainThread) [ember_mug.mug] Establishing a new connection from mug (ID: 281472152281680) to F3:BB:7F:08:D1:EF: Ember Ceramic Mug
2023-11-29 08:46:20.251 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Connection attempt: 1
2023-11-29 08:46:20.256 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ F3:BB:7F:08:D1:EF
2023-11-29 08:46:20.280 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to BlueZ path /org/bluez/hci0/dev_F3_BB_7F_08_D1_EF
2023-11-29 08:46:40.280 DEBUG (MainThread) [bleak.backends.bluezdbus.client] _cleanup_all(/org/bluez/hci0/dev_F3_BB_7F_08_D1_EF)
2023-11-29 08:46:40.280 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Timed out trying to connect (attempt: 1, last rssi: None)
2023-11-29 08:46:40.281 DEBUG (MainThread) [bleak_retry_connector.bluez] Ember Ceramic Mug - F3:BB:7F:08:D1:EF: Waited 7.654493674635887e-05 seconds to disconnect
2023-11-29 08:46:40.532 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Connection attempt: 2
2023-11-29 08:46:40.532 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ F3:BB:7F:08:D1:EF
2023-11-29 08:46:40.535 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to BlueZ path /org/bluez/hci0/dev_F3_BB_7F_08_D1_EF
2023-11-29 08:47:00.535 DEBUG (MainThread) [bleak.backends.bluezdbus.client] _cleanup_all(/org/bluez/hci0/dev_F3_BB_7F_08_D1_EF)
2023-11-29 08:47:00.535 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Timed out trying to connect (attempt: 2, last rssi: None)
2023-11-29 08:47:00.535 DEBUG (MainThread) [bleak_retry_connector.bluez] Ember Ceramic Mug - F3:BB:7F:08:D1:EF: Waited 9.150430560112e-05 seconds to disconnect
2023-11-29 08:47:00.786 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Connection attempt: 3
2023-11-29 08:47:00.787 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ F3:BB:7F:08:D1:EF
2023-11-29 08:47:00.789 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to BlueZ path /org/bluez/hci0/dev_F3_BB_7F_08_D1_EF
2023-11-29 08:47:20.789 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Timed out trying to connect (attempt: 3, last rssi: None)
2023-11-29 08:47:20.789 DEBUG (MainThread) [bleak_retry_connector.bluez] Ember Ceramic Mug - F3:BB:7F:08:D1:EF: Waited 8.537899702787399e-05 seconds to disconnect
2023-11-29 08:47:21.041 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Connection attempt: 4
2023-11-29 08:47:21.041 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to device @ F3:BB:7F:08:D1:EF
2023-11-29 08:47:21.044 DEBUG (MainThread) [bleak.backends.bluezdbus.client] Connecting to BlueZ path /org/bluez/hci0/dev_F3_BB_7F_08_D1_EF
2023-11-29 08:47:41.044 DEBUG (MainThread) [bleak.backends.bluezdbus.client] _cleanup_all(/org/bluez/hci0/dev_F3_BB_7F_08_D1_EF)
2023-11-29 08:47:41.044 DEBUG (MainThread) [bleak_retry_connector]  (F3:BB:7F:08:D1:EF) - F3:BB:7F:08:D1:EF: Timed out trying to connect (attempt: 4, last rssi: None)
2023-11-29 08:47:41.044 DEBUG (MainThread) [bleak_retry_connector.bluez] Ember Ceramic Mug - F3:BB:7F:08:D1:EF: Waited 8.142134174704552e-05 seconds to disconnect

This issue is probably the same as some of the other issues, but I wanted to create a new issue just in case it is different. Please dupe if appropriate. Happy to provide any additional information on request. I'm just out of ideas on what to try next.

Ember integration not working in Home Assistant OS

Home Assistant Version (eg. 2023.6.2):
Ember Mug Component Version (eg. 0.7.1):
Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy):
Intel NUC built in bluetooth

Description

Describe what you were trying to get done.
Trying to install ember mug integration after moving from Ubuntu 22.04 LTS to Home Assistant OS version 10.3

What I Did

I tried re-installing the inetgration
I tried running running command bluetoth ctl from terminal
Paste the command(s) you ran and the output.

Logs / Errors

Logger: ember_mug.mug
Source: custom_components/ember_mug/coordinator.py:62
Integration: Ember Mug (documentation, issues)
First occurred: June 22, 2023 at 7:40:09 PM (855 occurrences)
Last logged: 9:24:11 AM

xxxxxx: Ember Ceramic Mug: Failed to connect to the mug: xxxxx - xxxxxx: Failed to connect:
xxxxxx: Ember Ceramic Mug: Failed to connect to the mug: xxxxxx - xxxxxx: Failed to connect: [org.bluez.Error.Failed] Operation already in progress

Light entity Not Working

  • Home Assistant Version (eg. 2023.11): 2023.12.3
  • Ember Mug Component Version (eg. 0.8.0): 0.8.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): RPi 3B+

Description

I just successfully connected to my new Ember Mug 2. I started trying the different entities provided by this integration. For the light, I’m able to change its color, but as soon as I close the light card, the light on the mug reverts back to the default color. Also, the on/off commands do not affect the light on the mug.

What I Did

See above

Logs / Errors

Let me know what you need.

Mug/Integration Setup: Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

  • Home Assistant Version (eg. 2023.2): 2023.2.5
  • Ember Mug Component Version (eg. 0.5.0): 0.5.0-beta-6 and 0.5.0-beta-9; 0.5.0-beta-5 is last working version.

Description

Attempting to pair/configure mug with HA following some changes to my Bluetooth adapter that were previously causing issues (added extension cable due to concerns over USB3 interference).

What I Did

Deleted integration for previously paired mug with connection issues prior to USB/Bluetooth changes.

Attempted to re-pair and reconfigure from discovered devices, and received the Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble error when configuring the discovered integration for the mug.

The error is accompanied by an error in the HA log related to helpers/data_entry_flow.py:44 including a traceback that I have included below.

Using HACS, I re-downloaded each 0.5.0 beta version 5-9 trying each and found that 0.5.0-beta-5 works as anticipated for the integration/configure screen, but I receive the error for 0.5.0-beta-6 and onward (thru the most recent 0.5.0-beta-9 release).

Logs / Errors

Logger: aiohttp.server
Source: helpers/data_entry_flow.py:44
First occurred: 3:28:42 PM (1 occurrences)
Last logged: 3:28:42 PM
Error handling request

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 145, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 171, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 100, in get
    result = self._prepare_result_json(result)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 184, in _prepare_result_json
    return _prepare_config_flow_result_json(result, super()._prepare_result_json)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 121, in _prepare_config_flow_result_json
    return prepare_result_json(result)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 44, in _prepare_result_json
    data["data_schema"] = voluptuous_serialize.convert(
  File "/usr/local/lib/python3.10/site-packages/voluptuous_serialize/__init__.py", line 40, in convert
    pval = convert(value, custom_serializer=custom_serializer)
  File "/usr/local/lib/python3.10/site-packages/voluptuous_serialize/__init__.py", line 113, in convert
    if issubclass(schema, Enum):
TypeError: issubclass() arg 1 must be a class

Temperature units don't change when the unit is changed

  • Home Assistant Version (eg. 2023.11): 2024.1.6
  • Ember Mug Component Version (eg. 0.8.0): 0.9.1
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Bluetooth Dongle

Description

When I change the temperature unit for a device to F, the desired and present temperature still display in C.

What I Did

Changed from C to F at 1, but the units at 2 and 3 in the below screenshot are still in C as you can see:
image

Ember Tumbler liquid level never shows 0% even when state is empty and there is indeed no liquid left

  • Home Assistant Version (eg. 2023.11): 2023.12.3
  • Ember Mug Component Version (eg. 0.8.0): 0.9.0b2
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): dongle and proxy

Description

Just observing the sensor state, I understand its a raw value from the cup however, we can see the flat lines where the cup was supposed to be at 0% but it never reaches that level. Here are some screenshots for 24 hour usage. I used the cup 2 times so it should've read 0% 3 times. My hope is that we can maybe make some sense of the jumps and what the graph should look like to see if we can "stabilize" it more?

One thing I did notice is that once the state is empty it doesnt seem to update liquid level anymore so that might be a starting place?

The number is strange too as it jumps and doesn't rest at what appears to be the lowest value, which in some cases may make more sense like earlier my cup was about 1/2 full and it registered that (eventually) then it jumped back to 100% 🙃 Maybe more research is needed here but would be curious to see what the other models do.

image

I also graphed the raw liquid level in case it helps

image

and here is the state of the tumbler

image

The cooling state is the start of the first beverage

What I Did

n/a

Logs / Errors

If possible/applicable, please enable logging, reproduce the issue and include any related errors below.
This greatly helps with debugging and is much appreciated.
(If you aren't sure how to enable it, please see the debugging section in the README)

no errors observed

Requirements for ember_mug not found: ['bleak==0.14.1']

Figured I'd try this integration again to see if it worked with the new Bluetooth integration on HA 2022.8 and it no longer starts. You get this error
Setup failed for custom integration ember_mug: Requirements for ember_mug not found: ['bleak==0.14.1'].

Unable to add Ember Mug

I'm using the latest version and the UI setup finds my ember mug. I able to complete the setup and indicates it was successful. However no entity is created. Below are the debug logs.

2022-01-15 11:01:52 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform ember_mug
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 457, in _async_add_entity
device_info = entity.device_info
File "/config/custom_components/ember_mug/sensor.py", line 69, in device_info
return self.coordinator.device_info
File "/config/custom_components/ember_mug/init.py", line 99, in device_info
name=self.data["name"],
TypeError: 'NoneType' object is not subscriptable
2022-01-15 11:01:52 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up ember_mug platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 457, in _async_add_entity
device_info = entity.device_info
File "/config/custom_components/ember_mug/sensor.py", line 69, in device_info
return self.coordinator.device_info
File "/config/custom_components/ember_mug/init.py", line 99, in device_info
name=self.data["name"],
TypeError: 'NoneType' object is not subscriptable
2022-01-15 11:01:52 ERROR (MainThread) [custom_components.ember_mug.mug] Init: [org.freedesktop.DBus.Error.NoReply] Message recipient disconnected from message bus without replying on attempt 1. waiting 30sec

HA 5 minute startup time with integration enabled and mug doesn't reconnect

Logs get flooded with this loop and HA takes really long to start up. I don't reboot HA that often, just noticed this after updating to the 2022.4 release to take advantage of some new functionality and while rebooting/testing HA startup takes a really long time with a 5 minute pause in logging entries and then the time out moving forward

ERROR (MainThread) [custom_components.ember_mug] An unexpected error occurred during loop . Restarting.
INFO (MainThread) [custom_components.ember_mug] Starting mug loop

WARNING (MainThread) [homeassistant.bootstrap] Setup timed out for bootstrap - moving forward

spelling

Hold down button on the bottom of the mug until light goes blue, then yellow anf then red

just wanted to note a typo ---- "and then red" not anf

Ability to Update Target Temp

I see in the readme that we're not able to get writing attributes to work yet, and separately that mugs can only connect to one device at a time and must be factory reset in order to connect to home assistant. So, does that mean it's completely impossible to change the target temp on a non-traveler mug? I prefer a lower temp than the default 135, but if I'm reading correctly, that's currently not possible? I'm not able to pair to HA, then add to phone to change target temp and then delete mug from phone? Nor am I able to set the target temp via HA?

Just wanted to make sure I'm understanding correctly or if there are any known workarounds for my baby mouth that likes a cooler coffee.

BleakDBusError('org.bluez.Error.Failed

Hello, just bought mug 2 and updated it to latest firmware. After this i have tried multiple times add to HA, but after HA finds it automatically, comes this error. Mug is just next to bluetooth dongle and iphone bluetooth is off ( not connected to phone same time ).

Retrying setup: An error occurred updating mug: e=BleakDBusError('org.bluez.Error.Failed', 'Operation failed with ATT error: 0x0e')

Feature request: Ability to disable/enable heating

  • Home Assistant Version (eg. 2023.11): 2024.1.6
  • Ember Mug Component Version (eg. 0.8.0): 0.9.1
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Raspi 4 integrated BT (via Docker)

Description

First of all thanks for writing this component!

I've noticed that other mug apps like Ember Supreme and https://github.com/zopieux/mugctl allow to disable/enable heating and that you've implemented cold_no_control and warm_no_control states, however there's (seemingly?) no option to disable heating in the component. I was wondering if there's already a way to do this or if that's something you were looking at implementing sometime in the future?

This could be useful for certain automations or cases where the (empty) mug randomly decides to heat itself up for no good reason (had that happen once or twice)

Thanks!

Shelly support

  • Home Assistant Version (eg. 2023.11): 2024.7.1
  • Ember Mug Component Version (eg. 0.8.0): 1.0.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Shelly Proxy

Description

I belated read this:

Ensure you have at least one Bluetooth Proxy setup with Home Assistant that supports active connections.
Currently, that only includes ESPHome proxies with firmware 2022.9.3 or later.

However, my Shelly Blue gateway usb device does support active connections, and that is how I set it up in Home Assistant. Shouldn’t it just work? Does the Ember integration need an update to support that? Seems like it should.

What I Did

I set up the Shelly to be a proxy, following the gen 2 and 3 instructions to Enable Outbound WebSocket. I set the ember to be in pairing mode, but the integration still doesn’t detect it.

Bluetooth Pairing Problems

  • Home Assistant Version (eg. 2023.2): 2023.4
  • Ember Mug Component Version (eg. 0.5.0): 0.6.1

Description

Device would not pair through this component. Nor does it want to pair with bluetoothctl. I did run a firmware update when I first got the device. I am not sure if that's why it doesn't want to work anymore.

What I Did

Paired the mug with my mobile device and updated firmware to 394/4. My Hardware version is 10
Deleted/unpaired device from my mobile device.
Put the device into pairing mode by holding the button below until the LED blinks blue.
Ran the following

$ sudo service bluetooth stop
$ sudo service bluetooth start
$ bluetoothctl power on
Changing power on succeeded
$ bluetoothctl agent on
$ bluetoothctl trust FA:15:F2:XX:XX:XX
Changing FA:15:F2:XX:XX:XX trust succeeded
$ bluetoothctl pair FA:15:F2:XX:XX:XX
Attempting to pair with FA:15:F2:XX:XX:XX
[CHG] Device FA:15:F2:XX:XX:XX Connected: yes
Failed to pair: org.bluez.Error.ConnectionAttemptFailed
$ bluetoothctl pairable on
Changing pairable on succeeded
$ bluetoothctl discoverable on
Changing discoverable on succeeded
$ bluetoothctl pair FA:15:F2:XX:XX:XX
Attempting to pair with FA:15:F2:XX:XX:XX
[CHG] Device FA:15:F2:XX:XX:XX Connected: yes
Failed to pair: org.bluez.Error.AuthenticationFailed 

Logs / Errors

I don't think it's this component's fault so not attaching any logs.

Ember Cup Compatibility

  • Home Assistant Version (eg. 2023.2): 2023.4.0
  • Ember Mug Component Version (eg. 0.5.0): 0.6.0

Description

Cup won't pair (maybe not compatible with the component?)
I'm using the Ember Cup (https://ember.com/products/ember-cup), not the mug.

What I Did

Set up as per docs. Using an ESP32 BT proxy with ESPHome.
Waited for #15 to be closed
Installed latest versions

Logs / Errors

2023-04-11 18:07:35.887 DEBUG (MainThread) [ember_mug.mug] New mug connection initialized.
2023-04-11 18:07:35.887 DEBUG (MainThread) [ember_mug.mug] Registered callback: <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f92f11b18a0>>
2023-04-11 18:07:35.887 INFO (MainThread) [custom_components.ember_mug.coordinator] Ember Mug ember-mug-f84b981f1c23 Setup
2023-04-11 18:07:35.887 DEBUG (MainThread) [ember_mug.mug] Registered callback: <function async_setup_entry.<locals>.<lambda> at 0x7f92f120f6d0>
2023-04-11 18:07:35.887 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Bluetooth event. Service Info: <home_assistant_bluetooth.models.BluetoothServiceInfoBleak object at 0x7f92f1037640>, change: BluetoothChange.ADVERTISEMENT
2023-04-11 18:07:35.887 DEBUG (MainThread) [ember_mug.mug] Set new device from F8:4B:98:1F:1C:23: Ember Cup 2 to F8:4B:98:1F:1C:23: Ember Cup 2
2023-04-11 18:07:35.887 DEBUG (MainThread) [ember_mug.mug] Callback <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f92f11b18a0>> already registered
2023-04-11 18:07:35.888 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Updating
2023-04-11 18:07:35.888 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'firmware', 'meta'}
2023-04-11 18:07:35.888 DEBUG (MainThread) [ember_mug.mug] Establishing a new connection from mug (ID: 140269087041104) to F8:4B:98:1F:1C:23: Ember Cup 2
2023-04-11 18:07:35.888 DEBUG (MainThread) [bleak_retry_connector] (F8:4B:98:1F:1C:23) - F8:4B:98:1F:1C:23: Connection attempt: 1
2023-04-11 18:07:35.937 INFO (MainThread) [ember_mug.mug] Subscribe to Push Events
2023-04-11 18:07:36.836 DEBUG (MainThread) [ember_mug.mug] Read attribute 'fc54000c-236c-4c94-8fa9-944a3e5353fa' with value 'bytearray(b'd\x00\x0c\x00b\x00')'
2023-04-11 18:07:37.642 DEBUG (MainThread) [ember_mug.mug] Read attribute 'fc54000d-236c-4c94-8fa9-944a3e5353fa' with value 'bytearray(b'\xf8K\x98\x1f\x1c#SBBG23700704')'
2023-04-11 18:07:37.643 DEBUG (MainThread) [ember_mug.mug] Firing callbacks: {<bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f92f11b18a0>>: <function EmberMug.register_callback.<locals>.unregister_callback at 0x7f92f120f760>, <function async_setup_entry.<locals>.<lambda> at 0x7f92f120f6d0>: <function EmberMug.register_callback.<locals>.unregister_callback at 0x7f92f1033640>}
2023-04-11 18:07:37.643 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Callback called in Home Assistant
2023-04-11 18:07:37.643 DEBUG (MainThread) [custom_components.ember_mug] Manually updated ember-mug-f84b981f1c23 data
2023-04-11 18:07:37.643 DEBUG (MainThread) [ember_mug.mug] Attributes updated: [Change(attr='firmware', old_value=None, new_value=MugFirmwareInfo(version=100, hardware=12, bootloader=98)), Change(attr='meta', old_value=None, new_value=MugMeta(mug_id='+EuYHxwj', serial_number='BBG23700704'))]
2023-04-11 18:07:37.643 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'target_temp', 'name', 'led_colour', 'current_temp', 'liquid_level', 'battery', 'temperature_unit', 'liquid_state'}
2023-04-11 18:07:38.053 DEBUG (MainThread) [ember_mug.mug] Read attribute 'fc540003-236c-4c94-8fa9-944a3e5353fa' with value 'bytearray(b'|\x15')'
2023-04-11 18:07:38.056 ERROR (MainThread) [custom_components.ember_mug.coordinator] An error occurred whilst updating the mug: Characteristic fc540001-236c-4c94-8fa9-944a3e5353fa was not found!

Happy to provide more details/be provided some direction in terms of debugging etc

Stuck in pair mode

So I tried to add my ember mug, After the first attempt it said "No new Ember devices were found. Please ensure it is in pairing mode." However after saying close and then trying again it doesn't even load and only comes up with the same message.

Only connects to specific ESPHome Proxy

  • Home Assistant Version (eg. 2023.11): 2024.03
  • Ember Mug Component Version (eg. 0.8.0): 1.0.0
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): ESPHome Proxy

Description

Mug becomes unavailable and is unable to connect unless using specific ESPHome Proxy.

What I Did

Attempted to add a second / replace a ESPHome Proxy, the second ESPHome Proxy attempts to connect to the Ember Mug using cache, but is unable to (ESP_GATTC_DISCONNECT_EVT, reason 62).

Powering the in the original ESPHome Proxy and removing the new proxy, the Ember Mug connects immediately.

Logs / Errors

Home Assistant Debug Log:

2024-03-11 11:39:38.613 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Updating
2024-03-11 11:39:38.613 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'target_temp', 'liquid_state', 'current_temp', 'led_colour', 'name', 'temperature_unit', 'battery', 'liquid_level'}
2024-03-11 11:39:38.613 DEBUG (MainThread) [ember_mug.mug] Establishing a new connection from mug (ID: 139927591513232) to C6:5B:55:02:F3:AC: Ember Ceramic Mug
2024-03-11 11:39:38.613 DEBUG (MainThread) [bleak_retry_connector] EMBER (C6:5B:55:02:F3:AC) - C6:5B:55:02:F3:AC: Connection attempt: 1
2024-03-11 11:39:39.293 DEBUG (MainThread) [bleak_retry_connector] EMBER (C6:5B:55:02:F3:AC) - C6:5B:55:02:F3:AC: Failed to connect: Error ESP_GATT_CONN_FAIL_ESTABLISH while connecting: Connection failed to establish, device_missing: False, backing off: 0.5 (attempt: 1, last rssi: None)
2024-03-11 11:39:39.794 DEBUG (MainThread) [bleak_retry_connector] EMBER (C6:5B:55:02:F3:AC) - C6:5B:55:02:F3:AC: Connection attempt: 2

New/Second ESPHome Device Log: (unable to connect)

[11:42:49][I][bluetooth_proxy:278]: [0] [C6:5B:55:02:F3:AC] Connecting v3 with cache
[11:42:49][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[11:42:49][I][esp32_ble_client:067]: [0] [C6:5B:55:02:F3:AC] 0x01 Attempting BLE connection
[11:42:50][D][esp32_ble_client:172]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_DISCONNECT_EVT, reason 62
[11:42:50][D][esp32_ble_tracker:266]: Starting scan...
[11:42:50][I][bluetooth_proxy:278]: [0] [C6:5B:55:02:F3:AC] Connecting v3 with cache
[11:42:50][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[11:42:51][I][esp32_ble_client:067]: [0] [C6:5B:55:02:F3:AC] 0x01 Attempting BLE connection
[11:42:51][D][esp32_ble_client:172]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_DISCONNECT_EVT, reason 62
[11:42:51][D][esp32_ble_tracker:266]: Starting scan...

Original Device Log: (reconnecting)

[11:53:36][I][bluetooth_proxy:278]: [0] [C6:5B:55:02:F3:AC] Connecting v3 with cache
[11:53:36][D][esp32_ble_tracker:215]: Pausing scan to make connection...
[11:53:36][I][esp32_ble_client:067]: [0] [C6:5B:55:02:F3:AC] 0x01 Attempting BLE connection
[11:53:36][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_CONNECT_EVT
[11:53:36][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_OPEN_EVT
[11:53:36][I][esp32_ble_client:154]: [0] [C6:5B:55:02:F3:AC] Connected
[11:53:36][D][esp32_ble_tracker:266]: Starting scan...
[11:53:37][I][esp32_ble_client:333]: [0] [C6:5B:55:02:F3:AC] auth complete. remote BD_ADDR: c65b5502f3ac
[11:53:37][D][esp32_ble_client:341]: [0] [C6:5B:55:02:F3:AC] auth success. address type = 1 auth mode = 1
[11:53:37][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_REG_FOR_NOTIFY_EVT
[11:53:39][D][esp32_ble_client:306]: [0] [C6:5B:55:02:F3:AC] Event 46
[11:53:39][D][esp32_ble_client:188]: [0] [C6:5B:55:02:F3:AC] cfg_mtu status 0, mtu 23
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_WRITE_DESCR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:39][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:40][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT
[11:53:40][D][esp32_ble_client:110]: [0] [C6:5B:55:02:F3:AC] ESP_GATTC_READ_CHAR_EVT

Feature Request: Longer unavailability timeout

My mug's data go into "unavailable" quite often, as I'm usually at the edge of my Bluetooth range with it, and the coffee maker is even further out. However, this makes automating anything based on a state change next to impossible as half the time the state change is to or from "unavailable". On my first try, it turned the coffee maker off in the middle of making a cup of coffee (unavailable->empty); on the second try, it wouldn't turn off at all as it went "Heating->unavailable->Empty".

As such, I'd request a setting to keep the state for a longer time—either a configurable timeout or a toggle to keep the cached state (as this is primarily an issue for the enumeration) even if the device goes unavailable. I'd much prefer the state update to be delayed due to bad reception over not being able to trigger from it.

The latter could even be the default; as long as there's one property that goes to "unavailable", people could still use their travel mug as a beacon.

PS: Same for "Power" to automate "Charging->Unplugged => Turn on Coffee Maker".

Edit: Note that adding more Bluetooth proxies wouldn't help me as the mug is paired to one that cannot cover my kitchen and living room. For a non-paired BLE device, this certainly would work, but sadly, not for the Ember Mug.

Bluetooth proxies are not working

Im unsure if this is an issue with the ESP proxy or with this integration

Here is the error im getting in home assistant
(C3:DF:EA:CC:38:40) - C3:DF:EA:CC:38:40 -> esp32-bluetooth-proxy-c99384: Failed to connect: No backend with an available connection slot that can reach address C3:DF:EA:CC:38:40 was found: The proxy/adapter is out of connection slots; Add additional proxies near this device Pairing is not available in ESPHome.

HA is not able to see Ember 2 mug.

Hello SopelJ, I wonder if you can shed some light on the issue I'm seeing...

I used this integration but I'm not able to connect to my Ember Mug 2. After reset, HA I see the entity "sensor.mo_s_ember_mug", but its state is unavailable. In looking in the log file, I see this error message:

   021-12-26 03:42:46 WARNING (MainThread) [custom_components.ember_mug] Failed to connect to C9:0F:59:D6:33:F9 after 10 tries. Will try again in 2min

the mac address shown in the error message is the one used in your description. I was not sure if I can use the same MAC address (I could not verify it).
(PS: as a data point, I'm able to see the mug from iphone).

(fyi, my configuration is running on a laptop with Virtual Machine running HA version 2021.12.5 ).

thank you in advance. Your help is much appreciated.

Handle state Unknown

Handle the state "Unknown'".

Originally posted by @dshokouhi in #43 (comment)

Summary:

ok finally was able to catch it, yes it shows raw state as 0

image

Is the battery low or is it charging?

everytime I have seen it, fully charged sitting on the charger just like it currently is

in fact it looks like as soon as it reported 100% it went to unknown strange.

image

Let me know if you would like more data.

Ember mug integration fails to install

  • Home Assistant Version (2024.2.1):
  • Ember Mug Component Version (0.9.1):
  • Which device(s) are you using for Bluetooth (Intel NUC built in bluetooth):

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

After I added the HACS Ember integration I tried adding the integration to home assistant and i get the error below

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Logs / Errors

Config flow could not be loaded: Unknow error

Handle offline mugs more gracefully

  • Home Assistant Version (eg. 2023.2): HA Core 2023.10.3, OS 11.0
  • Ember Mug Component Version (eg. 0.5.0): 0.7.1
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy): Have both a bluetooth dongle in HA plus 3 ESPHome BT proxies

Description

I have 2 mugs - when they are both charged, they work perfectly. But after the battery dies and the mug is no longer accessible, there are lots of log messages that fill up my home-assistant.log. The same two logs repeat approximately every 2-3 minutes. Since these are bluetooth battery powered devices, it should be expected that they occasionally go offline and the situation should not cause a flood of log messages.

In addition to the log messages, the HA Devices page will list the integration as having failed to set up. After charging the mug and reloading the integration, that message goes away.

What I Did

Allow the mug to deplete the battery. Observe log messages filling up log file.

Logs / Errors

2023-10-21 04:03:45.497 ERROR (MainThread) [ember_mug.mug] F4:71:0A:A1:6B:42: Ember Ceramic Mug: Failed to connect to the mug:  (F4:71:0A:A1:6B:42) - F4:71:0A:A1:6B:42: Failed to connect after 4 attempt(s): TimeoutError
2023-10-21 04:03:45.497 ERROR (MainThread) [custom_components.ember_mug.coordinator] An error occurred whilst updating the Ember Ceramic Mug:  (F4:71:0A:A1:6B:42) - F4:71:0A:A1:6B:42: Failed to connect after 4 attempt(s): TimeoutError

home-assistant is stuck

  • Home Assistant Version (eg. 2023.2): 2023.2.3
  • Ember Mug Component Version (eg. 0.5.0): 0.5.0

Description

It's just stuck. I made a coffee and now home assistant is dead. 100% CPU on one core. pyrasite gdb stack trace below

Logs / Errors

Stack for thread 1995599936
  File "/srv/homeassistant/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/__main__.py", line 214, in main
    exit_code = runner.run(runtime_conf)
  File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/runner.py", line 128, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1906, in _run_once
    handle._run()
  File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/srv/homeassistant/lib/python3.10/site-packages/dbus_fast/aio/message_reader.py", line 28, in _message_reader
    process(message)
  File "/srv/homeassistant/lib/python3.10/site-packages/dbus_fast/message_bus.py", line 853, in _process_message
    return
  File "/srv/homeassistant/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 858, in _parse_msg
    for device_path, _, on_value_changed in self._device_watchers:
  File "/srv/homeassistant/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 152, in on_value_changed
    callback(bytearray(value))
  File "/srv/homeassistant/lib/python3.10/site-packages/ember_mug/connection.py", line 345, in _notify_callback
    return

can't pair mug, .4 beta 5

Discovery worked the first time, even after uninstall/re-install/re-paring still getting this
Retrying setup: An error occurred updating mug: e=BleakDBusError('org.bluez.Error.Failed', 'Operation failed with ATT error: 0x0e')

General Mug Use Guide?

  • Home Assistant Version: 2023.3
  • Ember Mug Component Version: 0.5.0-beta-5

Not as much of a technical question here. What is the proper workflow for using the mug?
As in, how to turn it off? When to charge etc.

I have had my mug for a few weeks and used it every day, and I still, fail to understand the correct way to use the mug.

I have tried putting the charger on the kitchen counter and charging it after it's washed, but I find the battery doesn't last long enough to finish my coffee at my desk.

So I thought I would put the charger on my desk so I could charge it during and after I am done drinking. This resulted in the mug not turning off and even the few drops of coffee at the bottom of my mug roasting and roasting until it's baked in. Multiple times I would pick it up and hold down the power button so that the lights would go black but it would wake right back up when I set it back onto the charger.

Speaking of lights I have noticed many light patterns.

Green (My set light color) Means the mug is on?
Pulsing White: cooling?
Pulsing red: charging?

Holding the power down:
3 seconds black: Off?
5 seconds pulsing blue: pairing mode?
10 seconds blinking yellow: ??
15 seconds blinking red: factory reset?

I am sorry if I am being an idiot and missing something. But I have had what feels like super inconsistent results using the mug. Sometimes not heat at all, and sometimes not stop heating.

I was hoping someone could walk me through their process.

Like do you power it on before you pour in your drink?
Do you keep it on the charger while drinking?
How do you stop it from heating?
(I noticed in the app there was a setting to stop heating, I have not found that in the HASS integration.)
When do you charge it back up?

HA "sees" Ember mug, but the integration fails to connect to it.

  • Home Assistant Version (eg. 2023.11): 2024.2.1
  • Ember Mug Component Version (eg. 0.8.0):
  • Which device(s) are you using for Bluetooth (e.g. Bluetooth Dongle / ESPHome Proxy):ESPHome Proxy

Description

After setting up the mug, the integration fails to start/connect to the mug.

What I Did

I have installed the integration from HACS, put the mug in a pairing mode, went to devices, chosen the integration, the integration setup window detected my mug's MAC address and i have added that mug to HA.

Logs / Errors

If possible/applicable, please enable logging, reproduce the issue and include any related errors below.
This greatly helps with debugging and is much appreciated.
(If you aren't sure how to enable it, please see the debugging section in the README)

2024-02-14 10:28:02.818 DEBUG (MainThread) [ember_mug.mug] C6:12:2D:4C:FA:9B: Ember Ceramic Mug: Failed to connect to the mug: (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Failed to connect after 9 attempt(s): Timeout waiting for connect response while connecting to C6:12:2D:4C:FA:9B after 20.0s, disconnect timed out: False, after 20.0s
2024-02-14 10:28:02.818 DEBUG (MainThread) [custom_components.ember_mug.coordinator] An error occurred trying to update the mug: (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Failed to connect after 9 attempt(s): Timeout waiting for connect response while connecting to C6:12:2D:4C:FA:9B after 20.0s, disconnect timed out: False, after 20.0s
2024-02-14 10:28:02.819 DEBUG (MainThread) [ember_mug.mug] Unregistered callback: <function async_setup_entry.<locals>.<lambda> at 0x7f7a3f8a85e0>
2024-02-14 10:28:15.359 WARNING (MainThread) [homeassistant.components.rest.util] JSON result was not a dictionary or list with 0th element a dictionary
2024-02-14 10:28:17.342 WARNING (SyncWorker_50) [custom_components.openmediavault.omv_api] OpenMediaVault 10.10.1.13:81 unable to fetch data (500)
2024-02-14 10:28:17.705 ERROR (Thread-4 (RunDocker)) [custom_components.monitor_docker] Failed Docker connect: DockerError(900, "Cannot connect to Docker Engine via tcp://10.10.1.13:2375 [Cannot connect to host 10.10.1.13:2375 ssl:default [Connect call failed ('10.10.1.13', 2375)]]")
2024-02-14 10:28:17.705 ERROR (Thread-4 (RunDocker)) [custom_components.monitor_docker] Retry in 60 seconds
2024-02-14 10:28:19.826 ERROR (SyncWorker_45) [homeassistant] Error doing job: Unclosed client session
2024-02-14 10:28:45.442 WARNING (MainThread) [homeassistant.components.rest.util] JSON result was not a dictionary or list with 0th element a dictionary
2024-02-14 10:28:58.447 ERROR (MainThread) [pynintendoparental] Error updating device 5cedcb8660c73fd5: list index out of range
2024-02-14 10:28:58.447 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1047, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 995, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 549, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/nintendo_parental/sensor.py", line 44, in native_value
return self._device.limit_time - (
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
2024-02-14 10:29:10.144 WARNING (MainThread) [androidtv.adb_manager.adb_manager_async] Couldn't connect to 10.10.25.92:5555. TcpTimeoutException: Connecting to 10.10.25.92:5555 timed out (1.0 seconds)
2024-02-14 10:29:13.956 WARNING (MainThread) [aioesphomeapi.connection] bt-proxy-masterbedroom @ 10.10.10.185: Connection error occurred: [Errno 104] Connection reset by peer
2024-02-14 10:29:22.906 DEBUG (MainThread) [custom_components.ember_mug] Integration setup. Last service info: Device: C6:12:2D:4C:FA:9B: Ember Ceramic Mug, Manufacturer Data: {961: b'\xc1'}
2024-02-14 10:29:22.907 DEBUG (MainThread) [ember_mug.mug] New mug connection initialized.
2024-02-14 10:29:22.907 DEBUG (MainThread) [ember_mug.mug] Registered callback: <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f7a768555e0>>
2024-02-14 10:29:22.907 INFO (MainThread) [custom_components.ember_mug.coordinator] CM19P/CM21L ember-mug-c6122d4cfa9b Setup
2024-02-14 10:29:22.907 DEBUG (MainThread) [ember_mug.mug] Registered callback: <function async_setup_entry.<locals>.<lambda> at 0x7f7a3f8ab7e0>
2024-02-14 10:29:22.907 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Bluetooth event. Service Info: <habluetooth.models.BluetoothServiceInfoBleak object at 0x7f7a2b8c68c0>, change: BluetoothChange.ADVERTISEMENT
2024-02-14 10:29:22.921 DEBUG (MainThread) [ember_mug.mug] Set new device from C6:12:2D:4C:FA:9B: Ember Ceramic Mug to C6:12:2D:4C:FA:9B: Ember Ceramic Mug
2024-02-14 10:29:22.921 DEBUG (MainThread) [ember_mug.mug] Callback <bound method MugDataUpdateCoordinator._async_handle_callback of <custom_components.ember_mug.coordinator.MugDataUpdateCoordinator object at 0x7f7a768555e0>> already registered
2024-02-14 10:29:22.921 DEBUG (MainThread) [custom_components.ember_mug.coordinator] Updating
2024-02-14 10:29:22.921 DEBUG (MainThread) [ember_mug.mug] Updating the following attributes: {'firmware', 'udsk', 'meta', 'date_time_zone', 'dsk'}
2024-02-14 10:29:22.922 DEBUG (MainThread) [ember_mug.mug] Establishing a new connection from mug (ID: 140163951182480) to C6:12:2D:4C:FA:9B: Ember Ceramic Mug
2024-02-14 10:29:22.922 DEBUG (MainThread) [bleak_retry_connector] (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Connection attempt: 1
2024-02-14 10:29:28.305 ERROR (MainThread) [homeassistant] Error doing job: Unclosed client session
2024-02-14 10:29:45.442 WARNING (MainThread) [homeassistant.components.rest.util] JSON result was not a dictionary or list with 0th element a dictionary
2024-02-14 10:29:46.773 DEBUG (MainThread) [bleak_retry_connector] (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Timed out trying to connect (attempt: 1, last rssi: None)
2024-02-14 10:29:47.025 DEBUG (MainThread) [bleak_retry_connector] (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Connection attempt: 2
2024-02-14 10:29:58.320 ERROR (MainThread) [pynintendoparental] Error updating device 5cedcb8660c73fd5: list index out of range
2024-02-14 10:29:58.321 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _handle_refresh_interval
await self._async_refresh(log_failures=True, scheduled=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 412, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1047, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 995, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 549, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/nintendo_parental/sensor.py", line 44, in native_value
return self._device.limit_time - (
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
2024-02-14 10:30:00.813 DEBUG (MainThread) [bleak_retry_connector] (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Failed to connect: Error ESP_GATT_CONN_FAIL_ESTABLISH while connecting: Connection failed to establish, device_missing: False, backing off: 0.5 (attempt: 2, last rssi: None)
2024-02-14 10:30:01.318 DEBUG (MainThread) [bleak_retry_connector] (C6:12:2D:4C:FA:9B) - C6:12:2D:4C:FA:9B: Connection attempt: 3
2024-02-14 10:30:13.961 WARNING (MainThread) [aioesphomeapi.connection] bt-proxy-masterbedroom @ 10.10.10.185: Connection error occurred: [Errno 104] Connection reset by peer

BleakDBusError('org.bluez.Error.NotPermitted', 'Not paired')

Getting the following error during setup with a supported BT adapter that worked for at least one other device successfully. The adapter is a Plugable USB-BT4LE (BCM20702A0).

Retrying setup: An error occurred updating mug: e=BleakDBusError('org.bluez.Error.NotPermitted', 'Not paired')

ember_mug

Things I've tried (besides the normal setup instructions in the README):

  • Restart Home Assistant
  • Restart the host
  • Enter/exit pairing mode on the mug at different times during setup
  • Reinstalled the integration
  • Hard reset the mug

Since I was able to pair another device and set it up fully, I have a feeling this is specific to either this integration, or some characteristic of the mug itself as a bluetooth device which makes it different from others...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.