Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Questions and comments specific to a particular plugin should go here.

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby blaher » Thu Mar 12, 2015 12:49 am

Dragon470 wrote:An update is up for the renaming of inputs. I think I covered all actions, but I don't really have time now to check every action that uses sources.


That works well, thanks very much. I'm sure others will find it helpful too. The 'Get Info' doesn't give an error for the info my receiver supports, but it doesn't seem to return info either, FWIW. From a selfish point of view, I don't use that sort of thing anyway. :)

I'm trying to use the network control to switch inputs on start-up, but I'm not sure what the best way is to go about it.

When the HTPC first starts I can send a message using your plug-in to switch inputs, but it takes a few seconds for the receiver to be ready on the network. I need someway of knowing when it's ready to receive.

I tried using the 'Verify Static IP' request, but it crashed EventGhost, if it was off, and then turned on during the request; otherwise it works fine reporting if it's found, or not.

Does the receiver send any message on the network when it turns on?

Cheers!
Attachments
Capture.JPG
blaher
Experienced User
 
Posts: 402
Joined: Thu Nov 17, 2011 1:27 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby Dragon470 » Thu Mar 12, 2015 1:56 am

For all "Get Info" actions it requires a python command/script of:
Code: Select all
print eg.result



In other words, all results from the "get Info" go to the standard eg.result. The function return.

The error messages you got I assume is because the receiver was turn off? If so that is normal, I don't have foolproof error checking on the get info action.

If you have "Network standby" set to ON then the receiver always can recieve network commands.

Otherwise if it is in some strange setup.
To see if your receiver is on first before issuing an initial input change just have it check if it for main zone power in a loop.
In a script you could do something like this:
Code: Select all
while eg.plugins.YamahaRX.GetInfo('Power', 'Main Zone') != "On":
    #might want to have it wait some time, but this would work in an instant loop
    pass
   
#now change the input
eg.plugins.YamahaRX.SetSourceInput('Main Zone', 'HDMI1')



As for the for the last item, the receiver does not send any command on the network when it comes on. All info must be asked for.
Dragon470
Experienced User
 
Posts: 198
Joined: Thu Feb 10, 2011 2:16 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby bjca » Sun Jul 05, 2015 11:34 am

Hi,

just noticed some bugs when I tried to manage a second Yamaha amp with a second instance of the plugin.

* each instance has the IP-adress hardcoded
* each instance work fine when the "other" is disabled
* when both enabled, only the last defined instance work

BR
/Björn
bjca
 
Posts: 5
Joined: Sun Sep 25, 2011 6:07 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby Dragon470 » Sun Jul 05, 2015 2:57 pm

bjca wrote:Hi,

just noticed some bugs when I tried to manage a second Yamaha amp with a second instance of the plugin.

* each instance has the IP-adress hardcoded
* each instance work fine when the "other" is disabled
* when both enabled, only the last defined instance work

BR
/Björn


I have addressed those issues a few versions a go. when I finally changed it to a multiload plugin. This was back in January 2015. I even changed the version to 1.1

I didn't ever have two devices before then. Both of mine work fine now.
Dragon470
Experienced User
 
Posts: 198
Joined: Thu Feb 10, 2011 2:16 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby gorman » Sat Mar 12, 2016 5:12 pm

Hi! I have the full list of commands accepted from my Aventage RX-A3010 and I see that Adaptive DRC, which I often use at night, is controlled through

@MAIN:ADAPTIVEDRC=Parameter

where paramenter can be either Auto or Off.

I don't find this command in the plugin and the "Send any command action" refuses to send it (it gives the "Command did not go to Yamaha Receiver"). The built-in functions are working and the receiver is correctly detected on the network.

I tried looking at the code, to see if it was easy to add commands, but, alas, I'm no coder and I'm clueless about it.
gorman
 
Posts: 13
Joined: Mon Jan 26, 2009 12:33 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby Dragon470 » Sun Mar 13, 2016 1:54 pm

I can look into it, but it may take a little while. I know that the send any command doesn't always work the way it should.

For the Send Any Command try:

<Main_Zone><Sound_Video><Adaptive_DRC>Auto</Adaptive_DRC></Sound_Video></Main_Zone></YAMAHA_AV>
or
<Main_Zone><Sound_Video><Adaptive_DRC>Off</Adaptive_DRC></Sound_Video></Main_Zone></YAMAHA_AV>

