Code Monkey home page Code Monkey logo

homebridge-cmd-television's Introduction

Homebridge Apple TV command plugin, using pyatv to control your Apple TV

Installation

  1. Install homebridge
  2. Install pyatv pip3 install pyatv
  3. Scan for your Apple TV devices atvremote scan
  4. Authenticate pyatv with your Apple TV, and record the companion credential to a file atvremote -s 192.168.1.10 --protocol companion pair. Please use the IP address of your Apple TV, and put the output into this file ~/.homebridge/atv_companion.cred
  5. Authenticate pyatv with your Apple TV, and record the airplay credential to a file atvremote -s 192.168.1.10 --protocol airplay pair. Please use the IP address of your Apple TV, and put the output into this file ~/.homebridge/atv_airplay.cred
  6. Install this plugin using: sudo npm i -g https://github.com/NorthernMan54/homebridge-cmd-television
  7. Configure accessory (See configuration sample) Thats it! Now when you turn the television on or switch the input to another source it will run the command set in the config.

Configuration

Configuration sample:

"accessories": [
 {
   "accessory": "cmd-television",
   "name": "Main Room TV",
   "oncmd": "atvremote --id 08:66:98:D4:CF:79 --airplay-credentials `cat ~/.homebridge/atv_airplay.cred` --companion-credentials `cat ~/.homebridge/atv_companion.cred` turn_on",
   "offcmd": "atvremote --id 08:66:98:D4:CF:79 --airplay-credentials `cat ~/.homebridge/atv_airplay.cred` --companion-credentials `cat ~/.homebridge/atv_companion.cred` turn_off",
   "pausecmd": "atvremote --id 08:66:98:D4:CF:79 --airplay-credentials `cat ~/.homebridge/atv_airplay.cred` --companion-credentials `cat ~/.homebridge/atv_companion.cred` pause",
   "playcmd": "atvremote --id 08:66:98:D4:CF:79 --airplay-credentials `cat ~/.homebridge/atv_airplay.cred` --companion-credentials `cat ~/.homebridge/atv_companion.cred` play",
   "powerstatecmd": "atvremote --id 08:66:98:D4:CF:79 --airplay-credentials `cat ~/.homebridge/atv_airplay.cred` --companion-credentials `cat ~/.homebridge/atv_companion.cred` power_state"
 }
]

Using with a Synology Docker Installation

Homebridge can be installed on Synology NAS devices, via a Docker container.

When using this plugin with a Synology installation, installation requires additional and altered steps.

Notably, the Synology container only persists the /homebridge path. In order for this plugin to persist across container restarts, it and its dependencies will need to be installed to this path. In turn, two items in the default container configuration must also be changed.

Altered Synology Installation Instructions

First, stop the Homebridge container on the Synology if it is already running. Launch the "Docker" application, and switch to the "Container" page. Power off the container.

Once stopped, edit the Homebridge container. Switch to the "Environment" tab. Modify the "PATH" variable to append an aditional directory at the end: /homebridge/python/bin. Then, add a new variable: "PYTHONPATH"; its value should be /homebridge/python. Power the container on again.

Once the container is running, navigate and log in to the Homebridge UI. Launch a Homebridge Terminal from the upper-right drop-down menu. Then, run the following commands:

mkdir /homebridge/python
apk add gcc openssh python3-dev rust
pip3 install --upgrade pip
pip3 install --target /homebridge/python cryptography
pip3 install --target /homebridge/python pyatv
npm config set ssl-strict=false
npm i --prefix /homebridge https://github.com/NorthernMan54/homebridge-cmd-television

Voila! homebridge-cmd-television and its dependencies are now installed in /homebridge, and should persist through container restarts.

You can now create a configuration and credentials file by following the instructions in the "Installation" section above. Make sure they are placed inside /homebridge.

homebridge-cmd-television's People

Contributors

justinmm2 avatar northernman54 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

justinmm2

homebridge-cmd-television's Issues

