sindrebroch/ha-magicmirror

Integration is failing again

Closed this issue · 7 comments

After going to 2023.03 the integration is failing again.
I just started going to the latest MagicMirror version, but that didn't help.
I also tried removing the integration, and creating it again, still no dice.

MagicMirror 2.22.0
MM Integration: 1.4.0
HomeAssistant: 2023.3.3

After retrying the config, the logfile shows (it creates the integration entry, but no entities):

Logger: homeassistant.config_entries
Source: config_entries.py:933
First occurred: 21.58.48 (1 occurrences)
Last logged: 21.58.48

Config entry '10.11.12.17' for magicmirror integration not ready yet; Retrying in background

Logger: homeassistant.helpers.service
Source: helpers/service.py:645
First occurred: 21.53.36 (3 occurrences)
Last logged: 21.53.44

Unable to find referenced entities light.magicmirror_monitor or it is/they are currently not available
Unable to find referenced entities media_player.mass_all_speakers or it is/they are currently not available

The log shows:

2023-03-22 23:35:27.085 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration magicmirror which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-03-22 23:35:46.537 DEBUG (MainThread) [custom_components.magicmirror] GET url=http://10.11.12.17:8080/api/mmUpdateAvailable. headers={'accept': 'application/json', 'Authorization': 'Bearer b9911c8282f943faac207140f4e8ea0a'}
2023-03-22 23:35:59.019 DEBUG (MainThread) [custom_components.magicmirror] Finished fetching magicmirror data in 12.483 seconds (success: False)
2023-03-22 23:35:59.020 WARNING (MainThread) [homeassistant.config_entries] Config entry '10.11.12.17' for magicmirror integration not ready yet; Retrying in background
2023-03-22 23:37:08.321 DEBUG (MainThread) [custom_components.magicmirror] GET url=http://10.11.12.17:8080/api/mmUpdateAvailable. headers={'accept': 'application/json', 'Authorization': 'Bearer b9911c8282f943faac207140f4e8ea0a'}
2023-03-22 23:37:10.246 DEBUG (MainThread) [custom_components.magicmirror] Response=<ClientResponse(http://10.11.12.17:8080/api/mmUpdateAvailable) [200 OK]>
2023-03-22 23:37:10.247 DEBUG (MainThread) [custom_components.magicmirror] pre handle_request=<ClientResponse(http://10.11.12.17:8080/api/mmUpdateAvailable) [200 OK]>
2023-03-22 23:37:10.247 DEBUG (MainThread) [custom_components.magicmirror] post handle_request={'success': True, 'query': {'data': 'mmUpdateAvailable'}, 'result': False}
2023-03-22 23:37:10.247 DEBUG (MainThread) [custom_components.magicmirror] QueryResponse={'success': True, 'query': {'data': 'mmUpdateAvailable'}, 'result': False}
2023-03-22 23:37:10.247 DEBUG (MainThread) [custom_components.magicmirror] Query={'data': 'mmUpdateAvailable'}
2023-03-22 23:37:10.247 DEBUG (MainThread) [custom_components.magicmirror] GET url=http://10.11.12.17:8080/api/updateAvailable. headers={'accept': 'application/json', 'Authorization': 'Bearer b9911c8282f943faac207140f4e8ea0a'}
2023-03-22 23:37:18.491 DEBUG (MainThread) [custom_components.magicmirror] Finished fetching magicmirror data in 10.171 seconds (success: False)
...
023-03-23 05:44:26.777 DEBUG (MainThread) [custom_components.magicmirror] GET url=http://10.11.12.17:8080/api/mmUpdateAvailable. headers={'accept': 'application/json', 'Authorization': 'Bearer b9911c8282f943faac207140f4e8ea0a'}
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] Response=<ClientResponse(http://10.11.12.17:8080/api/mmUpdateAvailable) [200 OK]>
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] pre handle_request=<ClientResponse(http://10.11.12.17:8080/api/mmUpdateAvailable) [200 OK]>
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] post handle_request={'success': True, 'query': {'data': 'mmUpdateAvailable'}, 'result': False}
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] QueryResponse={'success': True, 'query': {'data': 'mmUpdateAvailable'}, 'result': False}
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] Query={'data': 'mmUpdateAvailable'}
2023-03-23 05:44:28.466 DEBUG (MainThread) [custom_components.magicmirror] GET url=http://10.11.12.17:8080/api/updateAvailable. headers={'accept': 'application/json', 'Authorization': 'Bearer b9911c8282f943faac207140f4e8ea0a'}
2023-03-23 05:44:36.778 DEBUG (MainThread) [custom_components.magicmirror] Finished fetching magicmirror data in 10.001 seconds (success: False)

