zweckj / lamarzocco Goto Github PK
View Code? Open in Web Editor NEWInteract with your La Marzocco espresso machine
Interact with your La Marzocco espresso machine
A warning is being logged: Could not find bluetooth device.Bluetooth commands will not be availableand commands will all be sent through cloud
It is unclear to me whether the integration is unable to find a connected bluetooth device to use at all, or whether the machine cannot be found using HA bluetooth. There is a bluetooth device connected to HA.
Full logs for lmcloud.lmcloud
:
2024-04-12 09:43:38.602 WARNING (MainThread) [lmcloud.lmcloud] Could not find bluetooth device.Bluetooth commands will not be availableand commands will all be sent through cloud
2024-04-12 09:43:38.603 DEBUG (MainThread) [lmcloud.lmcloud] Full error: Couldn't find a machine
2024-04-12 09:43:38.605 DEBUG (MainThread) [lmcloud.lmcloud] Getting config from local API
2024-04-12 09:43:39.468 DEBUG (MainThread) [lmcloud.lmcloud] Received data from websocket, property updated: machineConfiguration with value:
{
version: "v1",
preinfusionModesAvailable: ["ByDoseType"],
machineCapabilities: [
{
family: "LINEA",
groupsNumber: 1,
coffeeBoilersNumber: 1,
hasCupWarmer: False,
steamBoilersNumber: 1,
teaDosesNumber: 1,
machineModes: ["BrewingMode", "StandBy"],
schedulingType: "smartWakeUpSleep",
},
],
machine_sn: "Snxxxxxxxxxx",
machine_hw: "0",
isPlumbedIn: False,
isBackFlushEnabled: False,
standByTime: 0,
tankStatus: True,
settings: [],
recipes: [
{
id: "Recipe1",
dose_mode: "Mass",
recipe_doses: [
{ id: "A", target: 32 },
{ id: "B", target: 42 },
],
},
],
recipeAssignment: [
{
dose_index: "DoseA",
recipe_id: "Recipe1",
recipe_dose: "A",
group: "Group1",
},
],
groupCapabilities: [
{
capabilities: {
groupType: "AV_Group",
groupNumber: "Group1",
boilerId: "CoffeeBoiler1",
hasScale: False,
hasFlowmeter: False,
numberOfDoses: 0,
},
doses: [],
doseMode: { groupNumber: "Group1", brewingType: "ManualType" },
},
],
machineMode: "BrewingMode",
teaDoses: { DoseA: { doseIndex: "DoseA", stopTarget: 0 } },
scale: { connected: False, address: "", name: "", battery: 0 },
boilers: [
{ id: "SteamBoiler", isEnabled: True, target: 0, current: 0 },
{
id: "CoffeeBoiler1",
isEnabled: True,
target: 91.0999984741211,
current: 90,
},
],
boilerTargetTemperature: { SteamBoiler: 0, CoffeeBoiler1: 91.0999984741211 },
preinfusionMode: {
Group1: {
groupNumber: "Group1",
preinfusionStyle: "PreinfusionByDoseType",
},
},
preinfusionSettings: {
mode: "Enabled",
Group1: [
{
groupNumber: "Group1",
doseType: "DoseA",
preWetTime: 2,
preWetHoldTime: 3,
},
],
},
wakeUpSleepEntries: [
{
id: "fvWnpDF",
days: [
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday",
],
steam: True,
enabled: True,
timeOn: "5:0",
timeOff: "12:0",
},
],
smartStandBy: { mode: "PowerOn", minutes: 10, enabled: False },
clock: "2024-04-12T09:44:15",
firmwareVersions: [
{ name: "machine_firmware", fw_version: "2.12" },
{ name: "gateway_firmware", fw_version: "v3.4-rc5" },
],
}
2024-04-12 09:43:39.469 DEBUG (MainThread) [lmcloud.lmcloud] Calling callback function
2024-04-12 09:43:39.489 DEBUG (MainThread) [lmcloud.lmcloud] Getting statistics from cloud
2024-04-12 09:44:10.254 DEBUG (MainThread) [lmcloud.lmcloud] Getting config from local API
2024-04-12 09:45:43.418 DEBUG (MainThread) [lmcloud.lmcloud] Getting statistics from cloud
2024-04-12 09:46:13.254 DEBUG (MainThread) [lmcloud.lmcloud] Getting config from local API
2024-04-12 09:46:13.612 DEBUG (MainThread) [lmcloud.lmcloud] Getting statistics from cloud
2024-04-12 09:46:44.256 DEBUG (MainThread) [lmcloud.lmcloud] Getting config from local API
2024-04-12 09:46:44.466 DEBUG (MainThread) [lmcloud.lmcloud] Getting statistics from cloud
It seems that the steam and coffee temp sensors stopped working for my Linea Micra. Using latest. Is it a known issue?
Hi
thank you profusely for creating and maintining this integration
I am experiencing issues running this integration on a RPI5 with:
Core
2024.1.0.dev20231218
Supervisor
2024.01.0.dev1902
Operating System
11.3.dev20231212
Frontend
20231218.0.dev
I have installed the integration and configured it, and no entities have appeared (LaMarz.jpg)
I have deleted and reinstalled the integration after rebooting and have not ever seen any entities appear
The log outlines "ValueError: Config entry was never loaded!"
The integration is "configured successfully" and is "Device is already configured" when trying to re-add the account /machine (LaMarz2.jpg)
I have attached a few screenshots and the error log
Any info would be greatly appreciated.
Using the integration with Raspberry PI 4 and HA for my Micra since Sunday. The integration didn't work reliable and I couldn't figure it out until i checked the logs and saw the stacktrace. At first I only saw timeouts. Upon checking the stack trace I noticed it failed initializing the bleak client.
Since the Raspberry PI is in the basement i disabled the BT device. Since then if worked reliably for me.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 209, in connect
reply = await self._bus.call(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/dbus_fast/aio/message_bus.py", line 399, in call
await future
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/lamarzocco/services.py", line 35, in call_service
await func(*args, **kwargs)
File "/config/custom_components/lamarzocco/lm_client.py", line 96, in set_power
await self.get_hass_bt_client()
File "/config/custom_components/lamarzocco/lm_client.py", line 172, in get_hass_bt_client
await self._lm_bluetooth.new_bleak_client_from_ble_device(ble_device)
File "/usr/local/lib/python3.11/site-packages/lmcloud/lmbluetooth.py", line 104, in new_bleak_client_from_ble_device
await self._client.connect()
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 292, in connect
connected = await super().connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bleak/__init__.py", line 605, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 146, in connect
async with async_timeout(timeout):
File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 876, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/config/custom_components/lamarzocco/switch.py", line 143, in async_turn_off
await call_service(
File "/config/custom_components/lamarzocco/services.py", line 38, in call_service
raise HomeAssistantError(ex) from ex
homeassistant.exceptions.HomeAssistantError
Hi,
This is probably more of a HA issue, but I'm not sure where to start...
I was using your integration in version 0.11 (ish) since some months without problems for our GS3 AV.
Now I made the fatal mistake of upgrading the integration to the last version, and all my entities got disconnected and I can't make them reappear in HA :-(
I think I still have connection to the machine, as the "download diagnostics" show all the proper data from the machine. I tried to delete and reconnect the machine, which succeeds but still no entities are being created.
Does anyone have an idea? What info should I provide for this to be helpful?
HA tells me this for my entities:
2023-11-20 12:40:57.390 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform lamarzocco.binary_sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/
usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
2023-11-20 12:40:57.705 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform lamarzocco.button: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src
/homeassistant/homeassistant/helpers/device_registry.py)).
2023-11-20 12:40:57.955 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform lamarzocco.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src
/homeassistant/homeassistant/helpers/device_registry.py)).
2023-11-20 12:40:58.024 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform lamarzocco.switch: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src
/homeassistant/homeassistant/helpers/device_registry.py)).
2023-11-20 12:40:58.100 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform lamarzocco.update: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src
/homeassistant/homeassistant/helpers/device_registry.py)).
The entities associated with the La Marzocco integration are unavailable after upgrade to 2024.1.0 . Deleting and re-adding the device recreates the device without any entities.
Instructions say to go to Configuration -> Integrations, neither of which things exist whatsoever, there is no mention of either of these words anywhere in the web interface
Furthermore once it's installed, you click the plugin in the list, and all it does is open up a useless WIKI page with out of date instructions that do not apply.
How do you even access the part where you enter login and password?
This makes quite literally zero sense whatsoever - none of these sections even exist in my Home Assistant, see for yourself:
Please show me how to navigate to Configuration -> Integrations because these words do not even exist in my interface.
And clicking the La Marzocco entry only opens up a WIKI page, there's no configuration options or screen to be found
Man I hate open source sometimes
Beta 5 residual issue having used for a few days and been a bit confused! Did some testing and digging and discovered:
When you use an automation to call a service to switch the machine on as a DEVICE instead of just turning on the Main On/Off control entity, it also turns on the Auto On/Off control entity and the Steam Boiler enable control entity. Similarly when you use an automation to call a service to switch off the machine as a DEVICE it turns all three control entities off.
The issue with that is if you have turned the machine off with that automation and then use an entity button or entity automation that specifically calls the Main On/Off control entity, your steam boiler enable remains turned off and doesn't heat up. Confused the hell out of me!! Similarly if you turn the machine off manually or by an entity switch, then it leaves the auto on/off enabled and it then starts doing its own thing per the auto schedule. Given it was Halloween I thought I had a ghost in my machine!!
Obviously can workaround by ensuring any automations call the Main on/off entity but assume you will want to fix if possible so the calling of the DEVICE to turn on by HA links only to the Main on/off entity, not to all three entities that have an on/off function.
Thank you!
Hi there, edge case for sure...
I have 2 Lineas (one Mini and one Micra) in 2 different places, each place running their own instance of Home Assistant. In Place 1, the Mini gets discovered just fine and works well with its Home Assistant instance.
On the second place, the second Home Assistant install only detects the Mini again, even though I provided the IP of the Micra. And it tracks how the Mini is, instead of the Micra.
Help? Tips?
As well a multiple machines support for a Pico would be nice as well :)
Just started getting the below error message, I did update gateway version, not sure if related or not though.
Machine: Linea Mini
Gateway: v3.2-RC9
Firmware: 2.12
Logger: homeassistant.setup
Source: setup.py:185
First occurred: 15:57:32 (1 occurrences)
Last logged: 15:57:32
Setup failed for custom integration lamarzocco: Requirements for lamarzocco not found: ['lmcloud==4.0.2b2'].
I am getting this error after upgrading to the latest alpha (3).
Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble
In logs I see;
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:403
First occurred: 07:56:20 (2 occurrences)
Last logged: 07:57:17
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/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 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, 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/headers.py", line 31, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 147, in post
return await super().post(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 71, in post
result = await self._flow_mgr.async_init(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 872, in async_init
flow, result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 890, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 992, in async_create_flow
handler = await _async_get_flow_handler(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2088, in _async_get_flow_handler
await _load_integration(hass, domain, hass_config)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2064, in _load_integration
await async_process_deps_reqs(hass, hass_config, integration)
File "/usr/src/homeassistant/homeassistant/setup.py", line 420, in async_process_deps_reqs
await requirements.async_get_integration_with_requirements(
File "/usr/src/homeassistant/homeassistant/requirements.py", line 52, in async_get_integration_with_requirements
return await manager.async_get_integration_with_requirements(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/requirements.py", line 171, in async_get_integration_with_requirements
await self._async_process_integration(integration, done)
File "/usr/src/homeassistant/homeassistant/requirements.py", line 186, in _async_process_integration
await self.async_process_requirements(
File "/usr/src/homeassistant/homeassistant/requirements.py", line 245, in async_process_requirements
self._raise_for_failed_requirements(name, missing)
File "/usr/src/homeassistant/homeassistant/requirements.py", line 274, in _raise_for_failed_requirements
raise RequirementsNotFound(integration, [req])
homeassistant.requirements.RequirementsNotFound: Requirements for lamarzocco not found: ['lmcloud==4.0.2b2'].
Disconnected. Deleted and reinstalled integration. Finds the coffee machine but then when loading says Failed Setup. Checked LM cloud details are correct. Tried with both sets of client /secret details. Same error.
Log notes:
Logger: homeassistant.config_entries
Source: config_entries.py:441
First occurred: 12:50:38 (2 occurrences)
Last logged: 12:52:10
Config entry 'GS3 Coffee Machine' for lamarzocco integration not ready yet: ('Querying API failed. Error: %s', TimeoutError()); Retrying in background
Installed the latest HA core beta and have run into the issues with this CC.
Not sure if it is related to what is mentioned at the bottom of this page?
https://rc.home-assistant.io/blog/2023/12/27/release-20241/
Logger: homeassistant.setup
Source: setup.py:403
First occurred: 09:01:34 (6 occurrences)
Last logged: 09:01:34
Unable to prepare setup for platform 'lamarzocco.button': Platform not found (Exception importing custom_components.lamarzocco.button).
Unable to prepare setup for platform 'lamarzocco.sensor': Platform not found (Exception importing custom_components.lamarzocco.sensor).
Unable to prepare setup for platform 'lamarzocco.switch': Platform not found (Exception importing custom_components.lamarzocco.switch).
Logger: homeassistant.loader
Source: loader.py:842
First occurred: 09:01:34 (6 occurrences)
Last logged: 09:01:34
Unexpected exception importing platform custom_components.lamarzocco.button
Unexpected exception importing platform custom_components.lamarzocco.sensor
Unexpected exception importing platform custom_components.lamarzocco.switch
Unexpected exception importing platform custom_components.lamarzocco.update
Unexpected exception importing platform custom_components.lamarzocco.water_heater
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/lamarzocco/binary_sensor.py", line 28, in
@DataClass
^^^^^^^^^
File "/usr/local/lib/python3.11/dataclasses.py", line 1230, in dataclass
return wrap(cls)
^^^^^^^^^
File "/usr/local/lib/python3.11/dataclasses.py", line 1220, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dataclasses.py", line 1027, in _process_class
_init_fn(all_init_fields,
File "/usr/local/lib/python3.11/dataclasses.py", line 545, in _init_fn
raise TypeError(f'non-default argument {f.name!r} '
TypeError: non-default argument 'extra_attributes' follows default argument
Unable to prepare setup for platform 'lamarzocco.update': Platform not found (Exception importing custom_components.lamarzocco.update).
Unable to prepare setup for platform 'lamarzocco.water_heater': Platform not found (Exception importing custom_components.lamarzocco.water_heater).
Hi zweckj,
do you think it can be possible to detect bbw? add buttons to select 1 dose, 2 doses and normal mode when you have brew by weigth activated? maybe dose definition too?
I can help by capturing wifi frames if needed.
regards
Hi, I tried to install your fork on HA, current stable docker version is Home Assistant 2023.3.5.
When I launch the integration it fails to load the service with this error message in the logs:
Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 09:29:53 (3 occurrences)
Last logged: 09:30:01
Unable to install package lmcloud==0.3.35: ERROR: Cannot install lmcloud==0.3.35 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts [notice] A new release of pip is available: 23.0 -> 23.2.1 [notice] To update, run: pip install --upgrade pip
There is no minimum HA version defined in your setup procedure so I assume the current stable docker version is not ok. What can I do as I cannot modify docker image?
@zweckj It seems the latest ios App, gateway and/or machine firmware has added some new features which has broken the implementation.
Machine: Linea Mini (OG version)
Gateway: v3.4-RC5
Machine Firmware: 2.12
2024-03-20 13:35:32.829 DEBUG (MainThread) [custom_components.lamarzocco.coordinator] Finished fetching lamarzocco data in 0.103 seconds (success: False)
2024-03-20 13:35:38.132 DEBUG (MainThread) [custom_components.lamarzocco.coordinator] Initializing local API
2024-03-20 13:35:38.132 DEBUG (MainThread) [custom_components.lamarzocco.coordinator] Init WebSocket in background task
2024-03-20 13:35:38.345 ERROR (MainThread) [custom_components.lamarzocco.coordinator] Unexpected error fetching lamarzocco data: 'weeklySchedulingConfig'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 318, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/lamarzocco/coordinator.py", line 107, in _async_update_data
await self._async_handle_request(self.device.get_config)
File "/config/custom_components/lamarzocco/coordinator.py", line 129, in _async_handle_request
await func()
File "/usr/local/lib/python3.12/site-packages/lmcloud/lm_device.py", line 119, in get_config
self.parse_config(raw_config)
File "/usr/local/lib/python3.12/site-packages/lmcloud/lm_machine.py", line 137, in parse_config
raw_config["weeklySchedulingConfig"]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'weeklySchedulingConfig'
2024-03-20 13:35:38.351 DEBUG (MainThread) [custom_components.lamarzocco.coordinator] Finished fetching lamarzocco data in 0.218 seconds (success: False)
Update: On reading logs properly, this is an issue with the lmcloud
repo, not this one but issue remains.
Every so often, the LM servers seem to go offline temporarily and recover after a while. When this happens, the integration starts throwing cascading exceptions that flood the HA log. Here's an example:
2024-01-04 01:22:23.552 ERROR (MainThread) [custom_components.lamarzocco.coordinator] Unexpected error fetching lamarzocco data:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 133, in _call_sslobject_method
result = func(*args)
^^^^^^^^^^^
File "/usr/local/lib/python3.11/ssl.py", line 921, in read
v = self._sslobj.read(len)
^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2580)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/anyio/_core/_tasks.py", line 115, in fail_after
yield cancel_scope
File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 34, in read
return await self._stream.receive(max_bytes=max_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 198, in receive
data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/streams/tls.py", line 140, in _call_sslobject_method
data = await self.transport_stream.receive()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1095, in receive
await self._protocol.read_event.wait()
File "/usr/local/lib/python3.11/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f58bfe2cd90
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 32, in read
with anyio.fail_after(timeout):
File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.11/site-packages/anyio/_core/_tasks.py", line 118, in fail_after
raise TimeoutError
TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 67, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 371, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 268, in handle_async_request
raise exc
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 251, in handle_async_request
response = await connection.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 103, in handle_async_request
return await self._connection.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 133, in handle_async_request
raise exc
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 111, in handle_async_request
) = await self._receive_response_headers(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 176, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/http11.py", line 212, in _receive_event
data = await self._network_stream.read(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 31, in read
with map_exceptions(exc_map):
File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.11/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/lamarzocco/coordinator.py", line 37, in _async_update_data
await self._lm.update_machine_status()
File "/config/custom_components/lamarzocco/lm_client.py", line 94, in update_machine_status
await self.update_local_machine_status(force_update=True)
File "/usr/local/lib/python3.11/site-packages/lmcloud/lmcloud.py", line 533, in update_local_machine_status
await self._update_statistics_obj(force_update=force_update)
File "/usr/local/lib/python3.11/site-packages/lmcloud/lmcloud.py", line 559, in _update_statistics_obj
self._statistics = await self.get_statistics()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/lmcloud/lmcloud.py", line 543, in get_statistics
statistics = await self._rest_api_call(url=url, verb="GET")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/lmcloud/lmcloud.py", line 573, in _rest_api_call
response = await self.client.get(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1786, in get
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/authlib/integrations/httpx_client/oauth2_client.py", line 90, in request
return await super().request(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1559, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1646, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1674, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1711, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1748, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 370, in handle_async_request
with map_httpcore_exceptions():
File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 84, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout
2024-01-04 01:22:56.785 INFO (MainThread) [custom_components.lamarzocco.coordinator] Fetching lamarzocco data recovered
Note that it does recover afterward, but it creates a lot of logging because (I think) the timeout exception isn't being caught. Can this be handled more gracefully?
Started seeing this error today after I upgraded to core preview. Tried downgrading subsequently but that didn't seem to help either.
Logger: homeassistant.components.lamarzocco.coordinator
Source: helpers/update_coordinator.py:313
Integration: La Marzocco (documentation, issues)
First occurred: 10:50:53 PM (3 occurrences)
Last logged: 10:51:03 PM
Unexpected error fetching lamarzocco data: 'machine'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/lamarzocco/coordinator.py", line 43, in _async_update_data
await self._async_init_client()
File "/usr/src/homeassistant/homeassistant/components/lamarzocco/coordinator.py", line 59, in _async_init_client
machine_serial=self.config_entry.data[CONF_MACHINE],
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'machine'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.