[RELEASED] Python plugin to control Onkyo receivers
Moderator: leecollings
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
just tried some commands to be sure:
onkyo-script.py --host 192.168.1.5 system-power=on
returns...
<eISCP(TX-NR646) 192.168.1.5:60128> PWR01
<'system-power', 'on'>
(The device does turn on)
onkyo-script.py --discover
returns...
(nothing)
Hope this makes any sense. I'll try to find out why the discover function does not work, it's not a firewall thing.
to be continued, tnx
onkyo-script.py --host 192.168.1.5 system-power=on
returns...
<eISCP(TX-NR646) 192.168.1.5:60128> PWR01
<'system-power', 'on'>
(The device does turn on)
onkyo-script.py --discover
returns...
(nothing)
Hope this makes any sense. I'll try to find out why the discover function does not work, it's not a firewall thing.
to be continued, tnx
-
- Posts: 742
- Joined: Saturday 30 May 2015 22:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Could it have to do with 'enable new hardware' as well?
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Not in this case, as the devices are created after receiving the Receiver configuration. As the discovery process fails, the Receiver is not even connected yet.jake wrote:Could it have to do with 'enable new hardware' as well?
Regards,
Jorg
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
It seems i'm not the only one: https://github.com/miracle2k/onkyo-eiscp/issues/59
I just installed python on a fresh windows pc and executed "onkyo-script.py --discover"
it returns:
Traceback (most recent call last):
File "C:\Python27\Scripts\onkyo-script.py", line 9, in <module>
load_entry_point('onkyo-eiscp==1.0', 'console_scripts', 'onkyo')()
File "C:\Python27\lib\site-packages\eiscp\script.py", line 134, in run
sys.exit(main() or 0)
File "C:\Python27\lib\site-packages\eiscp\script.py", line 50, in main
for receiver in eISCP.discover(timeout=1):
File "C:\Python27\lib\site-packages\eiscp\core.py", line 323, in discover
data, addr = sock.recvfrom(1024)
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
Executing "onkyo-script.py --host 192.168.1.5 system-power:query"
Returns:
<eISCP(TX-NR646) 192.168.1.5:60128>: PWRQSTN
('system-power', 'standby')
I just installed python on a fresh windows pc and executed "onkyo-script.py --discover"
it returns:
Traceback (most recent call last):
File "C:\Python27\Scripts\onkyo-script.py", line 9, in <module>
load_entry_point('onkyo-eiscp==1.0', 'console_scripts', 'onkyo')()
File "C:\Python27\lib\site-packages\eiscp\script.py", line 134, in run
sys.exit(main() or 0)
File "C:\Python27\lib\site-packages\eiscp\script.py", line 50, in main
for receiver in eISCP.discover(timeout=1):
File "C:\Python27\lib\site-packages\eiscp\core.py", line 323, in discover
data, addr = sock.recvfrom(1024)
socket.error: [Errno 10054] An existing connection was forcibly closed by the remote host
Executing "onkyo-script.py --host 192.168.1.5 system-power:query"
Returns:
<eISCP(TX-NR646) 192.168.1.5:60128>: PWRQSTN
('system-power', 'standby')
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@JimmyH1969,
I've installed Python on a windows machine and found out that windows does not supper the MSG_DONTWAIT flag.
So in my code the auto discover will definitely not work on Windows at this moment.
I'll change the code so this will work on Windows. But I don't yet know if this is the only issue. After I figure out a method that works on both Windows and Linux, I'll update the code in the bugfix branch.
Regards,
Jorg
I've installed Python on a windows machine and found out that windows does not supper the MSG_DONTWAIT flag.
So in my code the auto discover will definitely not work on Windows at this moment.
I'll change the code so this will work on Windows. But I don't yet know if this is the only issue. After I figure out a method that works on both Windows and Linux, I'll update the code in the bugfix branch.
Regards,
Jorg
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@JimmyH1969,
I've made some changes that should make the autodiscover work on Windows. Have not tested it myself, as I don't have Domoticz running on a windows host. Verified the principle using a standalone script, so I'm confident the changes resolve the issue I found.
Don't know if that is the only issue that is keeping you from auto discovery, as apparently none of the existing scripts work on your install. Nevertheless, the changes are required on Windows.
The new code is currently in the bugfix branch: https://github.com/jorgh6/domoticz-onky ... ree/bugfix
Regards,
Jorg
I've made some changes that should make the autodiscover work on Windows. Have not tested it myself, as I don't have Domoticz running on a windows host. Verified the principle using a standalone script, so I'm confident the changes resolve the issue I found.
Don't know if that is the only issue that is keeping you from auto discovery, as apparently none of the existing scripts work on your install. Nevertheless, the changes are required on Windows.
The new code is currently in the bugfix branch: https://github.com/jorgh6/domoticz-onky ... ree/bugfix
Regards,
Jorg
-
- Posts: 153
- Joined: Tuesday 28 June 2016 16:38
- Target OS: Windows
- Domoticz version: Beta
- Location: Amersfoort NL
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Very, very nice.....
I updated the plugin remotely from work so i cant see the receivers responses, but it does detect the receiver and the devices are created.
Thank you for all the hard work and the great result ofcourse.
Can you explain what you changed to make discovery work?
Thanks again!
Regards, Jimmy
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@Jimmy
I already did
https://github.com/jorgh6/domoticz-onky ... n/issues/6
https://github.com/jorgh6/domoticz-onky ... 14daeb8fa9
Regards,
Jorg
Well, that is good news indeed.JimmyH1969 wrote:
Very, very nice.....
I updated the plugin remotely from work so i cant see the receivers responses, but it does detect the receiver and the devices are created.
Thank you for all the hard work and the great result ofcourse.
Can you explain what you changed to make discovery work?
I already did
https://github.com/jorgh6/domoticz-onky ... n/issues/6
https://github.com/jorgh6/domoticz-onky ... 14daeb8fa9
Regards,
Jorg
-
- Posts: 140
- Joined: Wednesday 17 December 2014 17:30
- Target OS: Linux
- Domoticz version: V3.8650
- Location: Jyväskylä, Finland
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Douh.. my TX-NR515 doesnt support that method or at least ISCP-V1.26_2013.xlsx file claims so.jorgh wrote:The receiver configuration is requested using an NRIQSTN command. The response contains the receiver configuration in XML, that I use to create the devices.
Is there any alternative way?
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@pj-r,
The plugin could be adapted to create the devices with all possible values, where the user could then delete unused inputs etc. I would then create a configuration option to indicate a receiver without NRI support is used.
I would give it a try with the current version, you never know, maybe it works. I see that there is a recent (2015) firmware on the onkyo website. As far as I can tell, the onkyo remote app, also uses the XML. So if that works, chances are that there is no issue and the XLS file is incorrect.
Regards,
Jorg
In this plugin I use this information, as the input numbers and names differ a lot between models, it is the easiest way to create the devices with correct information. The plugin as it is currently programmed does not work without a proper NRI response from the receiver.pj-r wrote:Douh.. my TX-NR515 doesnt support that method or at least ISCP-V1.26_2013.xlsx file claims so.
Is there any alternative way?
The plugin could be adapted to create the devices with all possible values, where the user could then delete unused inputs etc. I would then create a configuration option to indicate a receiver without NRI support is used.
I would give it a try with the current version, you never know, maybe it works. I see that there is a recent (2015) firmware on the onkyo website. As far as I can tell, the onkyo remote app, also uses the XML. So if that works, chances are that there is no issue and the XLS file is incorrect.
Regards,
Jorg
-
- Posts: 140
- Joined: Wednesday 17 December 2014 17:30
- Target OS: Linux
- Domoticz version: V3.8650
- Location: Jyväskylä, Finland
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Sounds like its time for wireshark since the onkyo android app works fine.
I did try the NRIQSTN with this piece of python code and i always get timeout:
response is:
this "ValueError: Timeout waiting for response." is coming from the python lib.. https://github.com/miracle2k/onkyo-eisc ... re.py#L265
Other methods that are marked as supported in excel file are working just fine. And I have the latest firmware update installed.
For me it looks like this 515 doesnt really support NRI -> QSTN method. Let see what the wireshark has to say
I did try the NRIQSTN with this piece of python code and i always get timeout:
Code: Select all
import eiscp
receiver = eiscp.eISCP('192.168.1.10')
response = receiver.raw('NRIQSTN');
print response
receiver.disconnect()
Code: Select all
pjr@pjr:~$ python testOnkyo.py
Traceback (most recent call last):
File "testOnkyo.py", line 10, in <module>
response = receiver.raw('NRIQSTN');
File "build/bdist.linux-armv7l/egg/eiscp/core.py", line 436, in raw
File "build/bdist.linux-armv7l/egg/eiscp/core.py", line 259, in filter_for_message
ValueError: Timeout waiting for response.
Other methods that are marked as supported in excel file are working just fine. And I have the latest firmware update installed.
For me it looks like this 515 doesnt really support NRI -> QSTN method. Let see what the wireshark has to say
LXC(x64 Ubuntu Xenial), RFXtrx433E, MySensors
- Plaagje
- Posts: 42
- Joined: Thursday 30 April 2015 10:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Hi!jorgh wrote:Installation instructions:
Unzip the plugin.zip file and put plugin.py within a folder named 'Onkyo' in the Domoticz plugin folder.
On Linux make the file executable (chmod a+x plugin.py)
After you installed the plugin, restart Domoticz and add the Onkyo Receiver through the Setup->Hardware.
I did the above but i cant seem to find the onkyo receiver under Hardware...
Im running Domoticz V3.7041 on a Pi 2.
-Plaagje.
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@Plaagje,
Did you create the Onkyo directory with a capital 'O'?
If not, try renaming the directory.
Do other plugins work (or at least show up in add-hardware)?
If not, it's probably a generic issue with plugins not working, and not something specific to this plugin.
Regards,
Jorg
Did you create the Onkyo directory with a capital 'O'?
If not, try renaming the directory.
Do other plugins work (or at least show up in add-hardware)?
If not, it's probably a generic issue with plugins not working, and not something specific to this plugin.
Regards,
Jorg
- Plaagje
- Posts: 42
- Joined: Thursday 30 April 2015 10:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Latest
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
I added an other plugin and that one didnt load as well,,,, i suppose it is the plugin system.
-
- Posts: 21
- Joined: Monday 06 February 2017 0:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
The directory name does not matter. Any name will do as long as the files are readable by the user under which Domoticz runs. The files do not need to be executable, chmod +r is enough.
Verstuurd vanaf mijn XT1562 met Tapatalk
Verstuurd vanaf mijn XT1562 met Tapatalk
-
- Posts: 39
- Joined: Wednesday 31 December 2014 12:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Has anyone this also working on a synolgy.
I have Python 2.7 running.
But when I do
I get an error
I have Python 2.7 running.
But when I do
Code: Select all
python Onkyo-plugin.py --host 192.168.10.74 --discover
Code: Select all
SyntaxError: Non-ASCII character '\xc3' in file Onkyo-plugin.py on line 569, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Raspberry Pi (3x)
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
-
- Posts: 21
- Joined: Monday 06 February 2017 0:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
You need python 3
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
@jossie67,
Regards,
Jorg
That is neither the plugin or command script posted in this thread.jossie67 wrote:Has anyone this also working on a synolgy.
I have Python 2.7 running.
But when I doI get an errorCode: Select all
python Onkyo-plugin.py --host 192.168.10.74 --discover
Code: Select all
SyntaxError: Non-ASCII character '\xc3' in file Onkyo-plugin.py on line 569, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Regards,
Jorg
-
- Posts: 39
- Joined: Wednesday 31 December 2014 12:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Thanks that make sense!oohlaf wrote:You need python 3
I rename you python script "plugin.py" to 'Onkyo-plugin.py ,jorgh wrote:@jossie67,
That is neither the plugin or command script posted in this thread.
Regards,
Jorg
Raspberry Pi (3x)
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
-
- Posts: 39
- Joined: Wednesday 31 December 2014 12:47
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Now I can run the python script, I'm only missing module named 'Domoticz'jossie67 wrote:Thanks that make sense!oohlaf wrote:You need python 3
I rename you python script "plugin.py" to 'Onkyo-plugin.py ,jorgh wrote:@jossie67,
That is neither the plugin or command script posted in this thread.
Regards,
Jorg
Raspberry Pi (3x)
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
Master Domoticz installed on a Synology
RFXCOM RFXtrx433E USB
RFLink
USB Z-Wave Mini Adapter
Mi-light
QuinLED
Landis+Gyr ZME120ACd
Kamstrup_M401
USB-IR-Schreib-Lesekopf Alecto WS1700
Watermeter with TCRT5000
Kodi
DS18B20
Who is online
Users browsing this forum: No registered users and 0 guests