New Pioneer AVR Network Plugin

Do you have questions about writing plugins or scripts in Python? Meet the coders here.

New Pioneer AVR Network Plugin

Postby Sem;colon » Wed Apr 25, 2012 9:43 am

Hey guys,

first of all, I now that there already is a plugin to control Pioneer AVRs via Ethernet, but after I tested it (and got some errors) and took a quick look at the code, I decided to create my very own plugin for that.
The plugin is based on the Onkyo ISCP plugin by Alexander Hartmaier and has basically the same "look and feel".
With the plugin it is possible to control Network enabled devices from Pioneer via Ethernet and receive some events from it (Tested with the A/V Receiver VSX-921-K).
Since not every Pioneer product has the same features, you have to tell the plugin exactly what command to send to the Receiver. You can find suitable commands for your device on the Internet, for example here: http://pioneerelectronics.com/StaticFiles/PUSA/Files/Home%20Custom%20Install/VSX-1120-K-RS232.PDF.

Important notice for update form a lower version than v0.7:

Follow these steps to upgrade:
1. Open your configuration tree in EventGhost
2. Write down your old plugin configuration (just the configuration on the plugin itself, just that you don't forget it as you will have to enter it again)
3. Close Eventghost
4. Replace the __init__.py file for the plugin in the plugins directory of the EventGhost program directory.
5. Open your configuration tree in EventGhost again
you will get an Error that the plugin can not be loaded - that's normal.
6. Open the plugin configuration of the Pioneer_AV_NET plugin
7. Click OK (important!)
8. Create a new action in the Autostart branch of EventGhost: Pioneer_AV_NET: "Add Host" and fill in you previously used settings for the plugin. (leave the alias field empty!)
9. Save your configuration tree
10. Restart EventGhost

Changelog:
v0.9:
-Some minor fixes
-Plugin is now in the .egplugin format
v0.8:
-Added option to change the behaviour if the Display changes on the AVR
v0.7:
-Added support for multiple hosts
Attachments
Pioneer_AV_NET.egplugin
Pioneer_AV_NET (v0.9)
(4.98 KiB) Downloaded 34 times
__init__.py
Pioneer_AV_NET (v0.8)
(15.69 KiB) Downloaded 286 times
Last edited by Sem;colon on Wed Dec 28, 2016 8:29 pm, edited 10 times in total.
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: New Pioneer AVR Network Plugin

Postby piert » Thu May 10, 2012 6:28 am

Hi,

I posted in a different thread about the Pioneer pluging and got no response, but I now see this is a later development of the same pluging, so I will give it another try.

I am about to buy a new receiver and am thinking of either the Pioneer VSX 2021 or even the more expensive sc lx85.

I would like to know if it is possible to control the multi zones (zone 2 and 3) of these receivers with this plugin.


For example, suppose I am using the receiver to watch TV and somebody else wants to start using zone 2 of the receiver to listen to radio in another room. Is it possible for him/her to fully control this zone (i.e. switch input, set volume, switch the zone on and off, etc.) through Eventghost with this plugin?

Thanks for any information.

Best regards,
Perry
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby Sem;colon » Thu May 10, 2012 4:22 pm

Hi Perry,

Since I have only a VSX-921, I can not guarantee that the plugin works with these AVRs, but I' pretty sure it will.
Multizone control should be no problem; as long as you know the commands for your AVR (look at the document in the 1st Post) you can control nearly everything with this plugin. The only thing that won't work properly for now regarding multizone is the response of the volume-level as it isn't displaying the volume as an event WITH payload... But even that will work soon.

Best regards,
Sem;colon
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: New Pioneer AVR Network Plugin

Postby piert » Sun May 13, 2012 2:47 pm

Hi Sem;colon

I need some help/refreshing how to add the plugin. On your download link I only find the __init__.PY contents, not a single file.

I copied the contents and pasted into a notepad file and save as "EventGhost\plugins\Pioneer_AV_NET\__init__.PY"

Then I get when I start Eventghost, it gives me the following error:

16:39:27 Error while loading plugin-file C:\Program Files\EventGhost\plugins\Pioneer_AV_NET.
16:39:27 Traceback (most recent call last) (1544):
16:39:27 File "C:\Program Files\EventGhost\eg\Classes\PluginModuleInfo.py", line 70, in __init__
16:39:27 __import__(moduleName, None, None, [''])
16:39:27 File "C:\Program Files\EventGhost\plugins\Pioneer_AV_NET\__init__.py", line 63
16:39:27 self.socket.close()
16:39:27 ^
16:39:27 IndentationError: unindent does not match any outer indentation level

It must be something obvious, but I know quite little about Python, so hope you can help me on my way.

Ps: I have purchased a VSX-2021 yesterday, so I am eager to give your plugin a good spin!!

Thanks
Perry
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby Sat32 » Sun May 13, 2012 9:10 pm

Hello, Started using your plugin after having a lot of errors using the other pioneer plugin.
It's been working pretty good so far, but I've had a few issue's Changing inputs don't work
on a few selections. Sending the command FN02 should change to the Tuner. But it generates the E04
event meaning unknown command. But if I change it manually the plugin generates the correct FN02
event. Also the plugin generates LM103 event alot what is that?

Good work
will development continue?
Sat32
 
Posts: 12
Joined: Sun May 13, 2012 8:57 pm

Re: New Pioneer AVR Network Plugin

Postby Sat32 » Sun May 13, 2012 9:14 pm

Hello, Started using your plugin after having a lot of errors using the other pioneer plugin.
It's been working pretty good so far, but I've had a few issue's Changing inputs don't work
on a few selections. Sending the command FN02 should change to the Tuner. But it generates the E04
event meaning unknown command. But if I change it manually the plugin generates the correct FN02
event. Also the plugin generates LM103 event alot what is that?

Good work
will development continue?
Sat32
 
Posts: 12
Joined: Sun May 13, 2012 8:57 pm

Re: New Pioneer AVR Network Plugin

Postby Sem;colon » Sun May 13, 2012 10:25 pm

Hi Perry,

I'm actually not sure why it doesn't work, but I tried it and you're right!
So what works is if you copy and paste the content after clicking on "RAW" in the top-right corner when viewing the content..
Or you can download the file by clicking on "ZIP" (or the link below)
https://github.com/ThomasBott/Pioneer_AV_NET/zipball/master

Best regards,
Sem;colon
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: New Pioneer AVR Network Plugin

Postby piert » Mon May 14, 2012 7:30 am

Got it!

Done various random testing and all seems to work OK. Also the connection appears to be well maintained (as opposed to the other version of the Pioneer pluging that I have tried, which kept loosing connection after the issue of one command).

One disappointment for me is that it seems not possible to directly select an internet radio preset?
I hope that I am missing something here, becaus this would be a very useful function for me.

I will be testing this out more in the coming weeks.

One other 'green remark': the network standby function uses 7 Watts of power (as opposed to 0.4 Watt during normal OFF, according to the manual. The normal OFF would still allow waking the device with the remote).

Thanks and best regards,
Perry
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby Sem;colon » Tue May 15, 2012 7:27 pm

@Sat32:
you're welcome!

Now to your issue: The command to change inputs is xxFN
FNxx is the feedback event from the receiver... It is a bit confusing indeed.
So just try 02FN ;)