Timer to poll status and update HomeKit more frequently?

I was trying to add a timer into this plugin to run getPowerState every every X seconds so that HomeKit is updated more frequently. I am making some Automations based on the status of this accessory, and currently the status only updates when the Home app is opened.

I am not that proficient in coding these types of devices, and I was able to add in a setTimeout (I read SetInterval could backup and cause too many calls) but after the first loop I am getting a crash. Can someone help identify the best place to add this?

If successful, I would like to recommend an option be added into the config to set this status check, or I can fork the code.

Synology container more complicated than I realized

Hola! Couldn't figure out your email from GitHub, so I figured I'd go this route :)

The good news is that the Synology instructions I gave before are still "true"

The bad news is that their utility is limited without modification. The Synology container only persists /homebridge; the rest of the filesystem is part of the container. This means that when you install things like pip modules, they are lost when the container restarts, because they are installed to /usr and don't persist.

If you want your plugin and atvremote installations to persist, it's probably better use the following, revised steps. Note that they require (easy) modification of the container itself:

Homebridge Terminal:

apk add gcc openssh python3-dev rust
pip3 install --upgrade pip
pip3 install --target /homebridge/python cryptography
pip3 install --target /homebridge/python pyatv
atvremote scan
atvremote -s --protocol companion pair
npm config set ssl-strict=false
npm i --prefix /homebridge https://github.com/NorthernMan54/homebridge-cmd-television

(Your apk packages and pip upgrade will not persist, but they don't need to. Also, I don't think the wheel installation is needed in my recent testing)

Synology side:

  1. Open the Synology "Docker" application
  2. Switch to the "Container" page
  3. Stop the homebridge container
  4. Edit the homebridge container
  5. Switch to the "Environment" tab
  6. Modify "PATH" to append an entry for /homebridge/python/bin
  7. Add a new variable "PYTHONPATH"; its value should be /homebridge/python

Hope this helps!

icon in Home app shows as 'home' instead of 'television'

Everything is working great, this is purely cosmetic. In the Home app I'm unable to change the icon shown for the accessory tile, and it is currently represented as a default 'home' or 'house' icon:

image

I think if the characteristic was configured to be a television, it should be possible to show as a TV, similar to my TCL Roku in the following:

image

The icon in the middle is my homebridge-cmd-television accessory.

Location of Credential File

I am not a coder but have generally been able to generally figure this process out from following the readme, @justinmm2 process and the pyatv guides. I have narrowed my issue down to one complication, not knowing where to put the atv.cred file and how to access it properly. I followed @justinmm2 process you put in the read me as I am using Homebridge on Synology Docker. Got a pairing and have created the credential file. I tried putting it in a couple of places and can't figure out where it should go. I think it just goes in the root Homebridge folder. My installation seams to be able to find it but I am getting a permission error.

[12/11/2021, 10:07:00 PM] [AppleTV 2] getPowerState error: Error: Command failed: atvremote -s 192.168.1.3 --companion-credentials `cat ~/atv.cred` power_state
cat: /root/atv.cred: Permission denied
usage: atvremote [-h] [-i ID] [-n NAME] [--address ADDRESS]
                 [--protocol PROTOCOL] [--port PORT] [-t TIMEOUT]
                 [-s SCAN_HOSTS] [--scan-protocols SCAN_PROTOCOLS] [--version]
                 [--remote-name REMOTE_NAME] [-p PIN]
                 [--pairing-guid PAIRING_GUID] [-m]
                 [--raop-password RAOP_PASSWORD]
                 [--dmap-credentials DMAP_CREDENTIALS]
                 [--mrp-credentials MRP_CREDENTIALS]
                 [--airplay-credentials AIRPLAY_CREDENTIALS]
                 [--companion-credentials COMPANION_CREDENTIALS]
                 [--raop-credentials RAOP_CREDENTIALS] [-v] [--debug]
                 [--mdns-debug]
                 command [command ...]
