Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
dont mention lamp if laser
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed Feb 17, 2024
1 parent a0552cf commit 988b55b
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 83 deletions.
2 changes: 1 addition & 1 deletion custom_components/jvc_projectors/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://github.com/iloveicedgreentea/jvc_homeassistant",
"requirements": [
"pyjvc==4.0.0"
"pyjvc==4.1.0"
],
"ssdp": [],
"zeroconf": [],
Expand Down
11 changes: 9 additions & 2 deletions custom_components/jvc_projectors/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ def extra_state_attributes(self):
"""Return extra state attributes."""
# Separate views for models to be cleaner
if self._state:
return asdict(self.jvc_client.attributes)
all_attr = asdict(self.jvc_client.attributes)
# remove lamp stuff if its a laser
if "NZ" in self.jvc_client.model_family:
all_attr.pop("lamp_power")
all_attr.pop("lamp_time")

return all_attr

return {
"power_state": self._state,
Expand Down Expand Up @@ -305,7 +311,6 @@ async def async_update(self):
[
(self.jvc_client.get_source_status, "signal_status"),
(self.jvc_client.get_picture_mode, "picture_mode"),
(self.jvc_client.get_lamp_time, "lamp_time"),
(self.jvc_client.get_software_version, "software_version"),
]
)
Expand Down Expand Up @@ -342,11 +347,13 @@ async def async_update(self):
(self.jvc_client.get_laser_power, "laser_power"),
(self.jvc_client.get_laser_mode, "laser_mode"),
(self.jvc_client.is_ll_on, "low_latency"),
(self.jvc_client.get_lamp_time, "laser_time"),
]
)
else:
attribute_getters.append(
(self.jvc_client.get_lamp_power, "lamp_power"),
(self.jvc_client.get_lamp_time, "lamp_time"),
)

for getter, name in attribute_getters:
Expand Down
298 changes: 292 additions & 6 deletions info.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JVC Projector Remote Improved Home Assistant
# JVC Projectors Home Assistant Integration

