georgezhao2010 / apple_airplayer

Make your AirPlay devices as TTS speakers
MIT License
130 stars 17 forks source link

Config flow could not be loaded #1

Closed goven closed 2 years ago

goven commented 2 years ago

When add this integration, error popped with Config flow could not be loaded, and fail to add this integration. homeassistant version 2021.7.3.

georgezhao2010 commented 2 years ago

When add this integration, error popped with Config flow could not be loaded, and fail to add this integration. homeassistant version 2021.7.3.

There are some bugs in Home Assisatant 2021.7.x or later, please see the link below

https://github.com/georgezhao2010/apple_airplayer/blob/master/README.md#20217x-or-later

goven commented 2 years ago

Thanks, but I'm using Home Assistant OS 6.2, could you tell me how to execute these commands in Home Assistant OS?

goven commented 2 years ago

I found the host system is alpine, I use 'apk add python3' and 'apk add py3-pip' to install python3 and pip3, then I use 'pip3 install miniaudio' to install miniaudio, but errors came out, and I can't install miniaudio.

georgezhao2010 commented 2 years ago

I found the host system is alpine, I use 'apk add python3' and 'apk add py3-pip' to install python3 and pip3, then I use 'pip3 install miniaudio' to install miniaudio, but errors came out, and I can't install miniaudio.

Python3 is already included in HASSOS, run follow commands as below:

apk update
apk add build-base
pip3 uninstall --yes miniaudio
pip3 install miniaudio
goven commented 2 years ago

Home Assistant OS did not preinstalled Python3 or miniaudio, First I have to install Python3 and pip3, after that when I use pip3 to install miniaudio, get these errors. Untitled

georgezhao2010 commented 2 years ago

Home Assistant OS did not preinstalled Python3 or miniaudio, First I have to install Python3 and pip3, after that when I use pip3 to install miniaudio, get these errors.

Show me your HA system info in http://{Your_HA_IP_Address}:8123/config/info

Like this

System Health

version: core-2021.8.4
installation_type: Home Assistant Container
dev: false
hassio: false
docker: true
user: root
virtualenv: false
python_version: 3.9.6
os_name: Linux
os_version: 4.4.59+
arch: x86_64
timezone: Asia/Shanghai

GitHub API: ok
Github API Calls Remaining: 5000
Installed Version: 1.13.2
Stage: running
Available Repositories: 851
Installed Repositories: 20
goven commented 2 years ago

System Health

version core-2021.8.6
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.6
os_name Linux
os_version 5.10.53
arch x86_64
timezone Asia/Hong_Kong
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4979 Installed Version | 1.13.2 Stage | running Available Repositories | 844 Installed Repositories | 3
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | November 17, 2018, 8:00 AM relayer_connected | false remote_enabled | true remote_connected | false alexa_enabled | false google_enabled | false can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 6.2 -- | -- update_channel | stable supervisor_version | supervisor-2021.06.8 docker_version | 20.10.6 disk_total | 38.7 GB disk_used | 7.7 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.3.3), Node-RED (10.0.0), RPC Shutdown (2.2), Samba share (9.2.0), Terminal & SSH (9.1.3)
Lovelace dashboards | 1 -- | -- resources | 0 views | 1 mode | storage
georgezhao2010 commented 2 years ago

System Health

version core-2021.8.6 installation_type Home Assistant OS ...

See, I'm sure the Python 3.9.6 has been already installed in HASSOS.

Follow the steps below

goven commented 2 years ago

~$ docker bash: docker: command not found

steve41200 commented 2 years ago

I have exactly the same problem. I have try via the way you propose (terminal) and have the same pb than goven. Before see your answer I have make some try. I have HASSOS install via proxmox I have try via the proxmox shell and via SSH with the root account

this is my config We see python is install but in terminal when I write python3 --v I have the answer bash python3 command not found

System Health