atvremote: error: the following arguments are required: command

Any help would be appreciated.

Error when using the plugin / Cannot read ATV activity status

I have successfully installed and configured the plugin according to the instructions, but I get the following error message when using it:

[21/10/2022, 21:47:16] [homebridge-cmd-television] This plugin threw an error from the characteristic 'Active Identifier': Unhandled error thrown inside write handler for characteristic: The "file" argument must be of type string. Received undefined. See https://homebridge.io/w/JtMGR for more info.
[21/10/2022, 21:47:16] [homebridge-cmd-television] TypeError: The "file" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:387:5)
    at validateString (node:internal/validators:162:11)
    at normalizeSpawnArguments (node:child_process:528:3)
    at spawn (node:child_process:726:13)
    at Object.execFile (node:child_process:331:17)
    at exec (node:child_process:228:25)
    at CmdTelevisionAccessory.setInput (/var/lib/homebridge/node_modules/homebridge-cmd-television/index.js:71:13)
    at ActiveIdentifier.emit (node:events:513:28)
    at /var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1725:16
    at new Promise (<anonymous>)
    at ActiveIdentifier.<anonymous> (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:1723:14)
    at step (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
    at /var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at __awaiter (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:114:16)
    at ActiveIdentifier.Characteristic.handleSetRequest (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/dist/lib/Characteristic.js:824:38)
    at Bridge.<anonymous> (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1812:29)
    at step (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:144:27)
    at Object.next (/var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:125:57)
    at /var/lib/homebridge/node_modules/homebridge/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)`

Is the problem known and where is my error?

Do I understand the sample configuration file correctly, that I swap the MAC address with the one of my Apple TV?

No plugin was found for the accessory "cmd-television" in your config.json.

Hello,

I followed the installation steps and paired with Apple tv, however when I restart the homebridge, it shows No plugin was found for the accessory "cmd-television" in your config.json. Please make sure the corresponding plugin is installed correctly.

I run the command

npm i -g https://github.com/NorthernMan54/homebridge-cmd-television

both in Debian root terminal and HomeBridge terminal without any luck.

Regards,
Uni

Pairung works but nothing else

Hey,

I can successfully pair my Apple TV HD (tvOS 15.1.1), get credentials, fill them in file "atv.cred" in the users home folder, but - i.e. - a command like "atvremote -s IP-ADDRESS --airplay-credentials 'cat file' power_state" results in

2021-11-26 17:42:26 ERROR [pyatv.protocols.airplay]: Failed to set up remote control channel
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/protocols/airplay/__init__.py", line 255, in _connect_rc
    await control.start(str(config.address), control_port, credentials)
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/protocols/airplay/remote_control.py", line 60, in start
    await self._setup_event_channel(self.connection.remote_ip)
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/protocols/airplay/remote_control.py", line 114, in _setup_event_channel
    "name": "pyatv",
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/protocols/airplay/remote_control.py", line 93, in _setup
    body, fmt=plistlib.FMT_BINARY  # pylint: disable=no-member
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/support/rtsp.py", line 175, in setup
    return await self.exchange("SETUP", headers=headers, body=body)
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/support/rtsp.py", line 266, in exchange
    allow_error=allow_error,
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/support/http.py", line 415, in send_and_receive
    response.code,
pyatv.exceptions.HttpError: RTSP/1.0 method SETUP failed with code 400: Bad Request
2021-11-26 17:42:26 ERROR [pyatv.scripts.atvremote]: Command 'power_state' is not supported by device
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/scripts/atvremote.py", line 685, in _exec_command
    value = await tmp(*args)
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/core/facade.py", line 72, in power_state
    return await self.relay("power_state")()
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/core/relayer.py", line 83, in relay
    target, chain(self._takeover_protocol, priority or self._priorities)
  File "/home/pi/.local/lib/python3.7/site-packages/pyatv/core/relayer.py", line 106, in _find_instance
    raise exceptions.NotSupportedError(f"{target} is not supported")
pyatv.exceptions.NotSupportedError: power_state is not supported

Any ideas??

Error on mac os

Hi,
I'm getting error inside homebridge runs on mac os.
Error is: getPowerState error: Error: Command failed: cat /Library/Frameworks/Python.framework/Versions/3.10/bin/atvremote --id AC:BC:32:6B:E8:FD --airplay-credentials cat ~/.homebridge/atv_airplay.cred--companion-credentialscat ~/.homebridge/atv_companion.cred` power_state
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
But if i run the same command in mac os terminal it returns the status correctly with no issues.
Sorry, Im too dumb to understand where is the mistake with file end.
Thank you i advance for help!

