Integration of older Yamaha RX-V AV-Receivers (RS-232/Serial)

Hi,
i’ve integrated an older Yamaha AV-Receiver (RX-V 1600) in openhab.
Almost everything can be controlled with these receivers via the serial port.
I implemented this with an ESP8266 and Homie/MQTT. So you can control the receiver via WIFI.
Should work on many models with RS-232 port.

the code for the ESP8266 can be found here:

Things(manual config for generic mqtt device. not needed when auto discovered):

  Thing mqtt:topic:serialbridge "MQTT Serialbridge" {
    Channels:
        Type number : uptime            "Uptime"                  [ stateTopic="homie/serial-wifi-home/$stats/uptime"]
        Type number : signal            "Signal"                  [ stateTopic="homie/serial-wifi-home/$stats/signal"]
        Type string : command           "Standard Command"        [ stateTopic="homie/serial-wifi-home/serial/command", commandTopic="homie/serial-wifi-home/serial/command/set"]
        Type string : commandext        "Extended Command"        [ stateTopic="homie/serial-wifi-home/serial/commandext", commandTopic="homie/serial-wifi-home/serial/commandext/set"]
        Type number : input             "Input"                   [ stateTopic="homie/serial-wifi-home/serial/input", commandTopic="homie/serial-wifi-home/serial/input/set"]
        Type switch : power             "Power"                   [ stateTopic="homie/serial-wifi-home/serial/power", commandTopic="homie/serial-wifi-home/serial/power/set"]
        Type dimmer : volume            "Volume"                  [ stateTopic="homie/serial-wifi-home/serial/volume", commandTopic="homie/serial-wifi-home/serial/volume/set"]
        Type dimmer : bass              "Bass"                    [ stateTopic="homie/serial-wifi-home/serial/bass", commandTopic="homie/serial-wifi-home/serial/bass/set"]
        Type dimmer : treble            "Treble"                  [ stateTopic="homie/serial-wifi-home/serial/treble", commandTopic="homie/serial-wifi-home/serial/treble/set"]
        Type dimmer : dimmer            "Dimmer"                  [ stateTopic="homie/serial-wifi-home/serial/dimmer", commandTopic="homie/serial-wifi-home/serial/dimmer/set"]
        Type string : volumetext        "Volumetext"              [ stateTopic="homie/serial-wifi-home/serial/volumetext"]
        Type number : nightmode         "Nightmode"               [ stateTopic="homie/serial-wifi-home/serial/nightmode", commandTopic="homie/serial-wifi-home/serial/nightmode/set"]
        Type number : preset            "Preset"                  [ stateTopic="homie/serial-wifi-home/serial/preset", commandTopic="homie/serial-wifi-home/serial/preset/set"]
        Type number : program           "Program"                 [ stateTopic="homie/serial-wifi-home/serial/program", commandTopic="homie/serial-wifi-home/serial/program/set"]
        Type number : audioselect       "Audioselect"             [ stateTopic="homie/serial-wifi-home/serial/audioselect", commandTopic="homie/serial-wifi-home/serial/audioselect/set"]
        Type number : centerdist        "Center Dist."            [ stateTopic="homie/serial-wifi-home/serial/centerdist", commandTopic="homie/serial-wifi-home/serial/centerdist/set"]
        Type number : frontldist        "Front L Dist."           [ stateTopic="homie/serial-wifi-home/serial/frontldist", commandTopic="homie/serial-wifi-home/serial/frontldist/set"]
        Type number : frontrdist        "Front R Dist."           [ stateTopic="homie/serial-wifi-home/serial/frontrdist", commandTopic="homie/serial-wifi-home/serial/frontrdist/set"]
        Type number : surroundldist     "Surround L Dist."        [ stateTopic="homie/serial-wifi-home/serial/surroundldist", commandTopic="homie/serial-wifi-home/serial/surroundldist/set"]
        Type number : surroundrdist     "Surround R Dist."        [ stateTopic="homie/serial-wifi-home/serial/surroundrdist", commandTopic="homie/serial-wifi-home/serial/surroundrdist/set"]
        Type number : subwooferrdist    "Subwoofer Dist."         [ stateTopic="homie/serial-wifi-home/serial/subwooferrdist", commandTopic="homie/serial-wifi-home/serial/subwooferrdist/set"]
        Type switch : mute              "Mute"                    [ stateTopic="homie/serial-wifi-home/serial/mute", commandTopic="homie/serial-wifi-home/serial/mute/set"] 
        Type switch : fanmode           "Fanmode"                 [ stateTopic="homie/serial-wifi-home/serial/fanmode", commandTopic="homie/serial-wifi-home/serial/fanmode/set"] 
        Type string : format            "Format"                  [ stateTopic="homie/serial-wifi-home/serial/format"]
        Type string : debug             "Debug"                   [ stateTopic="homie/serial-wifi-home/serial/debug"]
        Type string : type              "Type"                    [ stateTopic="homie/serial-wifi-home/serial/type"]
        Type string : fs                "Bitrate"                 [ stateTopic="homie/serial-wifi-home/serial/fs"]
   }

