Page 6 of 14
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Monday 24 April 2017 20:02
by jake
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?
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 25 April 2017 8:52
by jorgh
@Jake,
jake wrote:Can you please change the state of this switch to the selected listening mode of this selector switch?
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.
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
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 02 May 2017 22:14
by swevm
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.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 03 May 2017 9:07
by jorgh
@swevm,
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.
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.
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
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 03 May 2017 11:15
by swevm
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.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 03 May 2017 15:56
by Yustmenl
I am just seeing my recever is not supported yet.
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
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.
Re: RE: Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Wednesday 03 May 2017 18:55
by jorgh
Yustmenl wrote:I am just seeing my recever is not supported yet.
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
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.
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.
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.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 05 May 2017 9:46
by Yustmenl
Option 2 worked for me i gues there was a bug in the version i was running.
Thanks
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Thursday 25 May 2017 13:27
by jake
@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'.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Monday 29 May 2017 10:29
by jorgh
Hi Jake,
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'.
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.
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 30 May 2017 18:04
by Plaagje
jorgh wrote:@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
Thanx for the update, i have network standby enabled so that was not the problem, i will try the new code.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Saturday 17 June 2017 3:45
by phd1963
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.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Saturday 17 June 2017 14:28
by swevm
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
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.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Monday 19 June 2017 8:45
by jake
@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​.
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Tuesday 20 June 2017 8:44
by jorgh
@Jake,
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​.
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.
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
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 23 June 2017 17:22
by Plaagje
where can we find the updated code?
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
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Saturday 24 June 2017 11:20
by jorgh
@Plaagje,
Plaagje wrote:where can we find the updated code?
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.
Regards,
Jorg
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Thursday 06 July 2017 8:23
by mrefex
to be sure...there is no way to control your onkyo anymore?
v3.7976
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Friday 07 July 2017 8:44
by jorgh
@mrefex and others,
mrefex wrote:to be sure...there is no way to control your onkyo anymore?
I've updated the development branch with the code compatible with the new connection object in the Python framework.
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
Re: [RELEASED] Python plugin to control Onkyo receivers
Posted: Thursday 13 July 2017 9:10
by jorgh
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