[RELEASED] Python plugin to control Onkyo receivers
Moderator: leecollings
-
- 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
The listening mode switch properly switches from Music to Movie/TV etc, however the 'state' remains off, instead of the selected option. This makes it unusable in scripts, when I check which state is active at the moment. I now use a variable to store the option that I selected with my LUA code, however, this way I am not aware when the listening mode is changed from another source. (actually, I think this is rather complicated with just the 'movie', 'music', 'game' and 'stereo', because I guess that the receiver only announces the actual listening mode, like 'theater-dimensional' or 'All Ch Stereo' instead)
Can you please change the state of this switch to the selected listening mode of this selector switch?
Can you please change the state of this switch to the selected listening mode of this selector switch?
- 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
@Jake,
The complicated thing is that there are according to the protocol a lot of different listening modes exist, but only a small set is supported on each receiver. So here is the plan:
I will add a listening mode to the control when the plugin first receives a listening mode response that is not available in the control. So the control will only contain modes, available on the connected receiver.
This will also open up the possibility to support receivers that don't support the NRI command, to deliver their configuration. I will use the same mechanism for inputs, presets etc.
I'll update this thread, once I update the plugin with this functionality. I will start with the listening modes and add support for receivers not supporting NRI at a later stage.
Kind regards,
Jorg
I'm working on this. The current modes in the control are the ones that the receiver announces in the XML config. However, these modes do 'not really exist' they actually cycle through a number of different actual modes. This is also why the control is not updated. The receiver responds with the actual mode, which is not in the control and hence, cannot be selected.jake wrote:Can you please change the state of this switch to the selected listening mode of this selector switch?
The complicated thing is that there are according to the protocol a lot of different listening modes exist, but only a small set is supported on each receiver. So here is the plan:
I will add a listening mode to the control when the plugin first receives a listening mode response that is not available in the control. So the control will only contain modes, available on the connected receiver.
This will also open up the possibility to support receivers that don't support the NRI command, to deliver their configuration. I will use the same mechanism for inputs, presets etc.
I'll update this thread, once I update the plugin with this functionality. I will start with the listening modes and add support for receivers not supporting NRI at a later stage.
Kind regards,
Jorg
-
- Posts: 23
- Joined: Friday 16 September 2016 20:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 8718
- Location: Sweden
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
I thought I'd bring up an issue I'm facing. Btw a GitHub issue have been created on this topic.
When for example If Main Source is used in a Domoticz Scene it's not possible to see Input Label as a drop down when defining what source to be set. Instead all labels are translated to a Level, presented in a drop down as percentage number.
Am I the only one seeing this issue?
Btw I have tested to add a virtual selector switch to a scene and if the switch have 4 possible setting they are translated to a Level of 0, 10, 20 and 40% when defining what switch should do when scene is triggered.
When for example If Main Source is used in a Domoticz Scene it's not possible to see Input Label as a drop down when defining what source to be set. Instead all labels are translated to a Level, presented in a drop down as percentage number.
Am I the only one seeing this issue?
Btw I have tested to add a virtual selector switch to a scene and if the switch have 4 possible setting they are translated to a Level of 0, 10, 20 and 40% when defining what switch should do when scene is triggered.
Domoticz on RPi3 with Razberry: 10xZME WALLC-S, 14x Fib Switch, 6x Fib Wallplug, 1x Fib Motion Sensor, 2x Fib Smoke Sensor, 1x Fib Universal sensor (with 1-wire), 3x SwiidInter cordsw, ESPEasy [1-wire and relay], Kodi, Node-Red [Onkyo NR-828, UI etc]
- 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
@swevm,
If anybody knows if there is some other kind of selector that does not have this behavior, please drop me a line. I could than alter the plugin. But for now, I don't know a solution.
Regards,
Jorg
As far as I know, this is Domoticz behavior. I agree, that it is not very handy. Especially if there are more than 10 levels, the percentage goes above 100% and you can't even select this when you define a scene. From scripting however, this does not seem to be an issue.swevm wrote: When for example If Main Source is used in a Domoticz Scene it's not possible to see Input Label as a drop down when defining what source to be set. Instead all labels are translated to a Level, presented in a drop down as percentage number.
Am I the only one seeing this issue?
Btw I have tested to add a virtual selector switch to a scene and if the switch have 4 possible setting they are translated to a Level of 0, 10, 20 and 40% when defining what switch should do when scene is triggered.
If anybody knows if there is some other kind of selector that does not have this behavior, please drop me a line. I could than alter the plugin. But for now, I don't know a solution.
Regards,
Jorg
-
- Posts: 23
- Joined: Friday 16 September 2016 20:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 8718
- Location: Sweden
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Thanks Jorgh.
I have tried different various selectors in a Scene. They behave the same all of them even if I change the Scene into a Group as have been suggested in at least on other forum post.
A workaround could be to create switches (by the plugin) that activate specific Inputs and Modes once activated.
I have tried different various selectors in a Scene. They behave the same all of them even if I change the Scene into a Group as have been suggested in at least on other forum post.
A workaround could be to create switches (by the plugin) that activate specific Inputs and Modes once activated.
Domoticz on RPi3 with Razberry: 10xZME WALLC-S, 14x Fib Switch, 6x Fib Wallplug, 1x Fib Motion Sensor, 2x Fib Smoke Sensor, 1x Fib Universal sensor (with 1-wire), 3x SwiidInter cordsw, ESPEasy [1-wire and relay], Kodi, Node-Red [Onkyo NR-828, UI etc]
-
- Posts: 24
- Joined: Wednesday 28 September 2016 17:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5997
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
I am just seeing my recever is not supported yet.
a few errors i get are:
So now i wan't to remove the device and i get the error
Problem with removing hardware.
any idea how i can remove or disable the device? currenlty it's spamming my log.
a few errors i get are:
Code: Select all
2017-05-03 16:00:06.684 Error: (Onkyo woonkamer) 'onMessage' failed 'AttributeError':''NoneType' object has no attribute 'find''.
2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 624 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onMessage
2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 99 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onMessage
2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 523 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function processeISCPFrame
Problem with removing hardware.
any idea how i can remove or disable the device? currenlty it's spamming my log.
Rasberry Pi 3; Razberry 2.0; RFXCOM
- jorgh
- Posts: 124
- Joined: Friday 27 June 2014 23:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8224
- Location: Netherlands
- Contact:
Re: RE: Re: [RELEASED] Python plugin to control Onkyo receivers
The errors are probably because your Domoticz version is to old. This causes problems with Domoticz (could even freeze). That is why you cannot remove the hardware.Yustmenl wrote:I am just seeing my recever is not supported yet.
a few errors i get are:So now i wan't to remove the device and i get the errorCode: Select all
2017-05-03 16:00:06.684 Error: (Onkyo woonkamer) 'onMessage' failed 'AttributeError':''NoneType' object has no attribute 'find''. 2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 624 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onMessage 2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 99 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onMessage 2017-05-03 16:00:06.685 Error: (Onkyo woonkamer) ----> Line 523 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function processeISCPFrame
Problem with removing hardware.
any idea how i can remove or disable the device? currenlty it's spamming my log.
Things you can try:
1. Restart Domoticz and disable or remove the plugin asap.
2. Update Domoticz, with an updated version, the errors do not occur, and you should be able to disable or remove the plugin.
Regards,
Jorg
Edit: I've checked the code, and the logs you posted are indeed a bug that occurs under some circumstances on receivers not supporting the NRI command. However, restarting domotics and disabling/removing the hardware should work if you do it asap.
-
- Posts: 24
- Joined: Wednesday 28 September 2016 17:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5997
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Option 2 worked for me i gues there was a bug in the version i was running.
Thanks
Thanks
Rasberry Pi 3; Razberry 2.0; RFXCOM
-
- 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
@jorgh, I am curious, are you getting anywhere with the listening modes integration? What about if all listening modes are there, even while not all are supported by each model? I could still detect which one is active and store that listening mode for future use (I simply want to switch mode, depending on Kodi playing 'video' or 'audio'.
- 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
Hi Jake,
Regards,
Jorg
I've got the code to detect the listening modes and update the selector. However, there is a bug in Domoticz, that crashes Domoticz when updating selectors from the plugin framework. As such, I've not yet published the update. I think, that this bug needs resolving first. I've already posted on this bug in the forum.jake wrote:@jorgh, I am curious, are you getting anywhere with the listening modes integration? What about if all listening modes are there, even while not all are supported by each model? I could still detect which one is active and store that listening mode for future use (I simply want to switch mode, depending on Kodi playing 'video' or 'audio'.
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
Thanx for the update, i have network standby enabled so that was not the problem, i will try the new code.jorgh wrote:@Plaagje
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.Plaagje wrote: Even when i do not power off the tuner, the plugin gets disconnected. maybe a wait/sleep issue?
Kind regards,
Jorg
-
- Posts: 1
- Joined: Saturday 17 June 2017 3:37
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
Hi jorgh,
I use your plugin for few weeks without any problem, but since the last Domoticz update (v3.7976) the plugin doesn't work anymore. Here is the log if it can help:
2017-06-17 03:28:01.032 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
2017-06-17 03:28:03.036 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
This log repeats every 2 seconds and I have to delete Onkyo from Hardware to avoid Domoticz crash.
Thanks for your support.
I use your plugin for few weeks without any problem, but since the last Domoticz update (v3.7976) the plugin doesn't work anymore. Here is the log if it can help:
2017-06-17 03:28:01.032 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
2017-06-17 03:28:03.036 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
This log repeats every 2 seconds and I have to delete Onkyo from Hardware to avoid Domoticz crash.
Thanks for your support.
-
- Posts: 23
- Joined: Friday 16 September 2016 20:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 8718
- Location: Sweden
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
phd1963,
You get this error due to changes in underlying Python plugin implementation. It's one of the beauties of running bleeding edge code that stuff can break without notice. In this case it was posted in Python sub forum about this change prior to it being implemented.
you have three options:
- wait until plugin gets updated
- read Python development plugin wiki page and then implementat changes needed yourself in a fork of Jorgh git repo for the plugin
- revert to older Domoticz beta
You get this error due to changes in underlying Python plugin implementation. It's one of the beauties of running bleeding edge code that stuff can break without notice. In this case it was posted in Python sub forum about this change prior to it being implemented.
you have three options:
- wait until plugin gets updated
- read Python development plugin wiki page and then implementat changes needed yourself in a fork of Jorgh git repo for the plugin
- revert to older Domoticz beta
phd1963 wrote:Hi jorgh,
I use your plugin for few weeks without any problem, but since the last Domoticz update (v3.7976) the plugin doesn't work anymore. Here is the log if it can help:
2017-06-17 03:28:01.032 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:01.032 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
2017-06-17 03:28:03.036 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-17 03:28:03.036 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
This log repeats every 2 seconds and I have to delete Onkyo from Hardware to avoid Domoticz crash.
Thanks for your support.
Domoticz on RPi3 with Razberry: 10xZME WALLC-S, 14x Fib Switch, 6x Fib Wallplug, 1x Fib Motion Sensor, 2x Fib Smoke Sensor, 1x Fib Universal sensor (with 1-wire), 3x SwiidInter cordsw, ESPEasy [1-wire and relay], Kodi, Node-Red [Onkyo NR-828, UI etc]
-
- 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
@jorgh, as a daily user of your Onkyo plugin, I am not updating my Domoticz anymore, because of the change in integration of python plugins. Not a problem so far, but just wondering, are you planning to update your plugin? For the Kodi plugin there are now 2 versions, old and new, with the same functionality.
- 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
@Jake,
Dnwppo has updated the code that should resolve the crash. Once the beta is updated, I can test if it resolves the issues. If so, I'll push my updates to GitHub. It will also include the code to add listening modes on first usage.
Regards,
Jorg
I've already updated the code, but the issue with the updating of selector switches seems to be bigger with the current Beta, also selection of excising levels causes Domoticz to crash.jake wrote:As a daily user of your Onkyo plugin, I am not updating my Domoticz anymore, because of the change in integration of python plugins. Not a problem so far, but just wondering, are you planning to update your plugin? For the Kodi plugin there are now 2 versions, old and new, with the same functionality.
Dnwppo has updated the code that should resolve the crash. Once the beta is updated, I can test if it resolves the issues. If so, I'll push my updates to GitHub. It will also include the code to add listening modes on first usage.
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
where can we find the updated code?
i get these error's
i get these error's
Code: Select all
2017-06-23 17:18:40.885 (Onkyo) Receiver found:
2017-06-23 17:18:40.885 (Onkyo) Type: AV Receiver or Stereo Receiver
2017-06-23 17:18:40.885 (Onkyo) Type: TX-NR626
2017-06-23 17:18:40.886 (Onkyo) Region: European or Asian model
2017-06-23 17:18:40.886 (Onkyo) IP adress: xxx.xxx.xxx.xxx
2017-06-23 17:18:40.886 (Onkyo) eISCP port: 60128
2017-06-23 17:18:40.886 (Onkyo) MAC: xxxxxxx
2017-06-23 17:18:40.886 Error: (Onkyo) 'onHeartbeat' failed 'AttributeError':''module' object has no attribute 'Transport''.
2017-06-23 17:18:40.886 Error: (Onkyo) ----> Line 640 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-23 17:18:40.886 Error: (Onkyo) ----> Line 227 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function onHeartbeat
2017-06-23 17:18:40.886 Error: (Onkyo) ----> Line 437 in /home/pi/domoticz/plugins/Onkyo/plugin.py, function connect
- 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,
Regards,
Jorg
It is not yet release, as Domoticz crashes when using the version with the updated code. As soon as the bug is resolved (either my plugin or Domoticz) I'll put it on GitHub.Plaagje wrote:where can we find the updated code?
Regards,
Jorg
- mrefex
- Posts: 26
- Joined: Tuesday 14 March 2017 14:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.7041
- Contact:
Re: [RELEASED] Python plugin to control Onkyo receivers
to be sure...there is no way to control your onkyo anymore?
v3.7976
v3.7976
- 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
@mrefex and others,
On my Pi however, Domoticz crashes (signal 11, segmentation fault) when the plugin is enabled. I believe this is not caused by an error in the plugin, but somewhere in the python framework, but you should never exclude that possibility .
The Master branch still contains a stable version, but this will only work on Domoticz versions prior to the connection object change.
Maybe someone could take a look, it's always easy to overlook you own mistakes
So for now, controlling the Onkyo will work on older Domoticz versions using the Master branch version.
Kind regards,
Jorg
I've updated the development branch with the code compatible with the new connection object in the Python framework.mrefex wrote:to be sure...there is no way to control your onkyo anymore?
On my Pi however, Domoticz crashes (signal 11, segmentation fault) when the plugin is enabled. I believe this is not caused by an error in the plugin, but somewhere in the python framework, but you should never exclude that possibility .
The Master branch still contains a stable version, but this will only work on Domoticz versions prior to the connection object change.
Maybe someone could take a look, it's always easy to overlook you own mistakes
So for now, controlling the Onkyo will work on older Domoticz versions using the Master branch version.
Kind 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
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
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
Who is online
Users browsing this forum: FireWizard and 1 guest