Items:

Group:Number:AVG    SpeakerDistance "Speaker Distance [%d cm]"        

Number	Uptimes_Living                  "Uptime Wohnzimmer [%d s]"			    <time>                                            {channel="mqtt:topic:serialbridge:uptime" }
Number	Signal_Living          	        "Signal Wohnzimmer2 [%d %%]"			<network>                                      {channel="mqtt:topic:serialbridge:signal" }
String  Yamaha_Living_Serial            "Serial Command [%s]"                                                                       {channel="mqtt:topic:serialbridge:command" }  
String  Yamaha_Living_Ext_Serial        "Serial Extended Command [%s]"                                                              {channel="mqtt:topic:serialbridge:commandext" }  
Switch	Yamaha_Living_Power             "Strom Verstärker [MAP(de.map):%s]" <receiver>  (Living)    ["Switchable"]                  {channel="mqtt:topic:serialbridge:power"}
String	Yamaha_Living_Volumetext        "Volume db[%s]"     <soundvolume>                                                           {channel="mqtt:topic:serialbridge:volumetext"}
Dimmer	Yamaha_Living_Volume            "Verstärker"		<soundvolume>                           ["Switchable"]                  {channel="mqtt:topic:serialbridge:volume"}
Dimmer	Yamaha_Living_Bass              "Bass"		        <soundvolume>                                                           {channel="mqtt:topic:serialbridge:bass"}
Dimmer	Yamaha_Living_Treble            "Treble"	        <soundvolume>                                                           {channel="mqtt:topic:serialbridge:treble"}
Dimmer	Yamaha_Living_Dimmer            "Dimmer"	        <light>					 		                                        {channel="mqtt:topic:serialbridge:dimmer"}
Number	Yamaha_Living_Center_Dist       "Center Distance [%d cm]"       <soundvolume>           (SpeakerDistance)                   {channel="mqtt:topic:serialbridge:centerdist"}
Number	Yamaha_Living_FrontL_Dist       "Front Left Distance [%d cm]"   <soundvolume>           (SpeakerDistance) 		 		    {channel="mqtt:topic:serialbridge:frontldist"}
Number	Yamaha_Living_FrontR_Dist       "Front Right Distance [%d cm]"  <soundvolume>           (SpeakerDistance) 		 		    {channel="mqtt:topic:serialbridge:frontrdist"}
Number	Yamaha_Living_SRL_Dist          "SR Left Distance [%d cm]"      <soundvolume>           (SpeakerDistance) 		 		    {channel="mqtt:topic:serialbridge:surroundldist"}
Number	Yamaha_Living_SRR_Dist          "SR Right Distance [%d cm]"     <soundvolume>           (SpeakerDistance) 		 		    {channel="mqtt:topic:serialbridge:surroundrdist"}
Number	Yamaha_Living_Subwoofer_Dist    "Subwoofer Distance [%d cm]"    <soundvolume>           (SpeakerDistance) 		 		    {channel="mqtt:topic:serialbridge:subwooferrdist"}
Switch	Yamaha_Living_Volume_Dummy      "Volume"    		<soundvolume>
Number	Yamaha_Living_Program           "Programm"			<recorder>                                                              {channel="mqtt:topic:serialbridge:program"}
Number	Yamaha_Living_NightMode         "Night Mode"		<moon>		                                                            {channel="mqtt:topic:serialbridge:nightmode"}
Number	Yamaha_Living_Radio_Station     "Radio"				<network>	                                                            {channel="mqtt:topic:serialbridge:preset"}
Number	Yamaha_Living_Input             "Input"				<recorder>			                                                    {channel="mqtt:topic:serialbridge:input"}                                                
Number	Yamaha_Living_AudioSelect       "Audio Select"              		                                                        {channel="mqtt:topic:serialbridge:audioselect"}
Switch  Yamaha_Living_FanMode           "Fan Mode"		    <fan>                                                                   {channel="mqtt:topic:serialbridge:fanmode"}
Switch  Yamaha_Living_Mute              "Mute"		        <soundvolume>                                                           {channel="mqtt:topic:serialbridge:mute"}
Switch  Yamaha_Living_PureDirect        "Pure Direct"       <soundvolume>                                                           {channel="mqtt:topic:serialbridge:puredirect"}
String  Yamaha_Living_Bitrate           "Bitrate"	                                                                                {channel="mqtt:topic:serialbridge:fs"}                                             
String  Yamaha_Living_Format            "Format"	                                                                                {channel="mqtt:topic:serialbridge:format"} 	                                                    
String  Yamaha_Living_Debug             "Debug"	                                                                                    {channel="mqtt:topic:serialbridge:debug"}
String  Yamaha_Living_Type              "Type"	                                                                                    {channel="mqtt:topic:serialbridge:type"}

