[RELEASED] Python plugin to control Onkyo receivers

Python and python framework
jake
Posts: 269
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jake » Thursday 13 July 2017 12:54

jorgh wrote:All,

I've seen that the issue does not occur on versions of Domoticz you compile yourself. I've confirmed this myself as have others. So for now, compiling Domoticz from source yourself seems to be the solution.

Regards,

Jorg
So, hopefully it is a minor issue, that can be resolved. I'll wait patiently, since I never compiled Domoticz myself.

My beta version of getting stale though after so many weeks of not updating

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Wednesday 19 July 2017 16:37

All,

I've updated the plugin code on github for the new connection object. This means it works with the newer Domoticz builds.
There is an issue with the RPi binary builds that causes crashes for a lot of plugins, other builds should work fine.
If you compile Domoticz from source on the RPi the crashes do not seem to occur.
The updated code, also contains the adding of new listening modes on first detection. The mode is added with the following name:
[xy] New
Where xy is the code used by the receiver. You can replace 'New' with the proper name of the listening mode, as long as '[xy]' is left untouched all should work fine.

Regards,

Jorg

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Sunday 23 July 2017 17:28

Hey Jorgh,

I'm running Domoticz 3.8025 on my Synology NAS DSM6.1.
I'm added the Onko Plugin. When starten up I can see a lot of data in de logging.
But when I look into the Devices I can see only 3:
Onkyo Zone 2 power
Onkyo Master Volume
Onkyo power.
I added these 3 switches but I'm not able to see/find/add a switch as a selector for example the SLI selector (input selector like FM).

Am I doing something wrong?

Thanks!

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Monday 24 July 2017 8:27

@Xavier82,

The plugin should check the existence of all devices on startup and create them if they do not exist. This is logged by the plugin, you should have something like:

Code: Select all

2017-07-24 08:23:36.223 (Onkyo) Initialized version 0.2.0, author 'jorgh'
2017-07-24 08:23:47.734 (Onkyo) Receiver found:
2017-07-24 08:23:47.735 (Onkyo) Type: AV Receiver or Stereo Receiver
2017-07-24 08:23:47.736 (Onkyo) Type: TX-NR646
2017-07-24 08:23:47.736 (Onkyo) Region: European or Asian model
2017-07-24 08:23:47.737 (Onkyo) IP adress: 192.168.0.106
2017-07-24 08:23:47.737 (Onkyo) eISCP port: 60128
2017-07-24 08:23:47.738 (Onkyo) MAC: 0009B0D9C335
2017-07-24 08:23:47.741 PluginSystem: Starting I/O service thread.
2017-07-24 08:23:49.748 (Onkyo) Loading XML from file
2017-07-24 08:23:49.762 (Onkyo) Checking if Devices exist
2017-07-24 08:23:49.763 (Onkyo) Checking Main zone
2017-07-24 08:23:49.764 (Onkyo) Receiver main power device exists
2017-07-24 08:23:49.764 (Onkyo) Receiver input selector device exists
2017-07-24 08:23:49.765 (Onkyo) Receiver listening mode selector device exists
2017-07-24 08:23:49.766 (Onkyo) Receiver Tuner preset selector device exists
2017-07-24 08:23:49.766 (Onkyo) Receiver volume control device exists
2017-07-24 08:23:49.767 (Onkyo) Checking Zone 2
2017-07-24 08:23:49.768 (Onkyo) Receiver Zone 2 power device exists
2017-07-24 08:23:49.769 (Onkyo) Receiver input selector Zone 2 device exists
2017-07-24 08:23:49.769 (Onkyo) Receiver volume control device exists
2017-07-24 08:23:49.975 (Onkyo) Received XML
2017-07-24 08:23:50.130 (Onkyo) Update 0:'Off' (Onkyo - TX-NR646 Main Power)
2017-07-24 08:23:51.135 (Onkyo) Volume: 52
2017-07-24 08:23:51.136 (Onkyo) Update 2:'52' (Onkyo - TX-NR646 Main Volume)
2017-07-24 08:23:52.103 (Onkyo) Current Source: PC
2017-07-24 08:23:54.143 (Onkyo) Update 0:'Off' (Onkyo - TX-NR646 Zone2 Power)
2017-07-24 08:23:56.102 (Onkyo) Zone 2 Current Source: FM
If you enable debug, more detailed log information is recorded. So for now, try checking the log to see what is happening. The easiest way to restart the plugin is to select it in Hardware and press update.

