Skip to main content

A small package to control jvc projectors over IP

Project description

JVC Projector Remote

This is a simple package to control JVC Projectors over IP. Created to be used with my Homeassistant custom component: bezmi/hass_custom_components. Works fine as a standalone module.

Currently supports:

  • Power on/off
  • Lens Memory
  • Input (HDMI only)
  • Power Status (Standby, Cooling, Emergency, Lamp On, Reserved)
  • Low Latency Mode

Raise an issue if you would like any extra commands implemented. Alternatively pull requests are more than welcome and adding new commands is trivial. See Below.

Installation

PyPi

Install this package from PyPi with:

pip install jvc_projector_remote

From this repo

Install from this repo with:

pip install -e git+https://github.com/bezmi/jvc_projector.git#egg=jvc-projector-remote

Usage

For usage with homeassistant, see here.

Here is an example for using this module standalone:

>>> from jvc_projector import JVCProjector

 # replace with your projector's local IP
>>> host = "192.168.1.12"

 # replace with your projector's network password (if applicable)
>>> password = "MYPASSWORD"

# initialise
>>> projector = JVCProjector(host)

# initialise (alternate, with network password)
>>> projector = JVCProjector(host, password)

# power on, power off
>>> projector.power_on()
# check status once it's on
>>> projector.is_on()
True

>>> projector.power_off()
# check if it's off
>>> projector.is_on()
False

# Send arbitrary command
# possibilities include:
#   - memory1, memory2, memory3, memory4, memory5
#   - hdmi1, hdmi2
#   - add new commands to the Commands class in __init__.py
>>> projector.command("hdmi2")

Testing

I wrote this to interface my projector with homeassistant. The code to send/receive commands is rough and the error checking could be more robust. It has been tested on a DLA-X5900, but should work on most of the projectors that use a similar IP control scheme. Let me know if it works with your projector and I will add it to the list below.

Confirmed Models

  • DLA-X5900
  • NX5
  • NZ8/RS3100

Bugs

The main issue one might face is receiving ConnectionRefusedError when making a request too soon after another. On my DLA-X5900, it takes about 600-700 ms between commands.

Improvements

  • Currently I group all power states into either "on" or "off". I might separate these in future.
  • ACK for all commands might be useful, but it's reliable enough without it.

Adding New Commands

Step 1

Page 25 of this reference shows that the function is PMPM for "Picture Mode Switch". The hex representation of these ASCII characters in pythonic format is:

b"\x50\x4D\x50\x4D"

Step 2

The relevant picture modes are presented in Table 4-19 on Page 30. Let's take 01 for the "Cinema" preset:

b"\x30\x31"

Step 3

Finally, the examples on page 42 show what we need to append to the start and end of the command string. In the end, the final command added to the Commands Enum in __init__.py becomes:

class Commands(Enum):
    # ...
    # ALL THE OTHER COMMAND STRINGS...
    # ...
 
    pm_cinema = b"\x21\x89\x01\x50\x4D\x50\x4D\x30\x31\x0A"

Step 5

Just change the value of step 2 for the remaining input modes you want. You should be able to use it like any of the other commands, with either the JVCProjector.command() function in this module or the remote.send_command service in Home Assistant using "pm_cinema" as the command string.

Inconsistencies

One of the reasons I held off on this is that the commands from step 2 will be slightly different for older projectors. The picture mode is represented by one byte/character. In this case, for the "Cinema" mode, we would use:

b"\x31"

Instead of the two byte code in step 2.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jvc_projector_remote-0.1.1.post1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jvc_projector_remote-0.1.1.post1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file jvc_projector_remote-0.1.1.post1.tar.gz.

File metadata

File hashes

Hashes for jvc_projector_remote-0.1.1.post1.tar.gz
Algorithm Hash digest
SHA256 049a41c1681d4f769487b50fd64b0590e447f5e53e57b70cc7d4ff42dfe08af3
MD5 bf1bf3656eccdf25bf365bac731c634b
BLAKE2b-256 7537a42bdf95cfd5e648bf291e52370a8b799be449d688251cfc6d9f918c17da

See more details on using hashes here.

File details

Details for the file jvc_projector_remote-0.1.1.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for jvc_projector_remote-0.1.1.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 471ab4f96bd806b849100714c905171af4e6f68648a6ab8bbb770b8cb913c2b4
MD5 6d4a4f9b923c21e93961da0977a64f21
BLAKE2b-256 18aff693680ec6b9a747ed30ae9374e44c45ddb73a4f05b4233d91f9bb35c86f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page