Config Syntax Error Config contains invalid JSON

Thanks for this, I really appreciate the work that goes into these.

I was following your instruction on how to set this up. I was able to pair it with my AppleTV and get the credentials. When I go to configure it, using your example I get the following Error from Homebridge

Config Syntax Error
Config contains invalid JSON

I have updated the IP address to my AppleTV's I think my issue is that I am not sure on how to edit the credential file? Do I need to do that?

I am running Homebridge on Synology Docker and used the most recent update to the Readme to get it set up.

This is what I have for my config

{
    "accessory": "cmd-television",
    "name": "AppleTV"
    "oncmd": "atvremote -s 192.168.1.3 --airplay-credentials `cat ~/atv.cred` turn_on",
}

Any help would be greatly appreciated.

Keep daemon alive

I've used the plugin for quite a while, thank you for putting this together.

Only thing is that all commands (even state update) take around 7/8 secs to perform, it looks like every time a command is sent, the plugin has to go all over the trouble of re-authenticating again. It there a way to make it faster?

I'm running Raspberry Pi 3 and found this that could be helpful.

postlund/pyatv#649

unable to run altered synology install

mkdir /homebridge/python
apk add gcc openssh python3-dev rust
pip3 install --upgrade pip
pip3 install --target /homebridge/python cryptography
pip3 install --target /homebridge/python pyatv
npm config set ssl-strict=false
npm i --prefix /homebridge https://github.com/NorthernMan54/homebridge-cmd-television

the 2nd command responds with... "bash: apk: command not found" ... did this the first time and it worked months ago, but now it doesn't? stumped

Not for Windows?

I'm running Homebridge on Windows. I was able to get pyatv installed and get the ATV credentials the way you outlined. However, after installing the plugin, Homebridge keeps giving me an error message that it can't load the plugin.