This is the Home Assistant JVC Component implementing my [JVC library](https://github.com/iloveicedgreentea/jvc_projector_improved)

Expand All @@ -10,11 +10,13 @@ All the features in my [JVC library](https://github.com/iloveicedgreentea/jvc_pr
- Power
- Picture Modes
- Laser power and dimming
- Low Latency meta-functions
- Optimal gaming and movie setting meta-functions
- and so on
- Pretty much every JVC command
- Entity Attributes for current settings like power state, picture mode, laser mode, input, etc
- Async processing

Because everything is async, it will run each button/command in the order it received. so commands won't disappear from the queue due to JVCs PJ server requiring the handshake. It uses a single persistent connection so any delay you see is because of HA processing.
Note: JVC projectors currently only support a single network connection at a time. If you're running other control systems or attempt to run the JVC AutoCal software, keep in mind you can only have one control system connected at a time.

Note: Only NX and NZ series are officially supported but this should work with any JVC projector that has an ethernet port.

## Installation

Expand All @@ -27,15 +29,299 @@ You can also just copy all the files into your custom_components folder but then
### Home Assistant Setup
This uses Config Flow. Install the custom component, restart, then add an integration as you normally do. Search JVC, and find the one that shows a box icon next to it. There is an official JVC Integration but it is limited and unrelated to this one.

*upon HA restart, it will automatically reconnect. No action is needed from you*

### Adding attributes as sensors

replace nz7 with the name of your remote entity
```yaml
sensor:
platform: template
sensors:
jvc_installation_mode:
value_template: >
{% if is_state('remote.nz7', 'on') %}
{{ states.remote.nz7.attributes.installation_mode }}
{% else %}
Off
{% endif %}
```
### Attributes
These are the attributes supported for the entity
* power_state
* signal_status
* picture_mode
* installation_mode
* laser_power
* laser_mode
* lamp_power
* model
* content_type
* content_type_trans (the transition - sdr or hdr)
* hdr_data
* hdr_processing
* hdr_level
* theater_optimizer
* low_latency
* input_mode
* input_level
* color_mode
* aspect_ratio
* eshift
* mask_mode
* software_version
* lamp_time
## Usage
Use the `remote.send_command` service to send commands to the projector.

`$command,$parameter`
example: "anamorphic,off"
example: "anamorphic,d"
example: "laser_dim,auto3"

It also supports using remote codes as ASCII [found here](https://support.jvc.com/consumer/support/documents/DILAremoteControlGuide.pdf) (Code A only)

example: "remote,2E"

```
Currently Supported Commands:
anamorphic
aperture
aspect_ratio
color_mode
content_type
content_type_trans
enhance
eshift_mode
get_model
get_software_version
graphic_mode
hdr_data
hdr_level
hdr_processing
input_level
input_mode
installation_mode
lamp_power
lamp_time
laser_mode
laser_power
low_latency
mask
menu
motion_enhance
picture_mode
power
remote
signal_3d
source_status
theater_optimizer
Currently Supported Parameters:
AnamorphicModes
off
a
b
c
d
ApertureModes
off
auto1
auto2
AspectRatioModes
zoom
auto
native
ColorSpaceModes
auto
YCbCr444
YCbCr422
RGB
ContentTypeTrans
sdr
hdr10_plus
hdr10
hlg
ContentTypes
auto
sdr
hdr10_plus
hdr10
hlg
EnhanceModes
zero
one
two
three
four
five
six
seven
eight
nine
ten
EshiftModes
off
on
GraphicModeModes
standard
hires1
hires2
HdrData
sdr
hdr
smpte
hybridlog
hdr10_plus
none
HdrLevel
auto
min2
min1
zero
plus1
plus2
HdrProcessing
hdr10_plus
static
frame_by_frame
scene_by_scene
InputLevel
standard
enhanced
superwhite
auto
InputModes
hdmi1
hdmi2
InstallationModes
mode1
mode2
mode3
mode4
mode5
mode6
mode7
mode8
mode9
mode10
LampPowerModes
normal
high
LaserModes
off
auto1
auto2
auto3
LaserPowerModes
low
med
high
LowLatencyModes
off
on
MaskModes
on
off
MenuModes
menu
lens_control
up
down
back
left
right
ok
MotionEnhanceModes
off
low
high
PictureModes
film
cinema
natural
hdr
thx
frame_adapt_hdr
user1
user2
user3
user4
user5
user6
hlg
hdr_plus
pana_pq
filmmaker
frame_adapt_hdr2
frame_adapt_hdr3
PowerModes
off
on
PowerStates
standby
on
cooling
reserved
emergency
SourceStatuses
logo
no_signal
signal
TheaterOptimizer
off
on
ThreeD
auto
sbs
ou
2d
```

## Useful Stuff

I used this to re-create the JVC remote in HA. Add the YAML to your dashboard to get a grid which resembles most of the remote. Other functions can be used via remote.send_command. See the library readme for details.

Add this sensor to your configuration.yml. Replace the nz7 with the name of your entity. Restart HA.

### Automating HDR modes per Harmony activity
```yaml
alias: JVC - HDR PM Automation
description: ""
trigger:
- platform: state
entity_id:
- remote.nz7
attribute: content_type
condition:
- condition: not
conditions:
- condition: state
entity_id: remote.nz7
attribute: content_type
state: sdr
action:
- if:
- condition: state
entity_id: select.harmony_hub_2_activities
state: Game
then:
- service: remote.send_command
data:
command: picture_mode,hdr10
mode: single
```

### Remote in UI
```yaml
sensor:
platform: template
- platform: template
sensors:
jvc_low_latency:
value_template: >
Expand Down
Loading

0 comments on commit 988b55b

Please sign in to comment.