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 Mastiff » Tue Jan 31, 2017 1:51 pm

OK, next problem... :oops: I tried to add this line to the threaded script:

Code: Select all
objects.append(["PreOut Levels","System"])


That fails totally. I get a mile long red error writeout in the log. Have I mixed up something in that command?

14:45:49 Exception in thread Thread-14:
14:45:49 Traceback (most recent call last):
14:45:49 File "threading.pyc", line 532, in __bootstrap_inner
14:45:49 File "threading.pyc", line 484, in run
14:45:49 File "2", line 143, in worker
14:45:49 AttributeError: 'NoneType' object has no attribute 'sleep'
14:45:49
14:45:49 Exception in thread Thread-12:
14:45:49 Traceback (most recent call last):
14:45:49 File "threading.pyc", line 532, in __bootstrap_inner
14:45:49 File "threading.pyc", line 484, in run
14:45:49 File "2", line 143, in worker
14:45:49 AttributeError: 'NoneType' object has no attribute 'sleep'
14:45:49
14:45:49 Exception in thread Thread-13:
14:45:49 Traceback (most recent call last):
14:45:49 File "threading.pyc", line 532, in __bootstrap_inner
14:45:49 File "threading.pyc", line 484, in run
14:45:49 File "2", line 143, in worker
14:45:49 AttributeError: 'NoneType' object has no attribute 'sleep'
14:45:49 Exception in thread Thread-15:
14:45:49
14:45:49 Traceback (most recent call last):
14:45:49 File "threading.pyc", line 532, in __bootstrap_inner
14:45:49 File "threading.pyc", line 484, in run
14:45:49 File "2", line 143, in worker
14:45:49 AttributeError: 'NoneType' object has no attribute 'sleep'
14:45:49
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Dragon470 » Tue Jan 31, 2017 2:58 pm

I added the PreOut Levels and worked fine.

Code: Select all
import threading
import time
#eg.TriggerEvent(suffix, payload,prefix)
#could call this from the start of eg.
#should delay as to make sure the plugin was started.

#class worker(threading.Thread):

def worker(element, zone, kill=False):
    #setup PreviousVar with actual data from receiver
    PreviousVar = Yamahavariable = eg.plugins.YamahaRX.GetInfo(element, zone)
    while True:
        TempVar = Yamahavariable = eg.plugins.YamahaRX.GetInfo(element, zone)
        if TempVar != PreviousVar:
            eg.TriggerEvent(zone + " - " + element, TempVar, "YamahaRX")
            PreviousVar = TempVar
        time.sleep(3) #time in seconds
        if kill():
            break
    print "Exiting " + zone + " - " + element

eg.globals.Yamaha_Stop_Threads = False
eg.globals.YamahaThreads = []  #stores all the thread info for later managment
objects = []
objects.append(["Volume Level","Main Zone"])
objects.append(["Power","Main Zone"])
objects.append(["Mute","Main Zone"])
objects.append(["PreOut Levels","System"])
for i in objects:
    t = threading.Thread(target=worker, args=(i[0],i[1], lambda: eg.globals.Yamaha_Stop_Threads))
    eg.globals.YamahaThreads.append(t)
    t.start()
   
# main (eventghost) thread exits now while others are working
# threads can be terminated via command eg.globals.YamahaThreads[x].join()
# this is done in a seperate script in my example


It looks like your error is something wrong in the time.sleep command.

Edit: After about 20 minuets it gave the same error. So I am going to implement a retry of 10 on all errors.
Last edited by Dragon470 on Tue Jan 31, 2017 4:55 pm, edited 1 time in total.
Dragon470
Experienced User
 
Posts: 201
Joined: Thu Feb 10, 2011 2:16 am

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

Postby Mastiff » Tue Jan 31, 2017 3:11 pm

Very weird. It worked when I went back to 3 seconds, instead of the 5 I had set because I got a timeout every now and then. Is there any particular reason that it should work with 3, but not with 5?

Also, now that it doesnt fail, I'm a bit unclear of how I can use it. What variable do I call to check the level? This is the full script to check the level without changing it:

Code: Select all
#15-tomssub
speakers = eg.plugins.YamahaRX.GetInfo('PreOut Levels', 'System')
for x in speakers:
    if x[0] == "Subwoofer_1":
        eg.globals.Subwoofer15 = x[1]
        eg.globals.Subwoofer15 = eg.globals.Subwoofer15+0      #sets for future use so it doesn't have to poll the receiver again
