Git Product home page Git Product logo

node-red-contrib-apple-tv-x's People

Contributors

dependabot[bot] avatar twocolors avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

deltachaos

node-red-contrib-apple-tv-x's Issues

can't pair airplay

Installed the plugin inside my docker Container. Search and companion pair was successful. But I can't pair airplay. Plugin is unable to connect to my aTV4k.

`2022-02-22 07:57:08 ERROR [pyatv.scripts.atvremote]: Pairing failed
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pyatv/support/init.py", line 33, in error_handler
return await func(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/pyatv/protocols/airplay/auth/hap.py", line 43, in start_pairing
await self.http.post("/pair-pin-start", headers=_AIRPLAY_HEADERS)
File "/usr/lib/python3.8/site-packages/pyatv/support/http.py", line 359, in post
return await self.send_and_receive(
File "/usr/lib/python3.8/site-packages/pyatv/support/http.py", line 412, in send_and_receive
raise exceptions.HttpError(
pyatv.exceptions.HttpError: HTTP/1.1 method POST failed with code 400: Bad Request

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pyatv/scripts/atvremote.py", line 179, in pair
await self._perform_pairing(pairing)
File "/usr/lib/python3.8/site-packages/pyatv/scripts/atvremote.py", line 189, in _perform_pairing
await pairing.begin()
File "/usr/lib/python3.8/site-packages/pyatv/protocols/airplay/pairing.py", line 62, in begin
return await error_handler(
File "/usr/lib/python3.8/site-packages/pyatv/support/init.py", line 41, in error_handler
raise fallback(str(ex)) from ex
pyatv.exceptions.PairingError: HTTP/1.1 method POST failed with code 400: Bad Request`

Node Red fails after installing node

Hello! For information, here is the problem I have juste after installing the node. I had to run NodeRed in safe mode and uninstall it to recover normal operation. Thanks for your work.

Error: connect ECONNREFUSED 127.0.0.1:6668
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6668
}
7 May 13:35:19 - [red] Uncaught Exception:
7 May 13:35:19 - abort(Error: connect ECONNREFUSED 127.0.0.1:6668). Build with -s ASSERTIONS=1 for more info.
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 7.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
7 May 13:35:42 - [info]
Welcome to Node-RED

7 May 13:35:42 - [info] Node-RED version: v1.3.4
7 May 13:35:42 - [info] Node.js version: v12.20.0
7 May 13:35:42 - [info] Linux 5.4.79-v7+ arm LE

rustup.rs 404 ('armv7-unknown-linux-musleabihf' not found)

Hi, I've a Raspberrypi 4 whit docker and the Official Node-RED Docker container.
When I Exec to Docker as Root user, I get this error:

bash-5.0# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh && sh rust.sh -y && rm rust.sh && source $HOME/.cargo/env
info: downloading installer
curl: (22) The requested URL returned error: 404
rustup: installer for platform 'armv7-unknown-linux-musleabihf' not found, this may be unsupported
bash-5.0# 

Any suggestion?
Thanks

Pairing problem

Hey,

I’m using node red official docker image. When I try to pair my Apple TV 4K I’m getting just an error “ No devices retrieved, check your Apple TVs connection settings”. ATV is Running. I have no clue how to debug that.

Greetings

Volume Error

When using the "VolumeUp" or "VolumeDown" commands, it returns an error -

Error: Unable to execute request 1L: /usr/local/lib/python3.8/dist-packages/pyatv/scripts/atvscript.py:313: DeprecationWarning: Call to deprecated function volume_down.
  await getattr(atv.remote_control, args.command)()

What to write in field path of OUT node?

Hi,
analogous to the recommended docker installation I installed pyatv in an exclusive proxmox container without any virtual environment. Node Red is running in a different container.
atvscript is in /usr/local/bin. What should I enter in the field path of the OUT configuration node?
Or do I have to install pyatv in the same container in which Nodered is running?
Thank you for any help1
Graefer

Could not install

My Installation aborts with following mesage
Node Red V2.1.4 on FreeBSD 11

2022-01-15T20:12:18.892Z Install : node-red-contrib-apple-tv-x 0.5.2