They worked on my RX-V775

your @MAIN:ADAPTIVEDRC=Parameter is the YNCA command style. My plugin uses the YNC command structure.
Dragon470
Experienced User
 
Posts: 198
Joined: Thu Feb 10, 2011 2:16 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby gorman » Thu Mar 17, 2016 3:15 am

Hi! Thanks for the help.

Ok, it worked with this command:

<Main_Zone><Sound_Video><Adaptive_DRC>Auto</Adaptive_DRC></Sound_Video></Main_Zone>

Now, since I want to automate Adaptive DRC according to the time of day, I'm trying to adapt a python script I found and I use "Copy as Python" to do it. The result:

Code: Select all
import time
timeStamp = str(
    time.strftime("%H", time.localtime())
)

if int(timeStamp) < 20 or int(timeStamp) >= 07:
    print 'Night Mode On'
    eg.plugins.YamahaRX.SendAnyCommand(u'&lt;Main_Zone&gt;&lt;Sound_Video&gt;&lt;Adaptive_DRC&gt;Auto&lt;/Adaptive_DRC&gt;&lt;/Sound_Video&gt;&lt;/Main_Zone&gt;', 'Put')
else:
    print 'Night Mode Off'
    eg.plugins.YamahaRX.SendAnyCommand(u'&lt;Main_Zone&gt;&lt;Sound_Video&gt;&lt;Adaptive_DRC&gt;Off&lt;/Adaptive_DRC&gt;&lt;/Sound_Video&gt;&lt;/Main_Zone&gt;', 'Put')


The problem is that the command doesn't work as "copied as python". Even if I insert it into a simple "Python command" action, it fails with "Command did not go to Yamaha receiver, error code 2". If I execute the action, by itself, it works perfectly. Something gets messed up with the syntax from "copy as Python", I guess.
Do you understand what it could be?
gorman
 
Posts: 13
Joined: Mon Jan 26, 2009 12:33 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby gorman » Fri Mar 18, 2016 3:32 pm

For now I solved it going around the problem (I love EG so much for its flexibility!).

Instead of having the python script calling the plugin directly, I have it generate an event, placing the Yamaha actions in a couple of macros, triggered by that event. I'm so happy, this has been a pet peeve of mine for AGES. Needing to activate Night Mode every time manually, or deactivating it during the day... thanks a lot for this plugin!

This is the python script I ended up using, in case anyone is interested.
Code: Select all
import time
timeStamp = str(
    time.strftime("%H", time.localtime())
)

if int(timeStamp) <= 7 or int(timeStamp) >= 20:
    print int(timeStamp)
    print 'Night Mode On'
    eg.plugins.EventGhost.TriggerEvent(u'Night.Mode.On', 0.0)
else:
    print int(timeStamp)
    print 'Night Mode Off'
    eg.plugins.EventGhost.TriggerEvent(u'Night.Mode.Off', 0.0)


And then I use the two events to call on the relevant macros, containing the two actions, configured as:
<Main_Zone><Sound_Video><Adaptive_DRC>Auto</Adaptive_DRC></Sound_Video></Main_Zone>

and

<Main_Zone><Sound_Video><Adaptive_DRC>Off</Adaptive_DRC></Sound_Video></Main_Zone>

By the way, the two print instructions in the python script are just for cosmetic/debugging reasons, they're obviously not needed.
gorman
 
Posts: 13
Joined: Mon Jan 26, 2009 12:33 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby tjabas » Mon Mar 21, 2016 3:17 pm

is it possible to receive notificantions in eventghosts in this plugin?

let say that i press volume up on the receiver , can i get a notification/event in eventghost when this is done?

or is there any other plugin that works that way?
tjabas
Experienced User
 
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby Dragon470 » Mon Mar 21, 2016 11:20 pm

tjabas wrote:is it possible to receive notificantions in eventghosts in this plugin?


The receiver doesn't push out any notifications via the Ethernet. That is also why I the plugin doesn't auto notify on changes.