#12-tomssub
speakers = eg.plugins.YamahaRX.GetInfo('PreOut Levels', 'System')
for x in speakers:
    if x[0] == "Subwoofer_2":
        eg.globals.Subwoofer12 = x[1]
        eg.globals.Subwoofer12 = eg.globals.Subwoofer12+0      #sets for future use so it doesn't have to poll the receiver again


#Skriv ut for debugging
print eg.globals.Subwoofer15
print eg.globals.Subwoofer12
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Dragon470 » Tue Jan 31, 2017 7:02 pm

Mastiff,

I just updated the plugin on github, this will resolve the intermittent connection issues without causing errors on external scripts.

In your script the PreOut level of sub_1 is variable eg.globals.Subwoofer15

Call the whole string to check what it is.
Ex. print eg.globals.Subwoofer15
Dragon470
Experienced User
 
Posts: 201
Joined: Thu Feb 10, 2011 2:16 am

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

Postby Mastiff » Tue Jan 31, 2017 7:12 pm

Dragon470, sounds great, thanks! But I'm afraid you misunderstood. I know what the variables are in my script. The variables I'm looking for is when the threaded script is fed with objects.append(["PreOut Levels","System"]) and how I can import that into my script, which then gives me the result I need. :mrgreen:
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Dragon470 » Tue Jan 31, 2017 8:27 pm

I guess I am not sure what you want. If you want the worker thread to output the the information and THEN have the other script pick it up and tell you the individual speakers (subwoofers) are and put them in to you variables. This can be done in something like this.

the script:
Code: Select all
speakers = []   #local list used in for loops
speakers = eg.event.payload[:]  #copies the event data to the list
#15-tomssub
for x in speakers:
    if x[0] == "Subwoofer_1":
        eg.globals.Subwoofer15 = x[1]
        #eg.globals.Subwoofer15 = eg.globals.Subwoofer15+0      #sets for future use so it doesn't have to poll the receiver again
#12-tomssub
    if x[0] == "Subwoofer_2":
        eg.globals.Subwoofer12 = x[1]
        #eg.globals.Subwoofer12 = eg.globals.Subwoofer12+0      #sets for future use so it doesn't have to poll the receiver again

#Only needed one loop it still checks for each
#Had no idea why you were adding 0 to the variable.


scripts.png
scripts.png (10.48 KiB) Viewed 1811 times



If you were looking for to save the data directly during the worker thread. That would be far more complicated than this setup. This still gets the current data to the variables.
Dragon470
Experienced User
 
Posts: 201
Joined: Thu Feb 10, 2011 2:16 am

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

Postby Mastiff » Tue Jan 31, 2017 8:41 pm

I really just want the system to have full overview at any time what the levels of the subs are, no matter if I change them on the amp menu, or whatever. So the perfect script would be something that checked the level each time the amp is turned on and threw an event with the level and also threw an event with the new level if the level was changed when the amp was on.

I believe (long time since I messed with that script), that the info comes out of the amp as a string, and the +0 is to make it into a number, so I can do math on it. :mrgreen: My action scripts are used to add one and subtract one to the current level up to +10 and down to -10,there they will not try to change the level (which I seem to rememer resulted in an error or something). So the script checks if the level is +10 or -10 and then acts acordingly.
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Mastiff » Thu Feb 02, 2017 8:44 am

Neve mind, it doesn't seem to fetch what I was thinking. When I change the subwoofer level in another way (menu, Yamaha Receiver Manager) this doesn't get picked up by the main script (no event or otherwise sign that something has happened). But it's not a big problem I can use the original script I had over and just run that every ten seconds within the main thread, it doesn't seem to lock up anything. The main thing was the on/off and mute/unmute, and that works just as it should.

Edit: I was wrong. It halts the main EG thread for 10-12 seconds when polling the amp with the code for getting subwoofer volume. My bad... So maybe I have to only adjust the subwoofer volume with the adjust code within EG and not use any other way of adjusting them to make sure?
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby therealbiglou » Thu Feb 23, 2017 4:50 pm

I'm still having issues of intermittent connectivity. It seems half the time the plugin can't find the receiver even though the official Yamaha android app can connect to it no problem. Any recommendations on how I can keep these connected?
therealbiglou
Experienced User
 
Posts: 100
Joined: Sat May 19, 2012 4:33 am

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

Postby Mastiff » Thu Feb 23, 2017 5:32 pm

I would check the network connections. I have never seen the app conneting when the plug-in won't, so maybe there is a problem between the pc that's running EG and the Yamaha?
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby jachin99 » Tue Mar 14, 2017 3:41 pm