Weird that you're having so many issues with the integration. I find it pretty hard to debug, since I can't really reproduce it.

Only thing I can think of is maybe the request is timing out somehow, without it throwing TimeoutError? I think they did some changes to the default timeout in 2023.2 or 2023.3 if I remember correctly.

Can you try updating to the latest beta? I increased the timeout to 20seconds, from 10seconds.

This beta-version also includes some other changes that I never moved to stable-version, but haven't had any issues personally. I think it requires my fork of MMM-Remote-Control to work, but don't remember if there are any breaking changes (but I don't think so).

Hi @sindrebroch
I'm glad you are still trying to work on this.

I've tried using your Remote-Control clone by doing a
git clone https://github.com/sindrebroch/MMM-Remote-Control.git
And then a npm install from the folder (I've rename the original Remote-Control folder to .bak
I'm on b5 of the addon and 2.23 of the MagicMirror software

I see the remote control menu from the browser and all, but I still get an error when I try to reinitialize the module.
I've also tried to remore the integration, and readd it, and it shows up, but still shows errors.

Hey @sindrebroch
So I finally got a Pi in surplus, so I'm going to try and build a new setup to see if I can get your integration to work.
What version of the OS are you using on yours? 32/64 bit?

Hi @sindrebroch
So I've spent some hours trying to figure out what is going on.
I've installed Raspberry Pi OS 32 bit (11 bullseye)
I then installed MagicMirror with the sdetwell install script.
I changed the config for the IP to non-restricted, and let all local IP's access it.
I then added the B5 integration to HA, and added your version of MMM-Remote-Control to MagicMirror
I could successfully integrate it to HA 2023.6.1
I then changed language to da and da-DK
I modified all the calendars and news feeds to be the same as my running mirror.
It still reacts on the integration.
I then proceeded to install the MMM-ScreenCast, and do the config.
That still worked.
I then started a cast from YouTube...
BAM - integration unsucessfull in communication
In PM2 logs I see this:

0|MagicMirror  | [10.06.2023 14:32.13.960] [LOG]   screencast stdout:
0|MagicMirror  | > magicmirror-screencast@0.0.5 start
0|MagicMirror  | > electron app.js
0|MagicMirror  | [10.06.2023 14:32.16.679] [LOG]   screencast stderr: (node:4502) electron: The default of contextIsolation is deprecated and will be changing from false to true in a future release of Electron.  See https://github.com/electron/electron/issues/23506 for more information
0|MagicMirror  | [10.06.2023 14:32.43.263] [LOG]   Not initialized, have you opened or refreshed your browser since the last time you started MagicMirror?

I then restarted MagicMirror, and didn't remove the MMM-ScreenCast, and the integration still didn't work.
I then uninstalled MMM-ScreenCast, and the integration works again...

The Integration works, and the remote module works, but it doesn't turn off the HDMI on Bullseye, they apparently changed something, but I can reboot the RPi, restart magicmirror, refresh browser and everything else from the integration.

I'm using Raspberry Pi OS 32 bit (11 bullseye) as well.

For me the on/off works on Bullseye, so not sure why that stopped working for you.

Hm, interesting! I have tried to cast a video to my mirror, and it all works fine for me.

Looks like the MMM-Screencast-module hasn't been touched for several years though... Looks like it's running an ancient version of electron. Maybe that's what is breaking it for you? Somehow the older electron tries to overrule or something? You might try updating electron in the package.json of the module, and see if is a) builds and b) helps, but that's about all I can think of... Still seems weird that it should work for me and not you...

I'm not really interested in diving into their code unfortunately

I've gone to a new install, after it failing again, and it's integrated now, though without screencast (which I didn't have before either).