version: core-2021.8.6 installation_type: Home Assistant OS dev: false hassio: true docker: true user: root virtualenv: false python_version: 3.9.6 os_name: Linux os_version: 5.10.53 arch: x86_64 timezone: Europe/Paris

GitHub API: ok Github API Calls Remaining: 4910 Installed Version: 1.13.2 Stage: running Available Repositories: 906 Installed Repositories: 13

logged_in: false can_reach_cert_server: ok can_reach_cloud_auth: ok can_reach_cloud: ok

host_os: Home Assistant OS 6.2 update_channel: stable supervisor_version: supervisor-2021.06.8 docker_version: 20.10.6 disk_total: 51.5 GB disk_used: 39.8 GB healthy: true supported: true board: ova supervisor_api: ok version_api: ok installed_addons: Home Assistant Google Drive Backup (0.104.3), File editor (5.3.1), Node-RED (9.1.4), Samba share (9.5.1), ZeroTier One (0.11.1), Terminal & SSH (9.1.3), Duck DNS (1.12.5), ESPHome (1.18.0), InfluxDB (4.1.1), Grafana (7.0.1), Zigbee2mqtt (1.18.1-1), Assistant Relay (0.7.4), AirCast (3.1.1), MariaDB (2.3.0), Nginx Proxy Manager (0.11.0), NGINX Home Assistant SSL proxy (3.0.1), Portainer (1.5.1), Mosquitto broker (6.0.1), Zigbee2mqtt (1.21.0-1)

dashboards: 1 resources: 6 views: 7 mode: storage

goven commented 2 years ago

I have exactly the same problem. I have try via the way you propose (terminal) and have the same pb than goven.

Before see your answer I have make some try. I have HASSOS install via proxmox I have try via the proxmox shell and via SSH with the root account

My HASSOS also installed on a virtual machine of Proxmox, we have the same issue,maybe this problem happened only on HOMEASSISTANT OS.

steve41200 commented 2 years ago

may be I'm not a pro in linux line command, but the author is in Home Assistant container and not home assistant OS, maybe a way to understand the problem

steve41200 commented 2 years ago

It works to me. On Proxmox, run the shell windows (on the top of the HASSOS VM) Type login root (no password require) and after run the line of George docker exec -it homeassistant /bin/bash apk update apk add build-base pip3 uninstall --yes miniaudio pip3 install miniaudio

the first line put a bash5 before each line. I don't understand very well linux specificity but it does the job. TY for the author I search an add on like this since a long long time, and I have try some off technic without success

And for the little story I have try this during I occuping the kids, and I promise them to choose the first sentence of Siri, it was choose "Prout caca Boudin" I don't know the English equivalence :)

goven commented 2 years ago

It works to me.

On Proxmox, run the shell windows (on the top of the HASSOS VM)

Type login

root

(no password require)

and after run the line of George

docker exec -it homeassistant /bin/bash

apk update

apk add build-base

pip3 uninstall --yes miniaudio

pip3 install miniaudio

the first line put a bash5 before each line. I don't understand very well linux specificity but it does the job.

TY for the author I search an add on like this since a long long time, and I have try some off technic without success

And for the little story I have try this during I occuping the kids, and I promise them to choose the first sentence of Siri, it was choose "Prout caca Boudin" I don't know the English equivalence :)

These commands works for me and miniaudio was installed, but I still fail to add Apple AirPlayer in integrations with the same error.image

By the way, you can speak Chinese,I'm Chinese.

georgezhao2010 commented 2 years ago

It works to me. On Proxmox, run the shell windows (on the top of the HASSOS VM) Type login root (no password require) and after run the line of George docker exec -it homeassistant /bin/bash apk update apk add build-base pip3 uninstall --yes miniaudio pip3 install miniaudio the first line put a bash5 before each line. I don't understand very well linux specificity but it does the job. TY for the author I search an add on like this since a long long time, and I have try some off technic without success And for the little story I have try this during I occuping the kids, and I promise them to choose the first sentence of Siri, it was choose "Prout caca Boudin" I don't know the English equivalence :)

