home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.47k stars 30.69k forks source link

Cannot add lametric device #78959

Closed TheRealWaldo closed 2 years ago

TheRealWaldo commented 2 years ago

The problem

LaMetric device is discoverable, but both flows fail to add it.

Import fails with 'unknown error' and manual fails with 'cannot connect'.

Confirmed the device is accessible locally, and also available through native lametric app.

Lametric software version 2.2.4

Once the config fails, it fails before allowing you to select a config flow until HA is restarted. Interestingly enough it shows the name of the lametric device, so it is connecting to some extent.

What version of Home Assistant Core has the issue?

2022.9.6

What was the last working version of Home Assistant Core?

2022.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Lametric

Link to integration documentation on our website

https://www.home-assistant.io/integrations/lametric

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.lametric
Source: components/lametric/config_flow.py:130
Integration: lametric (documentation, issues)
First occurred: 9:17:46 AM (1 occurrences)
Last logged: 9:17:46 AM

Error connecting to LaMetric: Error occurred while communicating with the LaMetric device at 192.168.3.44

Additional information

No response

homeassistant commented 2 years ago

lametric documentation lametric source (message by IssueLinks)


Hey there @robbiet480, @frenck, mind taking a look at this issue as it has been labeled with an integration (lametric) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Grayda commented 2 years ago

I had this issue, but I think I just managed to get it working based on info from this issue: #78180

I have two clocks. Both were set to "Show One App" mode in the LaMetric mobile app (i.e. both were in kiosk mode). I could add the first one, but the second one would with the error. So after looking at the other closed issues, I switched my second LaMetric Time to "Click to Scroll Apps" (i.e. manual mode) and tried adding it in HA again. This time it worked first time.

I don't know if just toggling the mode was enough to get it working, but it's definitely worth testing.

EDIT: Never mind. Doing that let me finish setting up the LaMetric (after spending a good 10 minutes retrying and retrying), but it won't let me send notifications.

TheRealWaldo commented 2 years ago

Mine is, and was, in 'click to scroll apps'. So not likely the same issue.

frenck commented 2 years ago

I have two clocks. Both were set to "Show One App" mode in the LaMetric mobile app (i.e. both were in kiosk mode). I could add the first one, but the second one would with the error. So after looking at the other closed issues, I switched my second LaMetric Time to "Click to Scroll Apps" (i.e. manual mode) and tried adding it in HA again. This time it worked first time.

Nice! This seems to be undocumented, but I can reproduce. If an device is in Kiosk mode (single app) or in a screensaver, it will not accept info/warning notifications (hence the request failing). Critical notification will interrupt this.

I will adjust the integration adding procedure to handle this case better.

Never mind. Doing that let me finish setting up the LaMetric (after spending a good 10 minutes retrying and retrying), but it won't let me send notifications.

That is most likely the same reason, up the priority of the notification.

TheRealWaldo commented 2 years ago

Sorry but the original issue had nothing to do with those modes?

frenck commented 2 years ago

@TheRealWaldo It does, as it fails on components/lametric/config_flow.py:130, which was in your original report.

TheRealWaldo commented 2 years ago

@frenck but my unit is and always has been in 'click to scroll apps' and does not add, wherein this other issue is related to being set to something else, and does add when set to 'click to scroll apps'.

I get no entities whatsoever, no matter what I try.

TheRealWaldo commented 2 years ago

Confirmed, applying https://github.com/home-assistant/core/pull/79031 does not make a difference to the original issue.