If however all you want is confirmation that it was received by the receiver, it doesn't print out anything. As it is coded now if there is an error it will print out "Command did not go to Yamaha Receiver, error code X". If you have the programming ability you only need to modify the yamaha_xml.py file. It is under the do_xml function. This only applies to command sent (put) to the receiver. The (get) commands obviously give you a response.
Dragon470
Experienced User
 
Posts: 198
Joined: Thu Feb 10, 2011 2:16 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby gorman » Tue Mar 22, 2016 2:45 pm

Hi Dragon470, did you manage to look into the "Copy as Python" thing that I reported? I went around it but it still remains strange, doesn't it?
gorman
 
Posts: 13
Joined: Mon Jan 26, 2009 12:33 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby tjabas » Tue Mar 22, 2016 6:44 pm

Dragon470 wrote:
tjabas wrote:is it possible to receive notificantions in eventghosts in this plugin?


The receiver doesn't push out any notifications via the Ethernet. That is also why I the plugin doesn't auto notify on changes.

If however all you want is confirmation that it was received by the receiver, it doesn't print out anything. As it is coded now if there is an error it will print out "Command did not go to Yamaha Receiver, error code X". If you have the programming ability you only need to modify the yamaha_xml.py file. It is under the do_xml function. This only applies to command sent (put) to the receiver. The (get) commands obviously give you a response.



ok, good to know, thanks
tjabas
Experienced User
 
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby kgschlosser » Sat Jun 25, 2016 8:58 pm

The Yamaha doesn't send out changes. But from reading your code it looks as though this thing can be polled or asked for the status of all the different states. And if that is the case. Then you set up a polling loop. Pull the XML parse the data you want and then compare it to a copy that you saved from the last loop and see if it is different. And if it isn't post an event of the data that has changed. Now I do not personally own a Yamaha AVR but I am researching this for someone I am helping here in the forum. So what would like to know is

Do you have a link to the API?
Do you know if the state data is available via the route you are asking for it? Because if not it can all be gathered by parsing the web interface for it.

And if this is successful I would hand off the code to you so you can check it out and add it to the existing policy plugin if you wanted to.

Thanks again

K
A loved one and Time, The 2 things that can never be replaced.

Family, The only thing you don't get to choose in life.
User avatar
kgschlosser
Site Admin
 
Posts: 1467
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby Dragon470 » Sun Jun 26, 2016 1:06 pm

All of the "api" stuff is earlier in the thread. It consists of an excel spreadsheet that you can use to make each command. However, it is now getting old, and I have not gotten a new one from Yamaha.

You can use the "Get Info" command and get what state info you need. You could just get larger groups (not as far down the data tree) of data than doing them individually. Sometimes that is allowed and others they are restricted.

The main reason for not setting up a true polling was when I tried it Ii would have had to setup a queue system as current actions block requests for other data.

So two things would need to be changed across that whole plugin:
1 a priority value to be able to jump up in the queue
2 a timer just before the sending to the receiver. This however will never solve issues with another controller simultaneously sending a command and blocking yours.

I don't have much issue with helping you out if you are wanting to do this. I suggest you just fork the github code and work that way. Once it is all finalized, A major update to the original can be done.
Dragon470
Experienced User
 
Posts: 198
Joined: Thu Feb 10, 2011 2:16 am

Re: Yamaha RX-Vxxx (or similar) Ethernet Plugin!

Postby kgschlosser » Mon Jun 27, 2016 2:01 am

yeah i can do that, but this is going to be very hard to do because i do not own one of these AVR's.

i have already gone through and re wrote all of the add action and the plugin config dialog. what i did to make some stuff work a little nicer code wise and not be repetitive with the addaction stuff is i added a folder and 2 files to the plugin for EG overrides of the BoxedGroup as well as the addactionfromlist so they function properly. i really like how in the config dialog you dynamically updated the panel and caused the widgets to change. but i didn't like was how you actually had to do it because of a limitation in the builtins for EG. so doing the override made the core code simpler to read and was a simple copy and paste of the EG builtin and just changed some small things in it. so in all actuality it was really easy to do.

i am not sure i understand 100% about the polling thing
A loved one and Time, The 2 things that can never be replaced.

Family, The only thing you don't get to choose in life.
User avatar
kgschlosser
Site Admin
 
Posts: 1467
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 2 guests