@Rickytr and @ganesh.ingle taking aside the the refresh rate for now, I was able to reproduce the sane #2758 issue with HDMI on my Yamaha AVR.
I made some changes in an attempt to fix the HDMI input selection.
Could you guys verify on your AVRs ?
Here is what I observed:
- My Yamaha requires
HDMI1
as command and reports HDMI1
on status update.
- The 2.2 Yamaha binding converts the
HDMI1
to HDMI_1
which causes the error on my Yamaha model (and probably for @Rickytr). Looking at the code comments, this was required by some Yamaha models. Unfortunately, this breaks other models
Here is the proposed implemented fix:
- I have added a thing configuration that allows the user to map input names and customize for their specific AVR. It works in this way:
- When input status update is obtained the addon checks if there is user defined mapping it could use
- Otherwise, it falls back to the existing logic (i.e. HDMI1 => HDMI_1)
- This should work for other edge cases (i.e.
USB
, iPod_USB
)
- Here is how you configure the mapping (PaperUI > Configuration > Things > Edit > Yamaha Receiver XXX):
How to deploy the fix?
- Make sure you are on OH2.2.
- Download JAR from DropBox
- Drop the JAR into your
addons
folder.
- If needed adjust the mapping setting in the thing configuration.
Debugging
If you want to see some useful logs while debugging add something like this to userdata\etc\org.ops4j.pax.logging.cfg
log4j2.logger.yamaha.name = org.openhab.binding.yamahareceiver
log4j2.logger.yamaha.level = TRACE
After binding init you should see something like this:
2017-10-07 15:21:18.723 [TRACE] [ernal.protocol.xml.InputConverterXML] - User defined mapping: HDMI1=HDMI1,HDMI2=HDMI2,HDMI3=HDMI3,HDMI4=HDMI4,HDMI5=HDMI5,HDMI6=HDMI6
2017-10-07 15:21:18.726 [TRACE] [ernal.protocol.xml.InputConverterXML] - Number of user defined mappings found: 6
2017-10-07 15:21:18.905 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name Spotify to Spotify
2017-10-07 15:21:18.912 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name JUKE to JUKE
2017-10-07 15:21:18.919 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name MusicCast Link to MUSICCAST_LINK
2017-10-07 15:21:18.915 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AirPlay to AIRPLAY
2017-10-07 15:21:18.930 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name SERVER to SERVER
2017-10-07 15:21:18.944 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name NET RADIO to NET_RADIO
2017-10-07 15:21:18.947 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name Bluetooth to Bluetooth
2017-10-07 15:21:18.947 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name USB to USB
2017-10-07 15:21:18.956 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name TUNER to TUNER
2017-10-07 15:21:18.967 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI1 to HDMI1 - as per user defined mapping
2017-10-07 15:21:18.970 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI2 to HDMI2 - as per user defined mapping
2017-10-07 15:21:18.973 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI3 to HDMI3 - as per user defined mapping
2017-10-07 15:21:18.975 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI4 to HDMI4 - as per user defined mapping
2017-10-07 15:21:18.978 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI5 to HDMI5 - as per user defined mapping
2017-10-07 15:21:18.982 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI6 to HDMI6 - as per user defined mapping
2017-10-07 15:21:18.990 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AV1 to AV1
2017-10-07 15:21:18.990 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AV2 to AV2
2017-10-07 15:21:18.999 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AV3 to AV3
2017-10-07 15:21:18.999 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AUDIO1 to AUDIO1
2017-10-07 15:21:19.002 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AUDIO2 to AUDIO2
2017-10-07 15:21:19.006 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AUDIO3 to AUDIO3
2017-10-07 15:21:19.009 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name AUX to AUX
2017-10-07 15:21:19.013 [TRACE] [.protocol.xml.ZoneAvailableInputsXML] - Zone Main_Zone - available inputs: AIRPLAY, AUDIO1, AUDIO2, AUDIO3, AUX, AV1, AV2, AV3, Bluetooth, HDMI1, HDMI2, HDMI3, HDMI4, HDMI5, HDMI6, JUKE, MUSICCAST_LINK, NET_RADIO, SERVER, Spotify, TUNER, USB
Note: User defined mappings have as per user defined mapping
and the rest comes is the existing addon mapping logic.
After switching to HDMI 1 you should see this:
2017-10-07 15:25:52.312 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from HDMI1 to command name HDMI1
2017-10-07 15:25:52.464 [TRACE] [ernal.protocol.xml.InputConverterXML] - Converting from state name HDMI1 to HDMI1 - as per user defined mapping
2017-10-07 15:25:52.469 [TRACE] [internal.protocol.xml.ZoneControlXML] - Zone Main_Zone state - power: true, input: HDMI1, mute: false, surroundProgram: 5ch Stereo, volume: 32.608696
2017-10-07 15:25:52.492 [DEBUG] [eiver.handler.YamahaZoneThingHandler] - Input changed to HDMI1
Lastly, here is my sitemap fragment if that helps:
Selection item=Yamaha_Input mappings=[HDMI1="Kodi",HDMI2="PC",AUDIO1="TV",TUNER="Tuner",Spotify="Spotify",Bluetooth="Bluetooth","NET RADIO"="NetRadio"]
Selection item=Yamaha_Surround mappings=["2ch Stereo"="2ch Stereo","5ch Stereo"="5ch Stereo",Straight="Straight","Chamber"="Chamber","Sci-Fi"="Sci-Fi","Adventure"="Adventure"]
Let me know.