NEWS
AppleTV steuern über NodeRed
-
Hi,
gibt es einen Befehl, oder einen Adapter außerhalb HAS mit dem man den AppleTV aufwecken und bestenfalls auch in den Ruhezustand setzen kann?
Ich glaube mal irgendwas für den JS Adapter über einen exec Aufruf gelesen zu haben.
Geht das überhaupt und wie kann man das dann in Node Red umsetzen?Wie gesagt, ich möchte keine extra HAS Installation aufsetzen dafür. Homekit geht automatisch über das IPad, aber der Yakkra Adapter geht nur in Richtung Homekit....
VG Torsten
-
Das wäre was oder?
https://pyatv.dev/Die Befehle müsste man ja per exec ausführen können.
Kann es nicht testen, da ich kein einziges Apple Gerät im Haus habe
Edit
Kann wohl auch über Node Red angesprochen werden.
https://github.com/twocolors/node-red-contrib-apple-tv-x -
@david-g Hallo David,
habe es mir mal angelesen. Sollte eigentlich gut funktionieren, könnte man das pyatv parallel auf der ioBroker Installation laufen lassen?
Soweit ich das sehe, läuft das nicht als Service im Autostart. So fit bin ich in Linux definitiv nicht...
$ sudo apt-get install build-essential libssl-dev libffi-dev python3-dev python3-pip python3-cryptography python3-wheel $ sudo pip3 install --upgrade pyatv
Gruß Torsten
-
@schneidy76 sagte in AppleTV steuern über NodeRed:
könnte man das pyatv parallel auf der ioBroker Installation laufen lassen?
Sollte aus meiner Sicht nichts gegen sprechen.
-
@david-g der zweite Befehl ging schon in die Hose:
pi@raspberrypi:~ $ sudo pip3 install --upgrade pyatv error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. For more information visit http://rptl.io/venv note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.
-
Hat ein wenig gedauert, aber irgendwie habe ich es (glaube ich) geschafft:
pi@raspberrypi:~ $ python3 -m venv pyatv_venv pi@raspberrypi:~ $ source pyatv_venv/bin/activate (pyatv_venv) pi@raspberrypi:~ $ pip3 install pyatv Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyatv Downloading https://www.piwheels.org/simple/pyatv/pyatv-0.15.1-py3-none-any.whl (455 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 455.8/455.8 kB 3.1 MB/s eta 0:00:00 Collecting aiohttp<5,>=3.8.3 Downloading aiohttp-3.10.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 7.0 MB/s eta 0:00:00 Collecting async-timeout>=4.0.2 Downloading https://www.piwheels.org/simple/async-timeout/async_timeout-4.0.3-py3-none-any.whl (5.7 kB) Collecting cryptography>=43.0.0 Downloading cryptography-43.0.1-cp39-abi3-manylinux_2_28_aarch64.whl (3.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 10.1 MB/s eta 0:00:00 Collecting chacha20poly1305-reuseable>=0.13.2 Downloading https://www.piwheels.org/simple/chacha20poly1305-reuseable/chacha20poly1305_reuseable-0.13.2-py3-none-any.whl (8.6 kB) Collecting ifaddr>=0.1.7 Downloading https://www.piwheels.org/simple/ifaddr/ifaddr-0.2.0-py3-none-any.whl (12 kB) Collecting mediafile>=0.8.1 Downloading https://www.piwheels.org/simple/mediafile/mediafile-0.12.0-py3-none-any.whl (21 kB) Collecting miniaudio>=1.45 Downloading miniaudio-1.61.tar.gz (1.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 9.7 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting protobuf>=4.25.3 Downloading protobuf-5.28.2-cp38-abi3-manylinux2014_aarch64.whl (316 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 316.5/316.5 kB 8.5 MB/s eta 0:00:00 Collecting pydantic>=1.10.10 Downloading https://www.piwheels.org/simple/pydantic/pydantic-2.9.2-py3-none-any.whl (434 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 434.9/434.9 kB 2.8 MB/s eta 0:00:00 Collecting requests>=2.23.0 Downloading https://www.piwheels.org/simple/requests/requests-2.32.3-py3-none-any.whl (64 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 4.8 MB/s eta 0:00:00 Collecting srptools>=0.2.0 Downloading https://www.piwheels.org/simple/srptools/srptools-1.0.1-py2.py3-none-any.whl (13 kB) Collecting tabulate>=0.9.0 Downloading https://www.piwheels.org/simple/tabulate/tabulate-0.9.0-py3-none-any.whl (35 kB) Collecting zeroconf>=0.129.0 Downloading zeroconf-0.135.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.3/11.3 MB 9.3 MB/s eta 0:00:00 Collecting aiohappyeyeballs>=2.3.0 Downloading https://www.piwheels.org/simple/aiohappyeyeballs/aiohappyeyeballs-2.4.3-py3-none-any.whl (14 kB) Collecting aiosignal>=1.1.2 Downloading https://www.piwheels.org/simple/aiosignal/aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Collecting attrs>=17.3.0 Downloading https://www.piwheels.org/simple/attrs/attrs-24.2.0-py3-none-any.whl (63 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.0/63.0 kB 548.6 kB/s eta 0:00:00 Collecting frozenlist>=1.1.1 Downloading frozenlist-1.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (273 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 273.3/273.3 kB 2.3 MB/s eta 0:00:00 Collecting multidict<7.0,>=4.5 Downloading multidict-6.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (131 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 131.1/131.1 kB 2.1 MB/s eta 0:00:00 Collecting yarl<2.0,>=1.12.0 Downloading yarl-1.13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (486 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 486.1/486.1 kB 9.2 MB/s eta 0:00:00 Collecting cffi>=1.12 Using cached cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (469 kB) Collecting six>=1.9 Downloading https://www.piwheels.org/simple/six/six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting mutagen>=1.46 Downloading https://www.piwheels.org/simple/mutagen/mutagen-1.47.0-py3-none-any.whl (194 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 194.4/194.4 kB 2.3 MB/s eta 0:00:00 Collecting annotated-types>=0.6.0 Downloading https://www.piwheels.org/simple/annotated-types/annotated_types-0.7.0-py3-none-any.whl (13 kB) Collecting pydantic-core==2.23.4 Downloading pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 9.9 MB/s eta 0:00:00 Collecting typing-extensions>=4.6.1 Downloading https://www.piwheels.org/simple/typing-extensions/typing_extensions-4.12.2-py3-none-any.whl (37 kB) Collecting charset-normalizer<4,>=2 Downloading charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (136 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136.6/136.6 kB 7.4 MB/s eta 0:00:00 Collecting idna<4,>=2.5 Downloading https://www.piwheels.org/simple/idna/idna-3.10-py3-none-any.whl (70 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.4/70.4 kB 816.7 kB/s eta 0:00:00 Collecting urllib3<3,>=1.21.1 Downloading https://www.piwheels.org/simple/urllib3/urllib3-2.2.3-py3-none-any.whl (126 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.3/126.3 kB 2.4 MB/s eta 0:00:00 Collecting certifi>=2017.4.17 Downloading https://www.piwheels.org/simple/certifi/certifi-2024.8.30-py3-none-any.whl (167 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 167.3/167.3 kB 3.9 MB/s eta 0:00:00 Collecting pycparser Using cached https://www.piwheels.org/simple/pycparser/pycparser-2.22-py3-none-any.whl (117 kB) Building wheels for collected packages: miniaudio Building wheel for miniaudio (pyproject.toml) ... done Created wheel for miniaudio: filename=miniaudio-1.61-cp311-cp311-linux_aarch64.whl size=597319 sha256=b9034626511536625a0eb8316e3b2d7e95733645b55dfd65551e7363c4cdf158 Stored in directory: /home/pi/.cache/pip/wheels/bf/c6/74/74b9a73657919dacc46d28c1142195b5ef844dcd505c0c4e49 Successfully built miniaudio Installing collected packages: ifaddr, zeroconf, urllib3, typing-extensions, tabulate, six, pycparser, protobuf, mutagen, multidict, idna, frozenlist, charset-normalizer, certifi, attrs, async-timeout, annotated-types, aiohappyeyeballs, yarl, srptools, requests, pydantic-core, mediafile, cffi, aiosignal, pydantic, miniaudio, cryptography, aiohttp, chacha20poly1305-reuseable, pyatv Successfully installed aiohappyeyeballs-2.4.3 aiohttp-3.10.9 aiosignal-1.3.1 annotated-types-0.7.0 async-timeout-4.0.3 attrs-24.2.0 certifi-2024.8.30 cffi-1.17.1 chacha20poly1305-reuseable-0.13.2 charset-normalizer-3.3.2 cryptography-43.0.1 frozenlist-1.4.1 idna-3.10 ifaddr-0.2.0 mediafile-0.12.0 miniaudio-1.61 multidict-6.1.0 mutagen-1.47.0 protobuf-5.28.2 pyatv-0.15.1 pycparser-2.22 pydantic-2.9.2 pydantic-core-2.23.4 requests-2.32.3 six-1.16.0 srptools-1.0.1 tabulate-0.9.0 typing-extensions-4.12.2 urllib3-2.2.3 yarl-1.13.1 zeroconf-0.135.0 (pyatv_venv) pi@raspberrypi:~ $
jetzt mal schauen wie es weiter geht...
-
Hallo Zusammen...
Hat irgendwer diese Kombi am laufen???
NodeRed findet die pyatv Installation nicht...Grüße Torsten...
-
mal wieder etwas Zeit gehabt:
Die Installation und auch den richtigen Pfad gefunden:/home/pi/pyatv_venv/bin
Auch die AppleTVs habe ich jetzt gefunden und konnte mich sich verbinden:
atvremote --id XX:XX:XX:XX:XX --protocol companion pair Enter PIN on screen: 2723 Pairing seems to have succeeded, yey! You may now use these credentials: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (pyatv_venv) pi@raspberrypi:~ $ atvremote --id XX:XX:XX:XX:XX --protocol airplay pair Enter PIN on screen: 5178 Pairing seems to have succeeded, yey! You may now use these credentials: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
leider bekomme ich jetzt im Debug Fehler:
Error: Got pyatv Error: Odd-length string pyatv Stacktrace: Traceback (most recent call last): File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 395, in appstart args.output(await _handle_command(args, abort_sem, storage, loop)), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/scripts/atvscript.py", line 273, in _handle_command atv = await connect(config, loop, storage=storage) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/__init__.py", line 155, in connect await atv.connect() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/core/facade.py", line 723, in connect if await setup_data.connect(): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/__init__.py", line 644, in _connect await api.connect() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/api.py", line 151, in connect await self._protocol.start() File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/protocols/companion/protocol.py", line 103, in start self.srp.pairing_id = parse_credentials(self.service.credentials).client_id ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/pi/pyatv_venv/lib/python3.11/site-packages/pyatv/auth/hap_pairing.py", line 141, in parse_credentials ltpk = binascii.unhexlify(split[0]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ binascii.Error: Odd-length string