The log, not the logbook. Configuration->Settings->Logs
Well, now you know the experience level you are dealing with!!
Error handling request
2:15:23 PM – (ERROR) La Marzocco (custom integration) - message first occurred at 1:49:51 PM and shows up 2 times
Detected integration that accessed discovery_info[‘properties’] instead of discovery_info.properties; this will fail in version 2022.6. Please report issue to the custom component author for lamarzocco using this method at custom_components/lamarzocco/config_flow.py, line 102: raw = discovery_info[“properties”]["_raw"]
1:48:26 PM – (WARNING) helpers/frame.py
Ended unfinished session (id=8 from 2022-01-29 18:14:52.248210)
1:48:06 PM – (WARNING) Recorder
The system could not validate that the sqlite3 database at //config/home-assistant_v2.db was shutdown cleanly
1:48:05 PM – (WARNING) Recorder
I know about that one, and it won’t cause the failure you’re describing. There should be more there, but I just recommend checking your credentials.
Sorry, credentials as in Username and Password in the La Marzocco dialog box, right? Yes, I was careful in typing in my Username and Password for HA. Just to be sure, I logged out of HA and logged back in with my user name and password.
The credentials when configuring the integration. Without additional logs, there’s not much more I can do. Have you used the official app to register your machine? Does that work?
Sorry, is this the additional logs info:
2022-01-29 19:49:26 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/lmdirect/connection.py”, line 90, in retrieve_machine_info
await client.fetch_token(
File “/usr/local/lib/python3.9/site-packages/authlib/integrations/httpx_client/oauth2_client.py”, line 131, in _fetch_token
return self.parse_response_token(resp.json())
File “/usr/local/lib/python3.9/site-packages/authlib/oauth2/client.py”, line 380, in parse_response_token
self.handle_error(error, description)
File “/usr/local/lib/python3.9/site-packages/authlib/integrations/httpx_client/oauth2_client.py”, line 80, in handle_error
raise OAuthError(error_type, error_description)
authlib.integrations.base_client.errors.OAuthError: invalid_grant: Invalid username and password combination
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/lmdirect/connection.py”, line 156, in _connect
self._machine_info = await self.retrieve_machine_info(
File “/usr/local/lib/python3.9/site-packages/lmdirect/connection.py”, line 97, in retrieve_machine_info
raise AuthFail(“Authorization failure”) from err
lmdirect.connection.AuthFail: Authorization failure
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/config/custom_components/lamarzocco/config_flow.py”, line 44, in validate_input
machine_info = await lm.connect()
File “/usr/local/lib/python3.9/site-packages/lmdirect/init.py”, line 123, in connect
return await self._connect()
File “/usr/local/lib/python3.9/site-packages/lmdirect/connection.py”, line 160, in _connect
raise ConnectionFail(
lmdirect.connection.ConnectionFail: Exception retrieving machine info: Authorization failure
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py”, line 435, in _handle_request
resp = await request_handler(request)
File “/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.9/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 98, 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 78, in ban_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 181, in auth_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 137, in handle
result = await result
File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 157, in post
return await super().post(request, flow_id)
File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File “/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py”, line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 252, in async_configure
result = await self._async_handle_step(flow, cur_step[“step_id”], user_input)
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 325, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File “/config/custom_components/lamarzocco/config_flow.py”, line 135, in async_step_confirm
return await self._try_create_entry(data)
File “/config/custom_components/lamarzocco/config_flow.py”, line 67, in _try_create_entry
machine_info = await validate_input(self.hass, data)
File “/config/custom_components/lamarzocco/config_flow.py”, line 50, in validate_input
except LaMarzocco.AuthFail:
AttributeError: type object ‘LaMarzocco’ has no attribute ‘AuthFail’
Seems clear enough:
authlib.integrations.base_client.errors.OAuthError: invalid_grant: Invalid username and password combination
One last question I hope. How do I delete the La Marzocco integration in HA so I can start over? Thanks again for your time!
Same as with any integration:
But if it was never set up correctly, then it’s not there to delete and nothing to clean up. Removing the code via HACS or whatever method you used won’t help here.
Hi, still trying here. I reinstalled Home Assistant, installed and configured HACS. Found and downloaded the La Marzocco integration. Entered Client ID and Client Secret, Username and Password, same error of invalid username and password.
My question is: which username and password? Home Assistant, or GitHub?
Thanks again for your time.
Your La Marzocco account. Sign up using the official app.
Yup, that did it! It successfully installed, now I will have to see what I can do! Thanks again.
For those who don’t have their machine plumbed in and constantly forget to fill the water until they run out 1/2 way through a brew… I’ve got an automation to share to remind you to fill the water tank. There might be more elegant ways to do this but here it goes:
Here is the coffee counter since tank was last filled. I also show this value on my HA card too:
alias: Coffee counter increment
trigger:
- platform: state
entity_id: sensor.linea_mini_total_drinks
attribute: drinks_k1
condition: []
action:
- service: input_number.increment
target:
entity_id: input_number.coffee_counter
Here is the Notification to my phone to remind me to fill it up. Approx 13 is the magic number on my Linea Mini. You can play with this value:
alias: Coffee water refill required
description: ''
trigger:
- platform: numeric_state
entity_id: input_number.coffee_counter
attribute: max
above: '13'
condition: []
action:
- service: input_number.set_value
target:
entity_id: input_number.coffee_counter
data:
value: 0
- service: notify.notify
data:
title: Refill coffee machine water
message: Coffee machine water is running low. Refill.
mode: single
Hopefully someone finds this useful!
Very clever! I’m thrilled that you’ve found a use for the “drinks” stats - I added them in an effort to make all the data I could find available, but I couldn’t think of a use for them. I know that there’s an outstanding PR to support the reservoir sensor (which I don’t personally use), and I’ll get around to reviewing that soon. That would be a better indicator.
The problem I feel with the reservoir sensor is that by the time is detects the water is low, it stops pumping and your coffee is ruined. It seems to be a self preservation sensor for the machine so the boiler always has water. My somewhat basic attempt is to remind before the sensor pings off to ensure no coffees are ruined.
Sure, makes sense.
Very cool @mrvautin - Just wondering, if you do just a head flush before your pour does that increment the drink counter?
I have the Prebrew turned on and when I flush I stop at the pause and that doesn’t count as a drink.
Just FYI -
My goal with the drink stats was to match what the mobile app shows, and I never figured out why there’s a seemingly arbitrary difference between the machine counters and what’s displayed in the app. To make them match, I first take the values that the LM server reports for each drink type, then read the machine values, then calculate and apply an offset to any future readings to obtain the value displayed in the entity. It should be consistent for what you’re doing, but just know that there’s some funny business going on in the background and a change in the LM server stats could affect the values you’re using.
It’s really hacky and I don’t like it, but I felt that having the mobile app and the integration match was less confusing. Both the local and server values increment in lock-step as you’d expect, so your math should be fine.