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
71.11k stars 29.79k forks source link

#33302 new Roomba setup - discovered but integration cannot connect #34867

Closed thomsen883 closed 4 years ago

thomsen883 commented 4 years ago

The problem

When trying to get my Roomba980 working with the new way of configuring Roomba devices, the discovery in Integration seems to work (I see the card in Configuration -> Integrations), but when clicking on Configure in the GUI, I need to enter the same information again, that I already provided in the configuration.yml file (IP address, BLID and password). Since I do not have any certificate in my certificate store, I deleted the default value since it is marked as optional in the documentation. When clicking Submit, all entries are deleted and an error messages indicates: Unexpected Error. Unfortunately, I do not see anything in the logs at ~/Library/Logs/homeassistant.log nor in the logs in the GUI at Developer Tools.

Environment

My previous homeassistant installations were running on a Pi3 and on Synology, both in Docker. Attaching my Roomba980 did always work without a problem with previous versions of homeassistant using always the same host IP address, BLID and password. Some weeks ago, I migrated my home assistant installation to macOS running in a Python venv starting with homeassistant v108. I never managed to get my Roomba980 working. I did not continue troubleshooting for long to figure it out, because I knew that v109 would come up with a breaking change for Roomba vacuums.

Problem-relevant configuration.yaml

# Vacuum
roomba:
  - host: 192.168.1.19
    blid: 3142xxxxxxxx
    password: xxxxxxxxxxx

Traceback/Error logs

Additional information

hass_roomba_connection_submit hass_roomba_connection_unecpected_error
probot-home-assistant[bot] commented 4 years ago

Hey there @pschmitt, @cyr-ius, @shenxn, mind taking a look at this issue as its been labeled with a integration (roomba) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

shenxn commented 4 years ago

This is wired since the discovery is not yet implemented and the yaml configuration should be automatically imported instead of discovered. I think there is something messed up in the config flow so it stuck in the middle of the import and ended up as a "discovered" card. The config flow now catches all exceptions and returns a unknown error without log anything so you'll not be able to see any error in your log. I think that should be fixed though. Can you try to use v108 and see if there is anything in the log?

shenxn commented 4 years ago

I think this problem could be caused by the certificate. Although that is an optional field, it will use the default certificate /etc/ssl/certs/ca-certificates.crt if you do not give any. I don't have a mac to test but I think that does not exist in mac. You might need to figure out how to find / generate a certificate on mac and use that.

Siege36 commented 4 years ago

I am having a similar issue when creating the integration. I deleted the yaml config, fill out the form appropriately, matching the same details I had in my yaml config (which worked correctly) and I also get "unexpected error". Note: I do have a custom certificate that is ".pem" instead of .crt as in the default value. Also worth noting is there are no errors logged with this issue. In my opinion yaml should still be allowed, an error occurs during boot saying that I need to remove it when it is in there. I do see that the value "username" and been replaced by "blid"

shenxn commented 4 years ago

@Siege36 If your configuration worked correctly, I don't think the custom certificate would cause the problem. A mistake in error handling prevents the errors from being logged when there is an "unknown error". It should be fixed soon. The yaml configuration is still supported, but you will need to make some changes to the configuration. Note that now the configuration should be under the roomba domain instead of vacuum. Try the yaml configuration and see if it works.

Siege36 commented 4 years ago

@shenxn Thanks. I went ahead and integrated using the new roomba platform and I seem to be stuck in the spot with #34089 . My roomba now shows up as "discovered" with a configure button in the integrations page. Not quite working but I hope it will be resolved when that gets merged in.

thomsen883 commented 4 years ago

If I understand Siege36 correctly, he has the same problem as I have. In my case, the yaml config is now under roomba instead of vacuum (see above). @shenxn Although you say it is weird that the discovery is working, everything makes me believe that it is working (see the notification in the screenshot and the discovered iRobot card in the background). hass_roomba_discovery_notification In my mind, the first problem to be fixed is to get logging working.

shenxn commented 4 years ago

@thomsen883 The discovery is not working. The notification and the discovered card are because of something messed up in the import flow which makes home assistant think there is a device discovered. I agree that the log should be fixed first. I'll create a small pr so we can better understand what's going on here after the next minor release.

Siege36 commented 4 years ago

@thomsen883 is correct about my situation. I see exactly what he sees.

If I click the "discovered" integration, I get a blank form. It is not what I have entered in my Yaml, and I have no devices or entities registered.

Siege36 commented 4 years ago

After having upgrade to 109.2 I tried again to restart home assistant and set up integration. After filling out the UI form, I get the same "unexpected error" with no logs messages. Also the form resets and it says that Host Name or IP Address required and that particular input is red.

shenxn commented 4 years ago

@Siege36 Sorry my PR was a little bit too late and did not catch the 109.2 release. You may need to wait for 109.3 to see the error log.

shenxn commented 4 years ago

@thomsen883 The PR should fix your problem. @Siege36 If you still cannot setup the integration after the new release, open a new issue for that.

bdraco commented 4 years ago

Fixed in 0.110. Older versions will have to manually install the.crt file in a location of their choice if it is missing.

Disregard, will be fixed in 0.109.4

thomsen883 commented 4 years ago

@shenxn Thanks a lot. v0.109.4 fixed my issue. Roomba vacuum is now integrated into HA.

Siege36 commented 4 years ago

Can confirm also fixed in 109.4.