2022-01-15T20:12:19.007Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-01-15T20:12:21.792Z [err] npm
2022-01-15T20:12:21.792Z [err]  ERR! code ENOENT
2022-01-15T20:12:21.793Z [err] npm ERR!
2022-01-15T20:12:21.793Z [err]  syscall spawn git
2022-01-15T20:12:21.793Z [err] npm ERR!
2022-01-15T20:12:21.793Z [err]  path git
2022-01-15T20:12:21.793Z [err] npm ERR! errno
2022-01-15T20:12:21.793Z [err]  -2
2022-01-15T20:12:21.795Z [err] npm 
2022-01-15T20:12:21.795Z [err] ERR! enoent Error while executing:
2022-01-15T20:12:21.795Z [err] npm ERR! enoent
2022-01-15T20:12:21.795Z [err]  undefined ls-remote -h -t ssh://[email protected]/ikhilko/node-appletv-x.git
2022-01-15T20:12:21.795Z [err] npm ERR! enoent 
2022-01-15T20:12:21.795Z [err] npm ERR! enoent 
2022-01-15T20:12:21.795Z [err] npm ERR! enoent spawn git ENOENT
2022-01-15T20:12:21.795Z [err] npm 
2022-01-15T20:12:21.795Z [err] ERR! enoent This is related to npm not being able to find a file.
2022-01-15T20:12:21.795Z [err] npm ERR! enoent 
2022-01-15T20:12:21.800Z [err] 
2022-01-15T20:12:21.800Z [err] npm
2022-01-15T20:12:21.800Z [err]  ERR! A complete log of this run can be found in:
2022-01-15T20:12:21.800Z [err] npm ERR!
2022-01-15T20:12:21.800Z [err]      /root/.npm/_logs/2022-01-15T20_12_21_796Z-debug.log
2022-01-15T20:12:21.815Z rc=254

launch_app not working in 0.5.1

Following the RFE to allow IPs/IDs to be manually specified #9 , the launch_app parameter no longer works (but same worked in 0.5.0):

when sending msg.payload set to launch_app=com.netflix.Netflix

debug output
Error: Command failed: atvremote --airplay-credentials abcdefghijklmnopqrstuvwxyz launch_app=com.netflix.Netflix
Scan Results
[...]

From the debug message, it would appear that the command isn't passing the actual device.

Sending a simple command, like "play" and "pause" continues to work fine.

Node configs (to reproduce)
Injection Node:
[{"id":"bd7c8d34.dc5d38","type":"inject","z":"c45155cd.0e34c8","name":"Launch Netflix","topic":"","payload":"launch_app=com.netflix.Netflix","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":1040,"wires":[["caa4d47d.366338"]]}]

ATV Out:
[{"id":"caa4d47d.366338","type":"atvx-out","z":"c45155cd.0e34c8","name":"","atvx":"e7158f3.0ee17f","skip_deprecated":false,"x":750,"y":1300,"wires":[]},{"id":"e7158f3.0ee17f","type":"atvx-config","z":"","name":"Big Screen (manual)","backend":"pyatv","companion":"684aea51228e5c7b68064b148e34471af6736937f831b6795c3751592cf048fe:add0564b0387070eb9796c559797ec5a82d5f0ed16d3914b971ae9ef61cf6fc9:32353041323034422d343136352d344233412d394430362d363042363345443943453430:64373132643230312d623063642d343363332d386334372d393163633465646335373162","debug":true}]

ATV In:
[{"id":"66b3dfa3.5298e","type":"atvx-in","z":"c45155cd.0e34c8","name":"New ATV","atvx":"e7158f3.0ee17f","x":190,"y":1300,"wires":[["caa4d47d.366338"]]},{"id":"e7158f3.0ee17f","type":"atvx-config","z":"","name":"Big Screen (manual)","backend":"pyatv","companion":"684aea51228e5c7b68064b148e34471af6736937f831b6795c3751592cf048fe:add0564b0387070eb9796c559797ec5a82d5f0ed16d3914b971ae9ef61cf6fc9:32353041323034422d343136352d344233412d394430362d363042363345443943453430:64373132643230312d623063642d343363332d386334372d393163633465646335373162","debug":true}]

Feature request: playing/idle/pause status

Great node! Thank you! Finally, something that works in Node Red and no need to use HomeAssistant to get ATV status.
However, I have a request, in HA ATV integration can distinguish between play, pause or idle. It would be great to have this here as well. Idle and playing is implemented already (with isPlaying being true or false), but paused is not.
And in my view it rather important since I e.g do not want to turn on the lights full for a short break but only if I stopped the movie, or when it's totally finished.

After installing - Exception-Code: ENOTDIR: spawn ENOTDIR

Hello,

I'm running node red via I-broker Adapter v3.3.1 and after installing the apple-tv-x node I'm getting this error message in the log

Exception-Code: ENOTDIR: spawn ENOTDIR

