sindrebroch / ha-magicmirror

Custom HomeAssistant-integration for MagicMirror
Apache License 2.0
14 stars 0 forks source link

Failed to setup error in integration #20

Open hesspoint opened 1 year ago

hesspoint commented 1 year ago

Hi,

I installed HA 2023.5 yesterday and today I noticed an error with the Magic Mirror integration.

I am running Home Assistant 2023.5.0 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.1 - latest

As for MM I am running the latest version and the latest version of the remote control module (no recent updates there)

In the integrations overview it shows a red exclamation point with the message Failed to setup. Did multiple restarts of HA (incl complete system reboot) and restarts of the MM Pi.

The log gives this error.

2023-05-04 21:21:32.640 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Magic Mirror for magicmirror File "/config/custom_components/magicmirror/init.py", line 53, in async_setup_entry

Error setting up entry Magic Mirror for magicmirror Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/magicmirror/init.py", line 53, in async_setup_entry hass.config_entries.async_setup_platforms(entry, PLATFORMS) AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

sindrebroch commented 1 year ago

Hi. Thanks for reporting.

I'm having some issues as well.

I released a beta-version which fixed the error you're reporting, but I'm still having issues with unavailable entities. Will look into this as soon as I have the time.

sindrebroch commented 1 year ago

You can try updating to the latest beta, it seems to have fixed my issues. I'm going to release it pretty soon, there have been a few beta-releases now that have not reached stable because I have forgotten to release.

hesspoint commented 1 year ago

I downloaded the latest beta 5, did my restart but I am now getting this error

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/magicmirror/coordinator.py", line 61, in _async_update_data await self.api.update_available() File "/config/custom_components/magicmirror/api.py", line 156, in update_available return ModuleUpdateResponses.from_dict(await self.get(API_UPDATE_AVAILABLE)) File "/config/custom_components/magicmirror/api.py", line 108, in get return await self.handle_request(get) File "/config/custom_components/magicmirror/api.py", line 85, in handle_request raise Exception(f"Response not 200 OK {resp}") Exception: Response not 200 OK <ClientResponse(http://192.xxx.xxx.xxx:8080/api/updateAvailable) [404 Not Found]> <CIMultiDictProxy('Access-Control-Allow-Origin': '*', 'X-DNS-Prefetch-Control': 'off', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'X-Download-Options': 'noopen', 'X-Content-Type-Options': 'nosniff', 'X-Permitted-Cross-Domain-Policies': 'none', 'Referrer-Policy': 'no-referrer', 'X-XSS-Protection': '0', 'Content-Security-Policy': "default-src 'none'", 'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '158', 'Date': 'Sat, 06 May 2023 14:46:36 GMT', 'Connection': 'keep-alive', 'Keep-Alive': 'timeout=5')>

hesspoint commented 1 year ago

Hi @sindrebroch

Any update on the issue?

Thanks!

sindrebroch commented 1 year ago

@hesspoint Thanks for bumping, I forgot about this.

I forgot to mention that the beta-versions require a fork of the MMM-Remote-Control module, only mentioned in the release-notes of 1.5.0b1. I should probably make it compatible with the non-fork as well, but I probably won't have time for it in the near future. I'm guessing that is the issue here.

hesspoint commented 1 year ago

Hi @sindrebroch

I updated my MMM-Remote on my mirror with your fork of the repo.

Actually in the read me of the fork it still says to execute

bash -c "$(curl -s https://raw.githubusercontent.com/Jopyth/MMM-Remote-Control/master/installer.sh)"

I figured I needed to replace "Jopyth" with "sindrebroch" so that it pulls your fork instead of the original one, correct?

Anyhow let the install run. I denied installing the developer version though. Installed fine. After that rebooted my mirror but changed nothing else in the config.

Still the same error comes up in the HA integration.

What did I do wrong?

Generally it would be highly appreciated if you could adapt you HA integration so it works with the original mirror module, also as that one received a few updates over the past weeks and your fork I think is much older.

Thanks a lot for your support!

Best regards Hannes

sindrebroch commented 1 year ago

I haven't really done a great job with the documentation on this, I'm sorry. It has been for my own use, so I haven't though much of it... The idea was to contribute back into Jopyth's module, but I haven't gotten to that yet.

I think the installer.sh-script will still pull the code for Jopyth's module, so personally I have done a manual install, but use the URL to my fork instead of his. Could you give that a try?

I can obviously make many improvements here, but been super busy lately, so not much time to look into it sadly.

hesspoint commented 1 year ago

Ok I removed the module completely and did a manual install of your fork and now it works :) Thanks for the hint.

So for now I am good again until there is a permanent fix of the integration.

Thanks for the great work you are doing as your integration allows me to e.g. shutdown my MM when I leave the house and also make the display turn on and off when my motion controlled lights do.

sahirmathur1 commented 10 months ago

Just here to say thanks! This fixed my problem like @hesspoint said, uninstall the old module from Jopyth

git clone https://github.com/sindrebroch/MMM-Remote-Control
cd MMM-Remote-Control/
npm install