LM is for "listening mode"

And yes, I will do further development!


@Perry:
I don't know if there is possibility to directly select an internet radio preset..
But if you can call these presets via your remote you can also call them via network.. Maybe not direcly, but since you're using eventghost you can make macros for that.
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: New Pioneer AVR Network Plugin

Postby Sat32 » Tue May 15, 2012 11:19 pm

Thanks, It worked
Stupid friggin Typo I should have looked at it closer.

By the way I'm using a VSX-1021 so if anyone else
is having issues with the other plugin they'll know it works
with that model.

Thanks again
Sat32
 
Posts: 12
Joined: Sun May 13, 2012 8:57 pm

Re: New Pioneer AVR Network Plugin

Postby piert » Tue May 15, 2012 11:41 pm

Great, it is possible to switch to preset internet radio stations.

Change input to the internet radio (HMG) and then using command 01nw changes input to the first of 9 presets in the currently chosen 'class' (classes are numbered from A to G).

The classes (which, I believe can each hold something like 9 preset stations) can be chosen by using repeatedly command 38nw (set a small pause between commands to make this work).

I am still to find out what I can do to switch directly to a certain class, but the fact that it is possible to choose at least 9 internet radio presets directly is already very satisfying.
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby piert » Sat May 19, 2012 12:35 pm