I'm guessing this won't work in Windows? (Or else I'm doing something wrong).

Can you recommend any pyatv plugins that will work in Windows?

Unable to install pyatv on Synology

Hello.

I know that you are not responsible of pyatv but you are the only one that I found that have make it work in a Synology NAS and I have already made my question into all the other repositories.

I have a DS418 without Docker capabilities. Homebridge is installed natively on DSM 7.0.1 and Entware is providing the gcc building tools as per Oznu's instructions. But when I try to install the pyatv package, I get the error log that you can see below. It seems that the builder cannot be executed.

Do you have any ideas or suggestions about what can I try?

Error log

Building wheels for collected packages: miniaudio
  Building wheel for miniaudio (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.8
      copying miniaudio.py -> build/lib.linux-aarch64-3.8
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-3.8/_miniaudio.c'
      creating build/temp.linux-aarch64-3.8
      building '_miniaudio' extension
      creating build/temp.linux-aarch64-3.8/build
      creating build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8
      /usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_ARMV8 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DSYNO_RUNNING_DSM_BUILD_SYSTEM -g -pipe -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DMA_NO_GENERATION=1 -DMA_NO_ENCODING=1 -I/tmp/pip-install-a38odory/miniaudio_f4e6959e99c84a52a5ac33fba9cd1869 -I/tmp/pip-install-a38odory/miniaudio_f4e6959e99c84a52a5ac33fba9cd1869 -I/usr/include/python3.8 -c build/temp.linux-aarch64-3.8/_miniaudio.c -o build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8/_miniaudio.o -g1 -O3 -ffast-math
      unable to execute '/usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc': No such file or directory
      error: command '/usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc' failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for miniaudio
  Running setup.py clean for miniaudio
Failed to build miniaudio
Installing collected packages: miniaudio, cryptography, aiohttp, pyatv
  Running setup.py install for miniaudio ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for miniaudio did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running install
      /usr/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.8
      copying miniaudio.py -> build/lib.linux-aarch64-3.8
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-3.8/_miniaudio.c'
      creating build/temp.linux-aarch64-3.8
      building '_miniaudio' extension
      creating build/temp.linux-aarch64-3.8/build
      creating build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8
      /usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -DSYNOPLAT_F_ARMV8 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DSYNO_RUNNING_DSM_BUILD_SYSTEM -g -pipe -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DMA_NO_GENERATION=1 -DMA_NO_ENCODING=1 -I/tmp/pip-install-a38odory/miniaudio_f4e6959e99c84a52a5ac33fba9cd1869 -I/tmp/pip-install-a38odory/miniaudio_f4e6959e99c84a52a5ac33fba9cd1869 -I/usr/include/python3.8 -c build/temp.linux-aarch64-3.8/_miniaudio.c -o build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8/_miniaudio.o -g1 -O3 -ffast-math
      unable to execute '/usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc': No such file or directory
      error: command '/usr/local/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-wrap-gcc' failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> miniaudio

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

how to output creds into specific folder?

Greetings, I'm trying to put the output file on my synology/homebridge directly in the /homebridge folder.

I'm a bit stumped on what to append to 'atvremote -s 192.168.1.10 --protocol companion pair' to get the output to save directly there?

Any help would be appreciated :/

Unable to change room

Aside from the inability to change the icon of the apple tv, i'm also unable to change rooms via the Home app in iOS (changing via Home in macOS works). It keeps reverting back to "Equipment Room" which is where all my new devices start.

TV or not TV

No recent responses on here at all, so not expecting much, but here goes.

What would be the possibility of having an additional config option to control whether the accessory is presented as a TV, or a simple Switch?

A TV accessory looks better, but cannot be accessed in third party HomeKit apps, whereas a switch can. Functionality basically the same in each case.

This is a Homebridge Cmd Television issue really, but maybe a push from here might help?

TV or Apple TV?

I was under the impression that when 'TV' is mentioned in the instructions/Wiki, it actually means Apple TV, but then talks about the command being run 'when changing inputs'. Since an ATV only has a single input, I am now puzzled.

Is this plug-in solely to do with the Apple TV, in which case, why mention changing inputs? Or if it is somehow associated with some other actual TV, then how? I see no reference to any other device.

Some clarification on the above would be appreciated.

Can I assume I can install additional accessories to access multiple Apple TVs? Obviously would need to point to the relevant credentials files.

Can't install homebridge-cmd-television on homebridge pi3

Hi @NorthernMan54
kudos & awesome work and I appreciate your work.

I have Homebridge v1.3.6 running on
*** Homebridge Raspbian v1.0.25 - Raspberry Pi 3 Model B Rev 1.2 ***
and I can now control my AppleTV using the
atvremote -s 192.168.1.167 --airplay-credentials cat ~/atv.credturn_on
command... nice, finally we can start the AppleTV with iOS15 again...

yet now I need to get into the homebridge plugin
when trying to install your plugin I get the following error...

(pyatv_venv) pi@homebridge:~ $ sudo npm i -g https://github.com/NorthernMan54/homebridge-cmd-television

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/NorthernMan54/homebridge-cmd-television.git
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

when trying without sudo I get
npm i -g https://github.com/NorthernMan54/homebridge-cmd-television

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/homebridge-cmd-television
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/homebridge-cmd-television'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/homebridge-cmd-television'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/homebridge-cmd-television'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

I tried also using the homebridge-config-ui-x v4.41.2 but there are many homebridge-cmd-television plugins that fail to install...
Any pointers?

cheers

Error: Cannot find module 'request'

Hello @NorthernMan54,

I would like to use your plugin. Thanks for your work!

Unfortunately I run into an error when I set it up your plugin and I can't figure out why. It looks like something is missing from the plugin? I have reinstalled it several times.

Attached is an excerpt from the log and my config.json.

I hope you can help me further?
Thank you!

Bildschirmfoto 2022-01-31 um 14 17 02

e further?

Bildschirmfoto 2022-01-31 um 14 15 29

powerstate error

[4/21/2022, 10:50:48] [cmd-television] getPowerState error: Error: Command failed: atvremote --id AA:AA:AA:AA:AA --airplay-credentials `cat /homebridge/atv_airplay.cred` --companion-credentials `cat /homebridge/atv_companion.cred` power_state
usage: atvremote [-h] [-i ID] [-n NAME] [--address ADDRESS]
                 [--protocol PROTOCOL] [--port PORT] [-t TIMEOUT]
                 [-s SCAN_HOSTS] [--scan-protocols SCAN_PROTOCOLS] [--version]
                 [--remote-name REMOTE_NAME] [-p PIN]
                 [--pairing-guid PAIRING_GUID] [-m]
                 [--raop-password RAOP_PASSWORD]
                 [--dmap-credentials DMAP_CREDENTIALS]
                 [--mrp-credentials MRP_CREDENTIALS]
                 [--airplay-credentials AIRPLAY_CREDENTIALS]
                 [--companion-credentials COMPANION_CREDENTIALS]
                 [--raop-credentials RAOP_CREDENTIALS] [-v] [--debug]
                 [--mdns-debug]
                 command [command ...]
atvremote: error: unrecognized arguments: PIN on screen: Pairing seems to have succeeded, yey! You may now use these credentials: 1234567883a80b24b0b7bfdc572f6af683c4ad70c8efd24:36ce6b64a89ed21b59426d66e42ff1a2cc12a59fac05bcaded9ff1d3be1562e2:37304338314535412d323446342d344338382d424430452d354244303245363442354633:38336439613431652d323466352d346634342d396232302d363231621238491231236666 power_state

I'm getting the error above and the Home app shows the Apple TV as not connected... any advice on this, stumped? :(

Getting architecture error in Homebridge. Is the issue with my Python or my pyatv install or something else?

Hi, ultra noob here but pretty good at following instructions.

Any idea what is wrong with my install? I can get atvremote commands to work in terminal, but keep getting architecture errors in homebridge using the plugin. Thanks for the help.

[10/28/2022, 2:30:36 AM] [cmd-television] getPowerState error: Error: Command failed: /Users/XXX/pyatv_venv/bin/atvremote --id 58:D3:49:E7:61:B3 --airplay-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_airplay.cred` --companion-credentials `cat /Users/XXX/Documents/Homebridge/Credentials/atv_companion.cred` power_state
Traceback (most recent call last):
  File "/Users/XXX/pyatv_venv/bin/atvremote", line 5, in <module>
    from pyatv.scripts.atvremote import main
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/__init__.py", line 18, in <module>
    from pyatv.core.scan import (
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/core/scan.py", line 32, in <module>
    from pyatv.helpers import get_unique_id
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/pyatv/helpers.py", line 6, in <module>
    import miniaudio
  File "/Users/XXX/pyatv_venv/lib/python3.10/site-packages/miniaudio.py", line 22, in <module>
    from _miniaudio import ffi, lib
ImportError: dlopen(/Users/XXX/pyatv_venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so, 0x0002): tried: '/Users/XXX/pyatv_venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))`

Doesn't turn on or off

When I try to turn off or on Apple TV from my Home app it does nothing. It is set to HDMI 1 in Home App, but it is actually on HDMI4 (not an option) Is this the issue?

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.