These commands works for me and miniaudio was installed, but I still fail to add Apple AirPlayer in integrations with the same error.!

By the way, you can speak Chinese,I'm Chinese.

Any logs when config failure?

goven commented 2 years ago

It works to me.

On Proxmox, run the shell windows (on the top of the HASSOS VM)

Type login

root

(no password require)

and after run the line of George

docker exec -it homeassistant /bin/bash

apk update

apk add build-base

pip3 uninstall --yes miniaudio

pip3 install miniaudio

the first line put a bash5 before each line. I don't understand very well linux specificity but it does the job.

TY for the author I search an add on like this since a long long time, and I have try some off technic without success

And for the little story I have try this during I occuping the kids, and I promise them to choose the first sentence of Siri, it was choose "Prout caca Boudin" I don't know the English equivalence :)

These commands works for me and miniaudio was installed, but I still fail to add Apple AirPlayer in integrations with the same error.!

By the way, you can speak Chinese,I'm Chinese.

Any logs when config failure?

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/apple_airplayer/device_manager.py:9 Integration: Apple AirPlayer (documentation, issues) First occurred: 9:23:34 AM (1 occurrences) Last logged: 9:23:34 AM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, 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 84, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, 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 144, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 128, in post return await super().post(request) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post result = await self._flow_mgr.async_init( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 171, in _async_init flow = await self.async_create_flow(handler, context=context, data=data) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 696, in async_create_flow integration.get_platform("config_flow") File "/usr/src/homeassistant/homeassistant/loader.py", line 498, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 503, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/config/custom_components/apple_airplayer/config_flow.py", line 5, in from .device_manager import DeviceManager File "/config/custom_components/apple_airplayer/device_manager.py", line 9, in DeviceModel.AirPortExpress: "AirPort Express", File "/usr/local/lib/python3.9/enum.py", line 429, in getattr raise AttributeError(name) from None AttributeError: AirPortExpress

georgezhao2010 commented 2 years ago

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/apple_airplayer/device_manager.py:9 Integration: Apple AirPlayer (documentation, issues) First occurred: 9:23:34 AM (1 occurrences) Last logged: 9:23:34 AM

...

File "/usr/local/lib/python3.9/enum.py", line 429, in getattr raise AttributeError(name) from None AttributeError: AirPortExpress

In HASSOS Terminal, run pip3 list | grep pyatv to confirm the version of pyatv.

Run pip3 install --upgrade pyatv to upgrade pyatv

If you are a Chinese, visit this link to find out more information about config error. 让你的HomePod可以TTS?没有那么多麻烦

goven commented 2 years ago

This error originated from a custom integration. Logger: aiohttp.server Source: custom_components/apple_airplayer/device_manager.py:9 Integration: Apple AirPlayer (documentation, issues) First occurred: 9:23:34 AM (1 occurrences) Last logged: 9:23:34 AM ... File "/usr/local/lib/python3.9/enum.py", line 429, in getattr raise AttributeError(name) from None AttributeError: AirPortExpress

In HASSOS Terminal, run pip3 list | grep pyatv to confirm the version of pyatv.

Run pip3 install --upgrade pyatv to upgrade pyatv

If you are a Chinese, visit this link to find out more information about config error. 让你的HomePod可以TTS?没有那么多麻烦

I don't find the same situation as mine there, could you add my qq(1021073979) to help me with this problem? thanks!

goven commented 2 years ago

With this author's help, I finally got this problem solved after I removed a custom integration named Apple TV from HACS, this integration in HACS will force pyatv to stay at the version of 7.7 which will not achieve the requirements of Apple Airplayer.

georgezhao2010 commented 2 years ago

The old version Apple TV integration manifesting pyatv==0.7.7 in file manifest.json, conflicts with this integration. If you want tp setup Apple TV integration, you should install official components from Home Assistant of latest version.