Is it possible to use variables from Eventghost inside the pioneer commands?

I am trying to get Eventghost to incrementally change the internet presets to a higher number each time I run a macro.

The command (within one of the classes A to G) to select, for example, preset 2 is 02nw (if one wants to select preset nr. 2 in the currently selected class).

Could I somehow define a variable, say variable "a", which increments, by means of a separate Python script, by one number each time I press the macro. Then I would like to use the resulting variable inside the the Pioneer command. This command would then be something like 0anw.

Is this possible at all?
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby Sem;colon » Sat May 19, 2012 8:10 pm

Hi,

as always in EventGhost you can use every class of every plugin in your python scripts, so with some basic python programming skills it's no Problem to do that.

This example of a script would change the currently selected class started from the value of yourVariable. For example you define yourVariable=1, than it first sends "01NW", than "02NW" and so on..:

#adds a "0" in front of yourVariable because the receiver needs it
variableTwo="0"+str(eg.globals.yourVariable)
#executes the "SendCommand" class in the Pioneer_AV_NET plugin
eg.plugins.Pioneer_AV_NET.SendCommand(variableTwo+"NW")
#makes an increment by one on yourVariable
eg.globals.yourVariable+=1
#checks if yourVariable is bigger than 9 and if so resets it to 1
if eg.globals.yourVariable>9:
eg.globals.yourVariable=1
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: New Pioneer AVR Network Plugin

Postby piert » Sun May 20, 2012 1:10 am

Thanks, this is getting better and better!

I am using your code and am now trying to get the same event to cause the macro to go through all the presets in all the classes (i.e. after preset 9 in a class give the command to move up one class and start over again).

#checks if yourVariable is bigger than 9 and if so resets it to 1
if eg.globals.yourVariable>10:
eg.plugins.Pioneer_AV_NET.SendCommand(u'38nw')
eg.plugins.EventGhost.Wait(2.0)
eg.plugins.Pioneer_AV_NET.SendCommand("01NW")
eg.globals.yourVariable=2
print variableTwo+"NW"

This kind of does the trick, but needs some more finetuning. Also, it would be nice that if a preset is not stored, the code knows it is the end of the presets range. I notice that the plugin spits out information messages saying that the preset has not been stored for that number. Could the information message be used as an event or to generate an event? This would allow skipping a class when such a message comes up.

Thanks for your educational help with Python code. I appreciate it!
piert
Experienced User
 
Posts: 248
Joined: Tue Jun 14, 2011 2:53 pm

Re: New Pioneer AVR Network Plugin

Postby Sem;colon » Sun May 20, 2012 4:19 pm

yes, everything that is now an information massage will be an event in future versions of the plugin, but at the moment HMG feedback is not supported by the plugin.
However, if you need it very urgent, you could replace the line "print response" in the plugin by "self.TriggerEvent(response)" and you will get an event instead of an information, but it is very likely that the generated event will change in a future version of the plugin and then you would have to adjust your eventghost tree.
Sem;colon
Experienced User
 
Posts: 573
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Next

Return to Coding Corner

Who is online

Users browsing this forum: No registered users and 1 guest