diff --git a/jvcproj/README.md b/jvcproj/README.md deleted file mode 100755 index 6df5e38e3..000000000 --- a/jvcproj/README.md +++ /dev/null @@ -1,248 +0,0 @@ -# jvcproj - JVC D-ILA Control - -With this plugin you can control JVC D-ILA projectors over TCP by using the "JVC External Control Command Communication Specification" and transfer gammatables generated with jvcprojectortools. - -## Notes -I use the plugin to control my JVC DLA- X5000 and transfer raw gammatables generated with jvcprojectortools by arvehj. Many thanks to arvehjs groundwork so i could have a look in the communication procedure! -You can use all operation commands given in the "JVC External Control Command Communication Specification". Wrong or unknown commands will be ignored by the plugin and the projector. Most of the commands will not be acknowledged when the projector has no input signal. Request commands are not yet supported. -The gamma table configuration files can be raw gamma table files (loaded from the projector with jvcprojectortools) or the configuration files that are generated with jvcprojectortools when you save your parameters. When using these files only the deposited raw gamma data ("table"- data) is needed and will be transfered. - -The plugin should work from the projector generation X3/X7/X9 up to X5900/X7900/X9900 and surely for upcoming generations, too. - -Please use [this thread for support, questions, feedback etc.](https://knx-user-forum.de/forum/supportforen/smarthome-py/1188479-plugin-steuerung-von-jvc-d-ila-projektoren) - -## Configuration - -### plugin.yaml - -```yaml -jvcproj: - plugin_name: jvcproj - host: 1.1.1.1 # host address of the projector - gammaconf_dir: ... # optional, location gamma table configuration files -``` - -#### Attributes - * `host`: the host address of the projector - * `gammaconf_dir`: location where the gammatable configuration files are saved. Default is '/usr/local/smarthome/etc/jvcproj/' - -### items.yaml - -#### operation commands -The plugin uses the raw hex operation commands. A list of all commands (depending on the projectors series) can be found by looking at the JVC support homepage or by searching for JVC projector RS-232 command lists. -Here is a small example for an operation command "Power On" (21 89 01 50 57 31 0A): - - * `21`: Header - an operation command always start with 21 (ASCII: "!") - * `89 01`: Unit ID - is fixed at 89 01 for all models - * `50 57`: Command - varies depending on the command. In this example 50 57 (ASCII: "PW") - * `30`: Data - This is the value to apply to the command. Using the Power example above, the data value for On is 31 (ASCII: "1"). Length varies depending on command (not always 1 byte)! - * `0A`: End - This signifies the end of the command and is fixed at 0A for all models. - -### Example: - -```yaml -jvcproj: - - testcmd: - # command NULL - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 00 00 0A - enforce_updates: True - - pwon: - # command Power ON - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 57 31 0A - enforce_updates: True - - pwoff: - # command Power OFF - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 57 30 0A - enforce_updates: True - - picmode: - - cmdoff: - # command ClearMotionDrive OFF - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 43 4D 30 0A - enforce_updates: True - - cmdlow: - # command ClearMotionDrive LOW - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 43 4D 33 0A - enforce_updates: True - - sdrlow: - # commands to set -picture user 1- and -gamma custom 1- and -gamma correction import- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 50 4D 30 43 0A | 21 89 01 50 4D 47 54 34 0A | 21 89 01 50 4D 47 43 30 34 0A - enforce_updates: True - - sdrhigh: - # commands to set -picture user 2- and -gamma custom 2- and -gamma correction import- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 50 4D 30 44 0A | 21 89 01 50 4D 47 54 35 0A | 21 89 01 50 4D 47 43 30 34 0A - enforce_updates: True - - hdrlow: - # commands to set -picture user 4- and -gamma custom 3- and -gamma correction import- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 50 4D 30 46 0A | 21 89 01 50 4D 47 54 36 0A | 21 89 01 50 4D 47 43 30 34 0A - enforce_updates: True - - hdrhigh: - # commands to set -picture user 3- and -gamma custom 3- and -gamma correction import- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 50 4D 50 4D 30 45 0A | 21 89 01 50 4D 47 54 36 0A | 21 89 01 50 4D 47 43 30 34 0A - enforce_updates: True - - gamma: - - hdrlow: - # command to set gammatable from file to -gamma custom 3- - type: bool - visu_acl: rw - jvcproj_gamma: jvc_gamma_HDR_lowdynamic.conf | custom3 - enforce_updates: True - - hdrmid: - # command to set gammatable from file to -gamma custom 3- - type: bool - visu_acl: rw - jvcproj_gamma: jvc_gamma_HDR_middynamic.conf | custom3 - enforce_updates: True - - hdrhigh: - # command to set gammatable from file to -gamma custom 3- - type: bool - visu_acl: rw - jvcproj_gamma: jvc_gamma_HDR_highdynamic.conf | 21 89 01 50 4D 47 54 36 0A - enforce_updates: True - - lens: - - mem219: - # command to set -lens memory 1- and -lens mask 1- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 49 4E 4D 4C 30 0A | 21 89 01 49 53 4D 41 30 0A - enforce_updates: True - - mem169: - # command to set -lens memory 2- and -lens mask 2- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 49 4E 4D 4C 31 0A | 21 89 01 49 53 4D 41 31 0A - enforce_updates: True - - rc: - # remote control commands - - menu: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 32 45 0A - enforce_updates: True - - ok: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 32 46 0A - enforce_updates: True - - up: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 30 31 0A - enforce_updates: True - - down: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 30 32 0A - enforce_updates: True - - left: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 33 36 0A - enforce_updates: True - - right: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 33 34 0A - enforce_updates: True - - info: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 37 34 0A - enforce_updates: True - - back: - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 52 43 37 33 30 33 0A - enforce_updates: True -``` - -#### jvcproj_cmd: -Item to send one (or more) commands to the projector. The commands must be seperated with a `|`. -When more than one command is given in an item the commands will be sent one after the other until the list is finished or an error occures. -The commands can be listed with or without spaces (21 89 01 50 57 31 0A or 2189015057310A). - -Example to set lens memory 1 (with spaces) and set lens mask to user 1 (without spaces). Commands are seperated with "|"... - -```yaml - mem219: - # command to set -lens memory 1- and -lens mask 1- - type: bool - visu_acl: rw - jvcproj_cmd: 21 89 01 49 4E 4D 4C 30 0A | 21890149534D41300A - enforce_updates: True -``` - -#### jvcproj_gamma: -Item to send a gamma table from a declared file. This item needs exactly two arguments! -The first argument is the name of the gamma table configuration file to be loaded. The file must exist in the declared path in the plugin.yaml (default /usr/local/smarthome/etc/jvcproj/ ). -The second argument is the gamma slot where to load the gamma data. This MUST be a custom gamma table and can be declared with custom1/custom2/custom3 or the compatible hex commands. - -Two examples, both will load the gamma data from file to gamma slot custom 3 -```yaml - hdrmid: - # command to set gammatable from file to -gamma custom 3- - type: bool - visu_acl: rw - jvcproj_gamma: jvc_gamma_HDR_middynamic.conf | custom3 - enforce_updates: True - - hdrhigh: - # command to set gammatable from file to -gamma custom 3- - type: bool - visu_acl: rw - jvcproj_gamma: jvc_gamma_HDR_highdynamic.conf | 21 89 01 50 4D 47 54 36 0A - enforce_updates: True -``` - -### logging -Debug logging informationen for this plugin can be activated in the logging.yaml -```yaml -loggers: -... - plugins.jvcproj: - level: DEBUG -... -``` diff --git a/jvcproj/__init__.py b/jvcproj/__init__.py index c3f42fa0b..f7f3d5268 100755 --- a/jvcproj/__init__.py +++ b/jvcproj/__init__.py @@ -4,7 +4,7 @@ # Copyright 2018 Nico P. # THX to arvehj for the communication procedure (jvcprojectortools) ######################################################################### -# This file is part of SmartHomeNG. +# This file is part of SmartHomeNG. # # SmartHomeNG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -97,7 +97,7 @@ class JVC_DILA_Control(SmartPlugin): the update functions for the items """ ALLOW_MULTIINSTANCE = False - PLUGIN_VERSION='1.0.0' + PLUGIN_VERSION='1.0.1' def __init__(self, smarthome, host='0.0.0.0', gammaconf_dir='/usr/local/smarthome/etc/jvcproj/'): @@ -107,6 +107,7 @@ def __init__(self, smarthome, host='0.0.0.0', gammaconf_dir='/usr/local/smarthom :param gammaconf_dir: location where the gamma.conf files are saved :port is fixed to 20554 """ + super().__init__() self.logger = logging.getLogger(__name__) self._sh=smarthome self.host_port = (host, 20554) @@ -116,7 +117,7 @@ def __init__(self, smarthome, host='0.0.0.0', gammaconf_dir='/usr/local/smarthom def run(self): """ Run method for the plugin - called once to start the plugins processing - """ + """ self.logger.debug("Plugin '{}': run method called".format(self.get_fullname())) self.alive = True @@ -130,7 +131,7 @@ def stop(self): def parse_item(self, item): """ Plugin's parse_item method. Is called for every item when the plugin is initialized. - + The plugin can, corresponding to its attribute keywords, decide what to do with the item in future, like adding it to an internal array for future reference :param item: The item to process. @@ -157,7 +158,7 @@ def parse_logic(self, logic): def update_item(self, item, caller=None, source=None, dest=None): """ Write items values - + :param item: item to be updated towards the plugin :param caller: if given it represents the callers name :param source: if given it represents the source diff --git a/jvcproj/plugin.yaml b/jvcproj/plugin.yaml index 5ffde0822..b584191e5 100755 --- a/jvcproj/plugin.yaml +++ b/jvcproj/plugin.yaml @@ -8,11 +8,9 @@ plugin: maintainer: NPortz tester: '?' state: ready -# keywords: iot xyz -# documentation: https://github.com/smarthomeNG/smarthome/wiki/CLI-Plugin # url of documentation (wiki) page support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1188479-plugin-steuerung-von-jvc-d-ila-projektoren - version: 1.0.0 # Plugin version + version: 1.0.1 # Plugin version sh_minversion: 1.3 # minimum shNG version to use this plugin # sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest) multi_instance: False # plugin supports multi instance @@ -49,12 +47,167 @@ item_attributes: de: 'Bei Aenderung des Items auf WAHR werden die Gammadaten aus der aufgefuehrten Datei in den angegebenen Custom Gammaspeicher (1-3) geladen. Die beiden Attribute muessen durch | getrennt werden.' en: 'Changing this item to true results in sending the gamma table from the declared file to the declared custom gamma table (1-3). The two attributes need to be seperated with a | .' -item_structs: NONE - # Definition of item-structure templates for this plugin +item_structs: + + jvcproj: + + testcmd: + # command NULL + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 00 00 0A + enforce_updates: True + + pwon: + # command Power ON + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 57 31 0A + enforce_updates: True + + pwoff: + # command Power OFF + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 57 30 0A + enforce_updates: True + + picmode: + + cmdoff: + # command ClearMotionDrive OFF + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 43 4D 30 0A + enforce_updates: True + + cmdlow: + # command ClearMotionDrive LOW + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 43 4D 33 0A + enforce_updates: True + + sdrlow: + # commands to set -picture user 1- and -gamma custom 1- and -gamma correction import- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 50 4D 30 43 0A | 21 89 01 50 4D 47 54 34 0A | 21 89 01 50 4D 47 43 30 34 0A + enforce_updates: True + + sdrhigh: + # commands to set -picture user 2- and -gamma custom 2- and -gamma correction import- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 50 4D 30 44 0A | 21 89 01 50 4D 47 54 35 0A | 21 89 01 50 4D 47 43 30 34 0A + enforce_updates: True + + hdrlow: + # commands to set -picture user 4- and -gamma custom 3- and -gamma correction import- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 50 4D 30 46 0A | 21 89 01 50 4D 47 54 36 0A | 21 89 01 50 4D 47 43 30 34 0A + enforce_updates: True + + hdrhigh: + # commands to set -picture user 3- and -gamma custom 3- and -gamma correction import- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 50 4D 50 4D 30 45 0A | 21 89 01 50 4D 47 54 36 0A | 21 89 01 50 4D 47 43 30 34 0A + enforce_updates: True + + gamma: + + hdrlow: + # command to set gammatable from file to -gamma custom 3- + type: bool + visu_acl: rw + jvcproj_gamma: jvc_gamma_HDR_lowdynamic.conf | custom3 + enforce_updates: True + + hdrmid: + # command to set gammatable from file to -gamma custom 3- + type: bool + visu_acl: rw + jvcproj_gamma: jvc_gamma_HDR_middynamic.conf | custom3 + enforce_updates: True + + hdrhigh: + # command to set gammatable from file to -gamma custom 3- + type: bool + visu_acl: rw + jvcproj_gamma: jvc_gamma_HDR_highdynamic.conf | 21 89 01 50 4D 47 54 36 0A + enforce_updates: True + + lens: + + mem219: + # command to set -lens memory 1- and -lens mask 1- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 49 4E 4D 4C 30 0A | 21 89 01 49 53 4D 41 30 0A + enforce_updates: True + + mem169: + # command to set -lens memory 2- and -lens mask 2- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 49 4E 4D 4C 31 0A | 21 89 01 49 53 4D 41 31 0A + enforce_updates: True + + rc: + # remote control commands + + menu: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 32 45 0A + enforce_updates: True + + ok: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 32 46 0A + enforce_updates: True + + up: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 30 31 0A + enforce_updates: True + + down: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 30 32 0A + enforce_updates: True + + left: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 33 36 0A + enforce_updates: True + + right: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 33 34 0A + enforce_updates: True + + info: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 37 34 0A + enforce_updates: True + + back: + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 52 43 37 33 30 33 0A + enforce_updates: True logic_parameters: NONE # Definition of logic parameters defined by this plugin plugin_functions: NONE # Definition of function interface of the plugin - diff --git a/jvcproj/user_doc.rst b/jvcproj/user_doc.rst new file mode 100644 index 000000000..28e7c53ed --- /dev/null +++ b/jvcproj/user_doc.rst @@ -0,0 +1,121 @@ +.. index:: Plugins; jvcproj +.. index:: jvcproj + +======= +jvcproj +======= + +.. image:: webif/static/img/plugin_logo.png + :alt: plugin logo + :width: 300px + :height: 300px + :scale: 50 % + :align: left + +Mit diesem Plugin können JVC D-ILA Projektoren über mittels +"JVC External Control Command Communication Specification" via TCP gesteuert werden. +Außerdem können mit jvcprojectortools erzeugte Gammatabellen übertragen werden. + +Hinweis +======= + +Die meisten Befehle werden nicht quittiert, wenn der Projektor kein Eingangssignal hat. Anfrage +Befehle werden noch nicht unterstützt. Die Gammatabellen-Konfigurationsdateien können +rohe Gammatabellen-Dateien sein (vom Projektor geladen mit +jvcprojectortools geladen) oder die Konfigurationsdateien, die mit +jvcprojectortools erzeugt werden, wenn Sie Ihre Parameter speichern. Bei Verwendung dieser Dateien +werden nur die hinterlegten Gamma-Rohdaten ("Tabellen"-Daten) benötigt und +übertragen. + +Das Plugin sollte ab der Projektorengeneration X3/X7/X9 bis hin zu +X5900/X7900/X9900 und sicherlich auch für kommende Generationen. + +Konfiguration +============= + +Die Informationen zur Konfiguration des Plugins sind unter :doc:`/plugins_doc/config/jvcproj` beschrieben. + +plugin.yaml +----------- + +.. code-block:: yaml + + jvcproj: + plugin_name: jvcproj + host: 1.1.1.1 # host address of the projector + gammaconf_dir: ... # optional, location gamma table configuration files + +Attribute +--------- + +jvcproj_cmd: +^^^^^^^^^^^^ + +Attribut, um einen (oder mehrere) Befehle an den Projektor zu senden. Die Befehle müssen +mit einem ``|`` getrennt werden. Wenn mehr als ein Befehl in einem Element angegeben wird +werden die Befehle nacheinander gesendet, bis die Liste vollständig abgearbeitet ist +oder ein Fehler auftritt. Die Befehle können mit oder ohne Leerzeichen aufgelistet werden +(21 89 01 50 57 31 0A oder 2189015057310A). + +Beispiel: Objektivspeicher 1 setzen (mit Leerzeichen) und Objektivmaske auf Benutzer 1 setzen +(ohne Leerzeichen). Befehle werden mit "|" getrennt. + +.. code-block:: yaml + + mem219: + # command to set -lens memory 1- and -lens mask 1- + type: bool + visu_acl: rw + jvcproj_cmd: 21 89 01 49 4E 4D 4C 30 0A | 21890149534D41300A + enforce_updates: True + +jvcproj_gamma: +^^^^^^^^^^^^^^ + +Attribut zum Senden einer Gammatabelle aus einer angegebenen Datei. Dieses Element benötigt genau +zwei Argumente! Das erste Argument ist der Name der Gammatabelle +Konfigurationsdatei, die geladen werden soll. Die Datei muss im angegebenen +Pfad in der plugin.yaml existieren (standardmäßig /usr/local/smarthome/etc/jvcproj/ ). +Das zweite Argument ist der Gammaslot, in den die Gammadaten geladen werden sollen. Diese +MUSS eine benutzerdefinierte Gammatabelle sein und kann mit +custom1/custom2/custom3 oder den kompatiblen Hex-Befehlen deklariert werden. + +Zwei Beispiele, welche die Gammadaten aus einer Datei in den Gammaslot custom3 laden: + +.. code-block:: yaml + + hdrmid: + # command to set gammatable from file to -gamma custom 3- + type: bool + visu_acl: rw + jvcproj_gamma: jvc_gamma_HDR_middynamic.conf | custom3 + enforce_updates: True + + hdrhigh: + # command to set gammatable from file to -gamma custom 3- + type: bool + visu_acl: rw + jvcproj_gamma: jvc_gamma_HDR_highdynamic.conf | 21 89 01 50 4D 47 54 36 0A + enforce_updates: True + +Kommandoerläuterung +=================== + +Das Plugin verwendet die rohen Hex-Befehle. Eine Liste aller Befehle +(abhängig von der Projektorserie) finden Sie auf der JVC +Support Homepage oder durch die Suche nach JVC Projektor RS-232 Befehlslisten. +Hier ist ein kleines Beispiel für einen Betriebsbefehl "Power On" (21 89 01 50 +57 31 0A): + +- ``21``: Header - ein Betriebsbefehl beginnt immer mit 21 (ASCII: "!") +- ``89 01``: Unit ID - ist für alle Modelle auf 89 01 festgelegt +- ``50 57``: Befehl - variiert je nach Befehl. In diesem Beispiel 50 57 (ASCII: "PW") +- ``30``: Daten - Dies ist der Wert, der auf den Befehl angewendet wird. Mit dem + Power Beispiel oben, ist der Datenwert für On 31 (ASCII: "1"). Länge + variiert je nach Befehl (nicht immer 1 Byte)! +- ``0A``: Ende - Dies bedeutet das Ende des Befehls und ist für alle Modelle gleich. + +Web Interface +============= + +Das Plugin stellt kein Web Interface zur Verfügung. diff --git a/jvcproj/webif/static/img/plugin_logo.png b/jvcproj/webif/static/img/plugin_logo.png new file mode 100644 index 000000000..f085487e5 Binary files /dev/null and b/jvcproj/webif/static/img/plugin_logo.png differ