Page 10 of 14

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 07 September 2017 9:57
by jorgh
@Jake,
jake wrote: Wednesday 16 August 2017 0:39 I am able to name my Listening modes, your approach works well. What doesn't work is 'setting' the newly listening modes. I click on the required listening mode, the switch button changes colour, but the receiver doesn't respond. After a refresh, the listening mode is changed back to the one that the receiver actually is on.
I can only use the predefined audio modes, like Movie/TV, Music, Game etc. and toggle through the listening modes. Being able to 'set' a listening mode directly, has been my goal for the longest time.
The code to select these listening modes directly still needs to be added. I plan to do that within the next 2 weeks, have been on a holiday last month, so that's why it has been so quiet ;-)

Regards,

Jorg

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 07 September 2017 10:04
by jorgh
@Xavier82,
Xavier82 wrote: Tuesday 05 September 2017 19:28 Did you find some time to create a plugin which supports Onkyo devices without NRI?
Not yet, but the good news is that the way I select the listening modes will be similar to the way the non-NRI support will work. So, once the listening modes work, I'll start working on non NRI support.

Regards,

Jorg

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 07 September 2017 22:12
by jake

jorgh wrote:...have been on a holiday last month, so that's why it has been so quiet ;-)
I kinda figured that already and therefore patiently waited for your return ;-)

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Saturday 09 September 2017 16:38
by vanputten80
Installed the script on Windows added the hardware and it works! I am able to Switch off/on and set volume for my TX-NR 509

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Monday 18 September 2017 20:53
by jorgh
@Jake,

I've updated the development branch on Github. You should now be able to select discovered listening modes.

Regards,

Jorg

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 21 September 2017 17:13
by jake
jorgh wrote:@Jake,

I've updated the development branch on Github. You should now be able to select discovered listening modes.

Regards,

Jorg
Thanks a lot. I will test this on Saturday, I am not home until tomorrow late.

UPDATE: I updated the plugin within Domoticz and it works excellent to check and set the different listening modes!!! Now I finally can integrate the listening modes in my script that joints the Kodi mediaplayer and the Onkyo receiver together.

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Monday 09 October 2017 15:00
by Xavier82
Hi Jorgh,

Any news about the update to create a plugin which supports Onkyo devices without NRI?

Hope to hear from you soon.

Thanks!

Kind Regards,
Xavier

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Monday 09 October 2017 17:09
by JimmyH1969
And the possibility to play internet favorites audio streams would be nice :D

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Friday 10 November 2017 18:13
by swevm
Updated to latest Domoticz and development version of Onkyo plugin.

Am receiving this error every now and then in my logs.
2017-11-10 18:08:35.442 Error: (Onkyo AV) 'onCommand' failed 'AttributeError':''NoneType' object has no attribute 'Send''.
2017-11-10 18:08:35.442 Error: (Onkyo AV) ----> Line 871 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand
2017-11-10 18:08:35.442 Error: (Onkyo AV) ----> Line 143 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand

Not sure what it mean as most things seem to be working wine apart som long latency from time to time when I change volume. It may take a few sec before volume is updated at receiver end if I change it in Domoticz UI.

/Magnus

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:06
by rizzah
Hi,

I am new to domoticz and scripts, but when i try to run the script from the commandline i get this:
pi@Domoticz:~/domoticz/scripts$ python onkyo.py --help
File "onkyo.py", line 588
SyntaxError: Non-ASCII character '\xc2' in file onkyo.py on line 588, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