Regards,

Jorg

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Monday 24 July 2017 16:05

@jorgh

Thanks, this is what I have in the log:
2017-07-24 15:18:59.942 OnkyoAVTCP: connected to: 10.0.0.14:60128
2017-07-24 15:18:59.942 OnkyoAVTCP: Send PWRQSTN
2017-07-24 15:18:59.942 OnkyoAVTCP: Send MVLQSTN
2017-07-24 15:18:59.942 OnkyoAVTCP: Send ZPWQSTN
2017-07-24 15:18:59.942 OnkyoAVTCP: Send ZVLQSTN
2017-07-24 15:18:59.942 OnkyoAVTCP: Send SLIQSTN
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 30 NLTF300000000080000FFFF00NE
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 9 NLSC0P
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 30 NLSU0-vTuner Internet Radio
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 31 NLSU1-Last.fm Internet Radio
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 16 NLSU2-Spotify
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 30 NLSU3-AUPEO! PERSONAL RADIO
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 17 NLSU4-MP3tunes
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 21 NLSU5-My Favorites
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 13 NLSU6-DLNA
2017-07-24 15:18:59.943 OnkyoAVTCP: Packet received: 19 NLSU7-Home Media
2017-07-24 15:19:00.946 OnkyoAVTCP: Packet received: 8 MVL24
2017-07-24 15:19:00.946 OnkyoAVTCP: Packet received: 8 PWR00
2017-07-24 15:19:00.947 OnkyoAVTCP: Packet received: 8 SLI01
2017-07-24 15:19:00.947 OnkyoAVTCP: Packet received: 8 ZPW00
2017-07-24 15:19:00.947 OnkyoAVTCP: Packet received: 9 ZVLN/A
2017-07-24 15:19:01.121 (Onkyo) Light/Switch (Master power)
2017-07-24 15:19:01.294 (Onkyo) Light/Switch (Zone 2 power)
2017-07-24 15:19:01.341 (Onkyo) Light/Switch (Master volume)

Last 3 switches are created.

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Tuesday 25 July 2017 8:55

@Xavier82,

That is not my plugin you are using. You should use Onkyo AV Receiver, and not Onkyo AV Receiver (LAN). These are different projects.

Kind regards,

Jorg

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Tuesday 25 July 2017 11:20

@Jorgh,

I'm using Domoticz v3.0.8025-7 from Jadahl (Jumbotroll) http://www.jadahl.com/domoticz_beta_6.1/?arch=evansport.
In this release I don't see "Onkyo AV Receiver" only "Onkyo AV Receiver (LAN)":
Image

Do could try "updating" to Domoticz v3.0.8005-7 from Jadahl (Jumbotroll) http://www.jadahl.com/domoticz_beta_6.1 ... =evansport. This version has Python plugin.....

Or do I need to do something else?

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Tuesday 25 July 2017 11:26

@Xavier82,

Domoticz contains plugin support, but the plugins are not included. You need to download the plugin.py and put it within it's own folder within the plugin directory.
I've got the plugin.py on my Raspberry Pi in: /home/pi/domoticz/plugins/onkyo

You can find the current version of my plugin at github: https://github.com/jorgh6/domoticz-onkyo-plugin

Regards,

Jorg

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Tuesday 25 July 2017 12:21

@Jorgh,

I placed your plugin.py (renamed to Onkyo.py) into the folder:
/usr/local/domoticz/var/plugins/ (Path within Synology) and gave file correct permissions.
I restarted Domoticz but without an luck. The plugin is not visible.
I think I need to update Domoticz to the Domoticz version incl. Python......

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Tuesday 25 July 2017 12:24

@Xavier82,

It must be called plugin.py and in a separate folder within the plugin directory.

Regards,

Jorg

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Tuesday 25 July 2017 13:44

@jorgh,

I contacted Jorn (Jadahl.com) and I need the Domoticz release with Python plugin.
I now wait on the correct release because I otherwise need to downgrade (reinstall) Domoticz.

Will come back when I have more info.

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Tuesday 25 July 2017 15:33

@jorgh,

Thanks to Jorn (Jadahl.com) I have a new relase of Domoticz now which has Python Plugin.
I can now see in the hardware "Onkyo AV Receiver".
I added this as hardware, immediatly I see that hardware is Added and devices are created.
when looking at the devices nothing has been created.