Error: spawn ENOTDIR at ChildProcess.spawn (node:internal/child_process:413:11) at spawn (node:child_process:713:9) at execute (/usr/local/iobroker/iobroker-data/node-red/node_modules/@sebbo2002/node-pyatv/dist/lib/tools.js:69:19) at NodePyATVDeviceEvents.startListening (/usr/local/iobroker/iobroker-data/node-red/node_modules/@sebbo2002/node-pyatv/dist/lib/device-events.js:106:42) at NodePyATVDeviceEvents.checkListener (/usr/local/iobroker/iobroker-data/node-red/node_modules/@sebbo2002/node-pyatv/dist/lib/device-events.js:87:18) at NodePyATVDeviceEvents.on (/usr/local/iobroker/iobroker-data/node-red/node_modules/@sebbo2002/node-pyatv/dist/lib/device-events.js:195:14) at NodePyATVDevice.on (/usr/local/iobroker/iobroker-data/node-red/node_modules/@sebbo2002/node-pyatv/dist/lib/device.js:629:21) at Timeout.ATVxConfig.node.doConnectCli [as _onTimeout] (/usr/local/iobroker/iobroker-data/node-red/node_modules/node-red-contrib-apple-tv-x/nodes/config.js:60:20) at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7)

unhandled promise rejection: spawn ENOTDIR

Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch().

18 Dec 09:46:28 - [error] [atvx-config:Wohnzimmer] Error: spawn /usr/local/bin/python/atvscript ENOENT at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:478:16) at processTicksAndRejections (node:internal/process/task_queues:83:21) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7)

which python3 via terminal gives back
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3

Macmini macOS Mojave 10.14.6
8GB Ram
2,6 GHz Intel Core i5

Any help is appreciated - many thanks in advance...!

Regards..

Appltv 4k not recognised in docker

Hi,

I’m using node red official docker image. When I try to pair my Apple TV 4K I’m getting just an error “ No devices retrieved, check your Apple TVs connection settings”. ATV is Running.

I am using below command

sudo docker run -it --net=host -v node_red_data:/data --name nodered5 nodered/node-red still not able to recognise

Pairing code / PIN doesn't appear

My Apple TV shows up in the list but when I click Initiate Connection, nothing appears on the Apple TV so I can't go any further.

Any help appreciated.

tvOS 15.0

Feature request: Show on/off Standby Status

Hi @twocolors ,

is it possible to get the atv status also?
If i install this on my homebridge i get status of the atv over motion sensor. So if i wake up my atv by the remote control or by my iphone, the status switch from off to on.

Right now i installed this on my Node-Red Server and can catch up the paused or playing status. So the problem is, that if i wake up my atv it does not regognize is until i switch to an App and let this play something. So the service works a little drifferent from the homebridge plugin.

It would be great to get a status if the atv is in sleep mode, so the tv is off (by HDMI-CEC) or the atv is awake and wait for an app to start and the tv is on (by HDMI-CEC)

I found the "powerState", but most of the time i get back an "null" status. Sometimes i could catch an "on" status.
Don't know why, but if i put a debug node behind, push on Deploy and i get a lot of payloads at one moment.

Thank you for your work

Possible to manually add ATV ?

Due to networking issues, the pyatv scan isn't finding all my devices, but it can see them when specifying the IP address.

When creating a note in the atvs-config node panel, one is limited to what the scan turns up.

I'd like a way to be able to manually specify an IP address.

"Error: power_state is not supported"

Hi

I just installed the node and the pyatv on my raspberry.
My Raspberry and Apple TV is on different LANs but the lan allows crostalk.

This:

$ atvremote --id 00:11:22:33:44:54 --protocol companion pair
$ atvremote --id 00:11:22:33:44:54 --protocol airplay pair

Doesn't work.

I just get:
2022-04-23 20:30:45 ERROR [pyatv.scripts.atvremote]: Could not find any Apple TV on current network

Searching in the node finds the Apple TV, but when I try to inject any payload I just get this:

Error: Got pyatv Error: power_state is not supported

pyatv Stacktrace:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/pyatv/scripts/atvscript.py", line 302, in appstart
    print(args.output(await _handle_command(args, abort_sem, loop)), flush=True)
  File "/usr/local/lib/python3.7/dist-packages/pyatv/scripts/atvscript.py", line 198, in _handle_command
    return await _run_command(atv, args, abort_sem, loop)
  File "/usr/local/lib/python3.7/dist-packages/pyatv/scripts/atvscript.py", line 218, in _run_command
    output(True, values={"power_state": atv.power.power_state.name.lower()})
  File "/usr/local/lib/python3.7/dist-packages/pyatv/support/shield.py", line 72, in _guard_method
    return func(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pyatv/core/facade.py", line 338, in power_state
    return self.relay("power_state")
  File "/usr/local/lib/python3.7/dist-packages/pyatv/core/relayer.py", line 91, in relay
    target, chain(self._takeover_protocol, priority or self._priorities)
  File "/usr/local/lib/python3.7/dist-packages/pyatv/core/relayer.py", line 114, in _find_instance
    raise exceptions.NotSupportedError(f"{target} is not supported")
pyatv.exceptions.NotSupportedError: power_state is not supported

What am I missing?

"up" input not working

Hey there. Great node, simple to use, however i am having issues with the "up" command, and only that command. All other inputs work as expected. Have you experienced this behavior previously?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.