When i create a dummy switch in domoticz and use your example line from the first post (script:///home/pi/domoticz/scripts/onkyo.py --power on --input 5 --volume 20) as "on action" nothing happens, and in the errorlog i see : Error: Error executing script command (/home/pi/domoticz/scripts/onkyo.py). returned: 512.

Can anyone point me in the right direction to what i am doing wrong?

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:17
by JimmyH1969
Hi rizzah, welcome...

It's not a commandline script. You have to add it to the Plugins directory. Create a directory Onkyo in the plugins directory and copy the script into that directory. Make sure is named "plugin.py"
Restart domoticz and you can add new hardware named: Onkyo AV Receiver
Make sure you have Allow new hardware/sensors enabled

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:22
by jorgh
swevm wrote:Updated to latest Domoticz and development version of Onkyo plugin.

Am receiving this error every now and then in my logs.
2017-11-10 18:08:35.442 Error: (Onkyo AV) 'onCommand' failed 'AttributeError':''NoneType' object has no attribute 'Send''.
2017-11-10 18:08:35.442 Error: (Onkyo AV) ----> Line 871 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand
2017-11-10 18:08:35.442 Error: (Onkyo AV) ----> Line 143 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onCommand

Not sure what it mean as most things seem to be working wine apart som long latency from time to time when I change volume. It may take a few sec before volume is updated at receiver end if I change it in Domoticz UI.

/Magnus
@swevm,

The beta branche is for the latest Domoticz beta. The plugin framework changed, so it is incompatible with the stable release.

Regards,

Jorg

Verstuurd vanaf mijn SM-G950F met Tapatalk


Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:27
by JimmyH1969
Good to see you again jorgh, hope you are allright.
Can we expect any changes to the plugin in the (near) feature? :D

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:31
by rizzah
Thanks!

I had already added that hardware before adding the script, it added 3 devices (power, volume and zone2 power).
Should i re-add it now i have the script in place, will that add more devices then or?

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:36
by jorgh
JimmyH1969 wrote: Thursday 16 November 2017 22:27 Good to see you again jorgh, hope you are allright.
Can we expect any changes to the plugin in the (near) feature? :D
@JimmyH1969,

I've configured an internet radio station, to look into the internet radio request. However, it's clearly implemented differently from the normal radio presets. I've not yet figured out how to list the presets and select them. If anyone has info on this it would be helpful.
It should be possible, as the Onkyo app is able to do it.

Regards,

Jorg

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:39
by jorgh
rizzah wrote: Thursday 16 November 2017 22:31 Thanks!

I had already added that hardware before adding the script, it added 3 devices (power, volume and zone2 power).
Should i re-add it now i have the script in place, will that add more devices then or?
@rizzah,

I've noticed that the lates Domoticz builds already has (limited) native support for Onkyo. So If you've properly installed the plugin, you should see two hardware types. One is named 'Onkyo LAN', and that's not the plugin. The one named 'Onkyo' is the plugin. It should add more than just power and volume controls. Also inputs, radio presets and surround modes should appear when using the plugin.

Regards,

Jorg

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:43
by JimmyH1969
Thanks already for looking into it. I cant wait (read: this will get the wife of my back) to have this feature working :D
Having just the option to select any preset would great already.
Your work is very much appreciated ;)

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:45
by rizzah
Hi Jorg!

I feel kinda dumb, but i only see the Onkyo AV Receiver (LAN). I did what Jimmy said:

pi@Domoticz:~/domoticz/scripts/onkyo$ ls -al
total 44
drwxr-xr-x 2 pi pi 4096 Nov 16 22:22 .
drwxr-xr-x 9 pi pi 4096 Nov 16 22:22 ..
-rwxr-xr-x 1 pi pi 34571 Nov 16 21:34 plugin.py

Created the sub-dir, renamed the python script. Then restarted the server (even did a reboot of the pi). But when i want to add a new hardware device i only see the one Onkyo that was there before i added the script.

Am i missing someting here?

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:52
by JimmyH1969
I'm on a Windows machine, but i can remember you have to some chmod things on the file....

You downloaded the file from github? https://github.com/jorgh6/domoticz-onkyo-plugin

Re: [RELEASED] Python plugin to control Onkyo receivers

Posted: Thursday 16 November 2017 22:53
by jorgh
@rizzah,

Plugins should be installed in the plugins directory of Domoticz.
On a Pi, this would be /home/domoticz/plugins/onkyo
The plugin should be named plugin.py
Be sure, to fetch the plugin from github.
The main branch is for the stable Domoticz release, the development branche for the latest Domoticz beta.

Regards,

Jorg