In the logging I see this:
2017-07-25 15:37:39.972 (Onkyo AV Receiver) Loading XML from file
2017-07-25 15:37:39.972 (Onkyo AV Receiver) XML file does not yet exist
2017-07-25 15:37:42.003 (Onkyo AV Receiver) Loading XML from file
2017-07-25 15:37:42.004 (Onkyo AV Receiver) XML file does not yet exist
2017-07-25 15:37:44.031 (Onkyo AV Receiver) Loading XML from file
2017-07-25 15:37:44.032 (Onkyo AV Receiver) XML file does not yet exist
2017-07-25 15:37:46.011 (Onkyo AV Receiver) Loading XML from file
2017-07-25 15:37:46.011 (Onkyo AV Receiver) XML file does not yet exist

Am I still doing something wrong?

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Wednesday 26 July 2017 8:58

@Xavier82,

That is probably because your receiver does not support the NRI command. I use this command to fetch the receivers configuration and it delivers the amount of zones, available inputs, radio presets and supported listening modes in XML format. This is used, to create the switches and fill them with the appropriate information.
For now, without this information the plugin will not work. I'm planning on adding support for receivers that do not support this command, but it's not in the current version.

Regards,

Jorg

elmar
Posts: 4
Joined: Wednesday 26 July 2017 10:27
Target OS: Raspberry Pi
Domoticz version: 3.8134
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by elmar » Wednesday 26 July 2017 10:35

Hi,

I've copied the script to the plugin directory on my RaspPi and I can select the "Onkyo AV Receiver" from the pull-down menu in the hardware config.
The only problem is that the remote address and port fields are disappearing as soon as I select the plugin. On the LAN version and other network devices these fields are there and working.
Working with V3.8134

Any ideas?

Elmar

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Wednesday 26 July 2017 10:41

@elmar,

That is because the plugin autodiscovers your receiver :D . There is no need to configure an IP address and port number.

Regards,

Jorg

elmar
Posts: 4
Joined: Wednesday 26 July 2017 10:27
Target OS: Raspberry Pi
Domoticz version: 3.8134
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by elmar » Wednesday 26 July 2017 11:01

Thanks for the quick reply Jorg!

I have removed the two Onkyo AV Receiver (LAN) hardware devices that I have.
I started a new one and clicked the Add button but nothing is happening....

Elmar

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Wednesday 26 July 2017 11:04

@elmar,

Take a look at the log to see what is happening. If it logs 'XML file does not yet exist' a lot, it is because the receiver does not support the NRI command. Otherwise it should reveal what is happening, in that case, post the log so I can have a look at it.

Regards,

Jorg

elmar
Posts: 4
Joined: Wednesday 26 July 2017 10:27
Target OS: Raspberry Pi
Domoticz version: 3.8134
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by elmar » Wednesday 26 July 2017 12:04

Thanks!
It was some freaking strange caching problem in my browser that caused the problem.
My TX-NR656 was now discovered without a problem.The TX-NR509 probably does not support the NRI command?
Or is the plugin not looking for more devices when an Onkyo is discovered?

Elmar

User avatar
jorgh
Posts: 144
Joined: Friday 27 June 2014 23:19
Target OS: Raspberry Pi
Domoticz version: 3.8224
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by jorgh » Wednesday 26 July 2017 12:06

elmar wrote:Thanks!
It was some freaking strange caching problem in my browser that caused the problem.
My TX-NR656 was now discovered without a problem.The TX-NR509 probably does not support the NRI command?
Or is the plugin not looking for more devices when an Onkyo is discovered?

Elmar
I currently connects to the device that responds first. I could add support for multiple receivers in the future.

Verstuurd vanaf mijn HTC 10 met Tapatalk

Xavier82
Posts: 15
Joined: Tuesday 07 June 2016 22:09
Target OS: NAS (Synology & others)
Domoticz version: 3.8143
Location: Netherlands
Contact:

Re: [RELEASED] Python plugin to control Onkyo receivers

Post by Xavier82 » Wednesday 26 July 2017 20:49

@jorgh,

is there anyway to check if my Onkyo TNX414 supports NRI?

Post Reply

Who is online

Users browsing this forum: ayziaa and 5 guests