sitemap:

Text item=Yamaha_Living_Power label="Yamaha RX-V1600"  {				
	Switch 	  item=Yamaha_Living_Powe														mappings=[ON="On", OFF="Off"] label="Power"			
	Text      item=Yamaha_Living_Volumetext		visibility=[ Yamaha_Living_Power == ON]
	Slider    item=Yamaha_Living_Volume			visibility=[ Yamaha_Living_Power == ON]
	Switch 	  item=Yamaha_Living_Volume_Dummy	visibility=[ Yamaha_Living_Power == ON]		mappings=[ON="▲", OFF="▼"]	
	Slider    item=Yamaha_Living_Bass			visibility=[ Yamaha_Living_Power == ON]
	Slider    item=Yamaha_Living_Treble			visibility=[ Yamaha_Living_Power == ON]
	Group 	  item=SpeakerDistance				visibility=[ Yamaha_Living_Power == ON]
	Selection item=Yamaha_Living_Radio_Station	visibility=[ Yamaha_Living_Power == ON]		mappings=[0="off", 1="1Live", 2="WDR2", 5="Radio Essen", 4="Sunshine Live"]
	Selection item=Yamaha_Living_Input			visibility=[ Yamaha_Living_Power == ON]		mappings=[0="off", 1="Tuner", 2="CBL/SAT", 3="DVD/PS4", 4="CD", 5="Phono", 6="CD-R", 7="MD", 8="DTV", 9="VCR1",10="DVR",11="VAux"]
	Selection item=Yamaha_Living_Program		visibility=[ Yamaha_Living_Power == ON]		mappings=[1="Hall of Vienna", 2="The Bottom Line", 3="Roxy Theater", 4="7ch Stereo", 5="Straight", 6="THX Cinema", 7="THX Game",20="THX Music", 8="2ch Stereo", 9="ProLogic", 10="Standard",11="Disco",12="Game",13="Mono Movie",14="Spactacle",15="Sci-Fi",16="Adventure",17="Sports",18="Pop/Rock",19="General"]
	Selection item=Yamaha_Living_NightMode		visibility=[ Yamaha_Living_Power == ON]		mappings=[0="Off",1="Cinema Min.", 2="Cinema Mid.", 3="Cinema Max.", 4="Music Min.", 5="Music Mid.", 6="Music Max."]
	Selection item=Yamaha_Living_AudioSelect	visibility=[ Yamaha_Living_Power == ON]		mappings=[1="Auto", 2="Coax/Opt", 3="Analog", 4="HDMI"]
	Switch	  item=Yamaha_Living_FanMode		visibility=[ Yamaha_Living_Power == ON]		mappings=[OFF="AUTO",ON="CONT"]
	Switch	  item=Yamaha_Living_Mute			visibility=[ Yamaha_Living_Power == ON]	
	Switch	  item=Yamaha_Living_PureDirec		visibility=[ Yamaha_Living_Power == ON]	
	Default	  item=Yamaha_Living_Bitrate		visibility=[ Yamaha_Living_Power == ON]	
	Default	  item=Yamaha_Living_Format			visibility=[ Yamaha_Living_Power == ON]	
	Slider	  item=Yamaha_Living_Dimmer			visibility=[ Yamaha_Living_Power == ON]
	Default	  item=Yamaha_Living_Type			visibility=[ Yamaha_Living_Power == ON]
	//Default	  item=Yamaha_Living_Debug

}