After reading through this thread, I am sure I will have to poll my AVR in order to accomplish this but I could easily be wrong given my level of knowledge. Basically, I want my AVR to switch inputs when I turn on my XBOX One. both the AVR, and xbox one have HDMI CEC, and that will turn the AVR on but it will not switch inputs. Is there a way for the receiver to either see in real time, or check for an active video signal on a specific output, and switch to that output if this makes any sense?
jachin99
Experienced User
 
Posts: 219
Joined: Sat Feb 13, 2016 8:39 pm

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

Postby Dragon470 » Wed Mar 15, 2017 7:54 pm

jachin99,

As far as I know there is no way of checking if there is an active video signal on a particular input. Likewise I don't think there is a way to know if there is an active audio on a particular input.

For the HDMI CEC it is up to the manufacturer of either side of the connection to implement what they want. I am guessing in your situation the XBOX is sending the general power on command but not a command to switch to a particular input. This would require the XBOX knowing the command specific to your yamaha receiver model. If there was a way for the XBOX to learn the command and always send it on power up, then it would auto switch to the correct input. Also on the receiver side I know you have to have HDMI Control enabled for any CEC to work. HDMI CEC was mainly invented to be able to hide all electronics except the tv and use just the one IR sensor on it and then send it on back thru the HDMI to the various devices.

I am sorry that none of this helps you for what you wanted to be able to do.
Dragon470
Experienced User
 
Posts: 201
Joined: Thu Feb 10, 2011 2:16 am

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

Postby Mastiff » Sun Sep 03, 2017 4:24 pm

Me again. :mrgreen: I have bought an RX-A3070 to replace my old RX-V3067, and it seems like everything's working as before. But I am trying to implement a new thing, and that doesn't work. I want to check for a loaded scene, since I have both regular presence and Atmos speakers, and I use a relay to switch between them. So when EventGhost notices that I have chosen scene 3 (which is Dolby Atmos/DTS-X from the Blu-ray player) or 4 (which is the same from the HDPC), it should change the relay setting to on, while it should turn off the relay when I change that (by either switching to scene 1 or 2, or by changing the input).

Code: Select all
objects.append(["Input_Sel","Main Zone"])
objects.append(["Scene_Sel","Main Zone"])


This just gives me an error:

18:23:13 Exception in thread Thread-168886:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 137, in worker
18:23:13 File "C:\Program Files (x86)\EventGhost\plugins\yamaha-network-receivers-master\client.py", line 558, in __call__
18:23:13 return get_status_string(self.plugin, object,zone)
18:23:13 File "C:\Program Files (x86)\EventGhost\plugins\yamaha-network-receivers-master\yamaha_xml.py", line 135, in get_status_string
18:23:13 value = xmldoc.getElementsByTagName(param)[0].firstChild.data
18:23:13 IndexError: list index out of range
18:23:13
18:23:13 Exception in thread Thread-168884:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168883:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168885:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168887:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168888:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "155", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168867:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "152", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168871:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "152", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168868:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 File "152", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13
18:23:13 Exception in thread Thread-168872:
18:23:13 Exception in thread Thread-168869:
18:23:13 Traceback (most recent call last):
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 File "threading.pyc", line 484, in run
18:23:13 Traceback (most recent call last):
18:23:13 File "152", line 143, in worker
18:23:13 File "threading.pyc", line 532, in __bootstrap_inner
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13 File "threading.pyc", line 484, in run
18:23:13
18:23:13 File "152", line 143, in worker
18:23:13 AttributeError: 'NoneType' object has no attribute 'sleep'
18:23:13


I have tried different synthaxes, but none seem work. Is this not implemented, is that why I'm not getting anything?
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Mastiff » Fri Sep 08, 2017 8:25 am

Also, if possible, I would like to get info when the audio format changes. So I can change the scene automatically when the receiver gets a Dolby Atmos or DTS-X signal. Is that possible to poll for too?
Mastiff
Experienced User
 
Posts: 748
Joined: Thu May 03, 2012 10:43 am

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

Postby Dragon470 » Sat Sep 09, 2017 5:41 pm

objects.append(["Input Selection", "Main Zone"])
is what you want for the input. I tested this and it works.

objects.append(["Scene", "Main Zone"])
The scene part is not working with the get info on mine, I might have never checked if that worked on the newer models. I will be checking on that.

For type of audio signal that is going in to the receiver, I will have to see even if that information is available to be retrieved.
Dragon470
Experienced User
 
Posts: 201
Joined: Thu Feb 10, 2011 2:16 am

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 3 guests