Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonyprojector] Add new channel to send infrared remote commands #15753

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

lolodomo
Copy link
Contributor

Fix #15409

Signed-off-by: Laurent Garnier [email protected]

@lolodomo lolodomo added the enhancement An enhancement or new feature for an existing add-on label Oct 14, 2023
@lolodomo lolodomo self-assigned this Oct 14, 2023
@lolodomo lolodomo marked this pull request as draft October 14, 2023 12:51
@lolodomo
Copy link
Contributor Author

lolodomo commented Oct 14, 2023

@morph166955 : here is the PR you are waiting for. It works perfectly with my projector. I still have to add all IR codes to consider it as finished.

@morph166955
Copy link
Contributor

Awesome! I'll pull it down and get my remote all programmed up to test it out in the next few days. THANK YOU!

@morph166955
Copy link
Contributor

I love dependencies...

2023-10-14 15:02:27.475 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.sonyprojector-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonyprojector [297]
Unresolved requirement: Import-Package: org.openhab.core.io.transport.serial

@lolodomo
Copy link
Contributor Author

Try something like: feature:install openhab-transport-serial

@morph166955
Copy link
Contributor

Did a test today...

POWER_* works.
HDMI1/HDMI2 do not work.
INPUT_TOGGLE works.
COMPONENT switches it to HDMI2
SVIDEO does nothing
VIDEO does nothing
INPUTA switches it to HDMI1
MENU works
TOP/BOTTOM/LEFT/RIGHT/ENTER work (should it be UP/DOWN not TOP/BOTTOM?)
CONTRAST, BRIGHTNESS, COLOR, HUE, SHARPNESS work
MOTIONFLOW works
MOTION_ENHANCER and BLACK_LEVEL both seem to change something called CONTRAST ENHANCER
FILM_PROJECTION, PITCH, SHIFT do nothing. (SHIFT is SHUFT on the readme)

Buttons on my remote not listed:
9x calibrated presets
PATTERN
RESET
ASPECT
MOTIONFLOW
3D
COLOR SPACE
COLOR TEMP
COLOR CORRECTION
GAMMA CORRECTION
REALITY CREATION

Tests were performed by simply sending strings to the channel/item via karaf console.

@lolodomo
Copy link
Contributor Author

Of course, some codes are specific to certain models.
But I was not expecting same feature done by different codes depending on model (HDMI1, HDMI2). That is something I have to check in the documentations I have.
Maybe I will have to define different codes for each model.
Can you tell me what is your model please ?

@morph166955
Copy link
Contributor

This is the VPL-VW285ES. It's about 5 years old. Was one of the first 4K projectors.

Would it be better here to provide direct access to the hex and rely on a translation similar to how the global cache does for IR codes?

@morph166955
Copy link
Contributor

Is it possible that the IR command is more INPUT1, INPUT2, etc rather than COMPOSITE, S-VIDEO, etc when stretched across the products? I don't have analog sources on mine.

Buttons that would be very useful are PATTERN, ZOOM, and FOCUS for alignment.

@lolodomo
Copy link
Contributor Author

I will probably remove all codes that are useless because we already have other channels for these controls. For example, direct input selection is useless here.
I can allow an hexa code (4 letters) as command value but this will be useless for users as they will not know what codes they can use.

@morph166955
Copy link
Contributor

I had a similar issue with the AndroidTV binding. So many different vendors, each supported different keys on their bus. I ended up including a list at the bottom of the readme for the 300+ different possible codes. The biggest things for me would be the pattern and the adjustments for zoom, focus, and things along those lines. I really only use the remote to align/re-align the projector to the screen. Otherwise yes, it's mostly just power and input for me. Occasionally I need to get into the menu and navigate around to see what kind of signal it's getting from the receiver.

@lolodomo
Copy link
Contributor Author

Here is a new version with more IR codes. @morph166955 : you should find all your IR commands ... except the PATTERN that is very strangely not documented !
Regarding the codes to select input HDMI 1 and HDMI 2, strangely some projectors (including yours) are reusing codes that are normally reserved for some other kinds of input ! So I will have to add a kind of exceptions to provide the good codes depending on model. This is the only case I discovered where same codes are used for different result depending on model.
Note that the IR commands to directly select a picture mode (calibration preset) have a generic name from 1 to 9 because each picture mode name vary depending on model.
The last other thing remaining to add is few missing IR codes to control 2D/3D settings.

sonyproj.zip

@morph166955
Copy link
Contributor

Awesome! So weird that PATTERN doesn't have a string. That's super annoying too, it's probably the single most important button on the remote for me in terms of getting the projector set/reset. I like that I can send the direct hex strings, I can try to pop through a few one day to see if I can dig it up and let you know. I would be intrigued to go dig out the commands from something like the globalcache IR database and see if they match in some way (which could help uncover those missing ones).

In respect to the input reuse, can you categorize them as "ones with analog inputs" versus "ones with only digital inputs"? I would wonder if, when they went to ones with strictly HDMI inputs, they just started to reuse.

I'll see if I can give this a test shot in the morning, I should have a little free time. Thank you!

@morph166955
Copy link
Contributor

Sorry I ran out of time to test it. I'll be back at the projector this weekend.

@lolodomo
Copy link
Contributor Author

Sorry I ran out of time to test it. I'll be back at the projector this weekend.

By the way, wait a little, I will change my code to improve it.

@morph166955
Copy link
Contributor

Works for me. I may try to move through the IR codes to see if I can find pattern if I get some free time. Otherwise I'll hold on testing.

@morph166955
Copy link
Contributor

Just compiled a jar from your most recent commit. Found PATTERN (sort of). It seems to activate when I run LENS_CONTROL, LENS_ZOOM, or LENS_FOCUS which is fine by me. I also noticed HDMI1 and HDMI2 are now working as expected. I can't see anything else going on with it of concern. I saw a few typos in the readme but that's about it. THANK YOU!

Copy link
Contributor

@morph166955 morph166955 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few typographical things to update. Otherwise LGTM.

@lolodomo lolodomo force-pushed the sonyprojector_ir_commands branch 2 times, most recently from c6670df to 17ee2b5 Compare November 5, 2023 20:00
@lolodomo
Copy link
Contributor Author

lolodomo commented Nov 5, 2023

Still not yet ready for review even if it is now almost clean. I still need to add few missing IR codes and I have to test it fully again (not done with the last changes).

@lolodomo lolodomo marked this pull request as ready for review December 11, 2023 23:47
@lolodomo
Copy link
Contributor Author

lolodomo commented Dec 11, 2023

PR is now ready for review.
@jlaur : I would really appreciate if you could review before 4.1 code is frozen. Lot of new lines are in fact definition of new IR codes.

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM - only some very minor comments for consideration.

@lolodomo
Copy link
Contributor Author

@jlaur : many thanks for your so quick review.

@lolodomo
Copy link
Contributor Author

@jlaur : all your comments are now handled. I also added missing translation keys for the new channel options.

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jlaur jlaur merged commit 3972dde into openhab:main Dec 12, 2023
3 checks passed
@jlaur jlaur added this to the 4.1 milestone Dec 12, 2023
@lolodomo lolodomo deleted the sonyprojector_ir_commands branch December 12, 2023 22:26
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sonyprojector] Ability to send cursor/key commands
3 participants