rules:

rule "Yamaha send extended raw command "
when 
	Item Yamaha_Send received command
then 
	if(receivedCommand==ON)
		Yamaha_Living_Ext_Serial.sendCommand("20090411000FA") //Center Speaker Distance 2 meters
	else
		Yamaha_Living_Ext_Serial.sendCommand("20090411001C2") //Center Speaker Distance 4.5 meters
		
end

rule "Yamaha_Living_Volume_Dummy"
when
	Item Yamaha_Living_Volume_Dummy received command
then
	if(receivedCommand==ON){
		if(Yamaha_Living_Volume.state < 100)		
			Yamaha_Living_Volume.sendCommand(INCREASE)			
	}
	else{
		if(Yamaha_Living_Volume.state > 0 ) 
			Yamaha_Living_Volume.sendCommand(DECREASE)
	}
end

Documantation of Yamaha RS232 Commands can be found here:http://webpix.ca/files/
If you need more channels, just let me know :wink:

Olli

Yes, please, very interested, thanks

moved to first post…

1 Like

Added some channels …

Added Extended Command Channel (e.g Speaker Distance or Bass/Treble). Checksum will be added automatically.
Extended Command Docs can be found here: http://webpix.ca/files/
Best,
Olli

Moved to Homie 3.0.0 - Should now be auto discovered by mqtt 2.4 binding
Added Pure Direct
Added Reset Receiver

Hi Oliver, Thanks for your work on this, it looks great if I can get it fully working.

I seem to have it partially working with an RX-V3800, I can send all commands and the receiver responds accordingly. I never seem to receive any data back from the receiver which I would expect. I never see any mqtt messages containing data from the receiver itself, only signal, uptime reported from the esp module.

Any ideas welcome ?

Regards
Darren

Hi Darren,

The first thing you should double check is that the RX pin is connected correctly.
To make sure that the ESP also receives data from the receiver, you can also use a serial monitor directly on the ESP. Just connect a computer to the ESP via USB and start any serial monitor with 9600 baud. If you then turn up the volume, for example, it must be visible on the serial monitor.
If you get an output please post it here, if not the port is not connected correct.

Hope it helps,
Olli

Hi Olli,

Thanks for your tip, I actually had a hardware problem. The cheap max3232 module I was using provided no CTS line held high which what it seems my RX-V3800 needed to send data back. Simply shorting the RTS and CTS (pins 7-8) together has resolved the issue. I have a few of these modules and some of them dont even have the pins 6-9 even present or exposed on the PCB. Hope this helps others that might run into this issue.

Cheers
Darren

1 Like

Hi Darran,

Thank you for the tip. Fortunately I didn’t have this problem with my module. I have adapted the readme.md to this.

Regards
Olli