Page 5 of 14
Re: RE: Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Thursday 06 April 2017 16:34
by jorgh
jossie67 wrote:jossie67 wrote:oohlaf wrote:You need python 3
Thanks that make sense!
jorgh wrote:@jossie67,
That is neither the plugin or command script posted in this thread.
Regards,
Jorg
I rename you python script "plugin.py" to 'Onkyo-plugin.py ,
Now I can run the python script, I'm only missing module named 'Domoticz'
It is a Domoticz plugin and cannot be executed stand-alone.
Attached in the 1st post, there is a stand-alone script.
Regards,
Jorg
Verstuurd vanaf mijn HTC 10 met Tapatalk
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Thursday 06 April 2017 22:29
by JimmyH1969
Hi There Jorgh,
Still love this script. I used to do do this with the stand-alone python script but i was never 100% sure if the command would execute. Now with the receivers feedback it's great.
Any chance that the Favorites are can be chosen like the Tuner presets? I'm not on cable any more and have it attached to the internet. When i want to play a radio station i add the stream to the favorites and select it with the remote.
From Domoticz i used something like this...
C:\Python27\Scripts\onkyo --host 192.168.1.5 system-power:on
C:\Python27\Scripts\onkyo --host 192.168.1.5 volume:15
C:\Python27\Scripts\onkyo --host 192.168.1.5 input-selector:network
C:\Python27\Scripts\onkyo --host 192.168.1.5 internet-radio-preset:%1
Thanks for all the help you are giving us

Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 07 April 2017 10:10
by jorgh
@JimmyH1969,
JimmyH1969 wrote:
Any chance that the Favorites are can be chosen like the Tuner presets?
I'll need to look at that, I don't use internet radio myself. I'll add some favorites and see if I can read them in a similar fashion as the radio presets. If that it the case, it should not be hard to implement.
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 07 April 2017 10:40
by jake
@jorgh, are you still planning to change the listening mode device, so that it will be filled with listening modes that are selected by the user? I would like to be able to auto-select my favourite listening mode when Kodi plays video or audio
Verstuurd vanaf mijn GT-I9195 met Tapatalk
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 07 April 2017 10:47
by jorgh
@Jake,
jake wrote:@jorgh, are you still planning to change the listening mode device, so that it will be filled with listening modes that are selected by the user? I would like to be able to auto-select my favourite listening mode when Kodi plays video or audio
Yes I am, i've registered already registered the enhancement on github (
https://github.com/jorgh6/domoticz-onkyo-plugin/issues).
But I need to find some time, the change requires some rework on the selection boxes, so it's a bit more work to implement. I've already thought of an approach how to do this. Now we just need to wait for a rainy day
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Monday 10 April 2017 21:02
by Plaagje
Hi Jorgh,
I have your plugin installed and connected to my ONKYO TX-NR626.
After connecting to the plugin, the devices are created and i can control my onkyo, i get feedback so everything works.
But.....
after a day the tuner/plugin seems disconnected and i get the following error's when trying to control the onkyo via domoticz
Code: Select all
Error: Plugin: Async Read Exception: 104, Connection reset by peer
Error: (Onkyo) Transport is not connected, write directive ignored.
Error: (Onkyo) Transport is not connected, write directive ignored.
Error: EventSystem: Could not determine switch type for event device Livingroom
Error: (Onkyo) 'onCommand' failed 'ValueError':'invalid literal for int() with base 10: 'Of''.
Error: (Onkyo) ----> Line 628 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand
Error: (Onkyo) ----> Line 160 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand
Error: (Onkyo) Transport is not connected, write directive ignored.
Error: (Onkyo) Transport is not connected, write directive ignored.
Error: (Onkyo) Transport is not connected, write directive ignored.
Error: (Onkyo) Transport is not connected, write directive ignored.
any idea what is wrong?
my Setup:
RPI2 DOMOTICZ V3.7277 ONKYO TX-NR626
--Edit--
When i'm not home the power gets disconnected from my onkyo...
--Edit2--
After restarting the domoticz service the plugin works again.
Code: Select all
(Onkyo) Receiver found:
(Onkyo) Type: AV Receiver or Stereo Receiver
(Onkyo) Type: TX-NR626
(Onkyo) Region: European or Asian model
Maybe the loss off power could be the reason...
-Plaagje
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 8:33
by jorgh
@Plaagje,
Plaagje wrote:
Maybe the loss off power could be the reason...
I think it is, however the plugin should try to reconnect (haven't tested this). So if you restore power, things should start working again. I'll take a look at the code to see if I can spot why it doesn't reconnect.
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 9:19
by mcwieger
I started using this plugin on my Synology, but it does not seem to work. After adding the hardware the devices are not added. When I check the log, the following error is displayed:
Code: Select all
2017-04-11 09:14:58.306 Error: (Onkyo Receiver) failed to parse parameters, Message or Message,Verb,URL,Headers,Delay expected.
2017-04-11 09:14:58.307 Error: (Onkyo Receiver) 'PyDomoticz_Send' failed 'TypeError':'argument 1 must be str, not bytes'.
FYI using plugins appears to have done some damage, as I cannot remove the hardware anymore (both this plugin and Buienradar), when I try to I get an error message and Domoticz is stopped...
Help appreciated

Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 9:39
by jorgh
@mcwieger,
mcwieger wrote:I started using this plugin on my Synology, but it does not seem to work. After adding the hardware the devices are not added. When I check the log, the following error is displayed:
Code: Select all
2017-04-11 09:14:58.306 Error: (Onkyo Receiver) failed to parse parameters, Message or Message,Verb,URL,Headers,Delay expected.
2017-04-11 09:14:58.307 Error: (Onkyo Receiver) 'PyDomoticz_Send' failed 'TypeError':'argument 1 must be str, not bytes'.
FYI using plugins appears to have done some damage, as I cannot remove the hardware anymore (both this plugin and Buienradar), when I try to I get an error message and Domoticz is stopped...
Help appreciated

What is the Domoticz version you are using? The minimum required version is 3.7040.
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 9:49
by mcwieger
Ah, that's probably it. I'm on 3.6749, which is the highest version available for DSM 6.0 at the moment...
I stopped early-adopting new releases of both Domoticz and DSM because they control the entire house now, but I'll give it a shot.
Thanks for your quick reply.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 10:04
by Plaagje
jorgh wrote:@Plaagje,
Plaagje wrote:
Maybe the loss off power could be the reason...
I think it is, however the plugin should try to reconnect (haven't tested this). So if you restore power, things should start working again. I'll take a look at the code to see if I can spot why it doesn't reconnect.
Regards,
Jorg
Hi Jorg,
Even when i do not power off the tuner, the plugin gets disconnected. maybe a wait/sleep issue?
-Plaagje
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 11:49
by pj-r
mcwieger wrote:I started using this plugin on my Synology, but it does not seem to work.
I think we are in the same boat.. my 515 and your 616 dont support NRI(QSTN). I found a excel(ISCP_AVR_133 (430940).xlsx) from july 2015 and it stated that:

- onkyo_nriqstn_support.png (20.83 KiB) Viewed 2886 times
So for our older receivers we need another way to setup these. Some configuration files based on receiver version name perhaps?
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 11 April 2017 12:14
by jorgh
pj-r wrote:mcwieger wrote:I started using this plugin on my Synology, but it does not seem to work.
I think we are in the same boat.. my 515 and your 616 dont support NRI(QSTN). I found a excel(ISCP_AVR_133 (430940).xlsx) from july 2015 and it stated that:
onkyo_nriqstn_support.png
So for our older receivers we need another way to setup these. Some configuration files based on receiver version name perhaps?
I've registered an enhancement on GitHub for supporting receivers that dont deliver the configuration through the NRI command.
https://github.com/jorgh6/domoticz-onkyo-plugin/issues
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 18 April 2017 22:55
by jake
A nice improvement would be that if I choose one of the FM favourites, the receiver switches (on) to that input as well.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 19 April 2017 8:48
by pj-r
Nice, thanks! I'll try to help you some day soon and check if wireshark would tell how the onkyo android app is handling with these older receivers.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 19 April 2017 9:00
by jorgh
@Plaagje
Plaagje wrote:
Even when i do not power off the tuner, the plugin gets disconnected. maybe a wait/sleep issue?
I've updated the code, so it should reconnect after the receiver gets disconnected in the development branch (
https://github.com/jorgh6/domoticz-onky ... evelopment) Have you enabled network stand-by? This allows connections to the receiver even when the receiver is turned off. Without it, you're unable to power on the receiver.
Kind regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 19 April 2017 9:05
by jorgh
@Jake,
jake wrote:A nice improvement would be that if I choose one of the FM favourites, the receiver switches (on) to that input as well.
The tuner is shared by all zones (up till 4, the plugin supports 2 zones already). I personally use Zone 2 for listening to Music (Hi-fi speakers connected) and Zone 1 for movies (5.1 speaker setup).
I think you could create a scene or event (lua or blocky) to implement what you want already.
Kind regards,
Jorg
Re: RE: Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 19 April 2017 19:21
by jake
jorgh wrote:@Jake,
The tuner is shared by all zones (up till 4, the plugin supports 2 zones already). I personally use Zone 2 for listening to Music (Hi-fi speakers connected) and Zone 1 for movies (5.1 speaker setup).
I think you could create a scene or event (lua or blocky) to implement what you want already.
Kind regards,
Jorg
True, didn't think about a piece of code or blockly to do that
Verstuurd vanaf mijn GT-I9195 met Tapatalk
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Sunday 23 April 2017 18:42
by burton666
I added the script using th instructions and restarted domoticz. After I add the hardware my log gets flooded by:
Onkyo 609) Loading XML from file
2017-04-23 18:38:34.297 (Onkyo 609) XML file does not yet exist
2017-04-23 18:38:36.300 (Onkyo 609) Loading XML from file
2017-04-23 18:38:36.300 (Onkyo 609) XML file does not yet exist
2017-04-23 18:38:38.302 (Onkyo 609) Loading XML from file...
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Monday 24 April 2017 7:44
by jorgh
@burton666,
That is probably because the receiver doesn't support the NRI command, they are not supported at this moment as the XML is the basis for creating the Domoticz devices. In a future release I will add support for these receivers. The enhancement is registered at:
https://github.com/jorgh6/domoticz-onky ... n/issues/8
Kind regards,
Jorg