Comments (18)
It's currently just experimental
from hass-onkyo-ng.
Thanks for spending time on this!
from hass-onkyo-ng.
Work ongoing - just a draft for now but the basics work: #4
from hass-onkyo-ng.
I've sent a few incremental PRs for this but once #6 is merged it adds support for multiple zones.
Everything is still handled over a single TCP connection to the receiver, but the commands are sent asynchronously and state updates are processed as they're received rather than by polling.
from hass-onkyo-ng.
@dannytrigo : I merged your PRs but this doesn't work on my Onkyo:
This error originated from a custom integration.
Logger: root
Source: custom_components/hass_onkyo_ng/onkyo.py:113
integration: Onkyo AV Receiver (documentation, issues)
First occurred: 23:14:30 (3 occurrences)
Last logged: 23:18:34
Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.12/site-packages/eiscp/core.py", line 562, in _thread_loop
File "/usr/local/lib/python3.12/site-packages/eiscp/core.py", line 552, in trigger
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 29, in <lambda>
self._receiver.on_message = lambda msg: self._on_message_async(msg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 113, in _on_message_async
message_decoded = iscp_to_command(message, with_zone=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: iscp_to_command() got an unexpected keyword argument 'with_zone'
from hass-onkyo-ng.
After some reboot, I now get:
File "/config/custom_components/hass_onkyo_ng/config_flow.py", line 93, in async_step_user
onkyo_receiver = OnkyoReceiver(host, hass=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 67, in __init__
self.command_sync('dock.receiver-information=query')
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 302, in command_sync
result_raw = self.raw_sync(raw_command)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 289, in raw_sync
raise ValueError("Timeout waiting for response")
ValueError: Timeout waiting for response
from hass-onkyo-ng.
For the first error, that’s a new parameter I added in my fork of onkyo-eiscp. It’s referenced in the manifest so it should be picked up and installed by homeassistant.
For the second one, are you running any other home assistant instance on the same host, or anything else interacting with the receiver? I’ve found that mine will only allow one connection per IP and keeps disconnecting other connections leading to timeouts waiting for responses like that.
from hass-onkyo-ng.
Nothing else on that host communicates with the Onkyo
from hass-onkyo-ng.
Can you try with the latest PR and with debug logs and see if there is a disconnection after sending the command? That PR also adds 3 retries
I hope that command is supported by all models, I’m pretty sure that’s how the mobile app must get the source list
from hass-onkyo-ng.
@kongo09 let me know if the current version of the integration is working for you. It's pretty stable for me now.
Also, happy to close this issue, but I have no other way to contact you :)
from hass-onkyo-ng.
I still cannot setup my device:
File "/config/custom_components/hass_onkyo_ng/config_flow.py", line 89, in async_step_user
info = onkyo_receiver.receiver_info
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 139, in receiver_info
self.command_sync('dock.receiver-information=query')
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 335, in command_sync
result_raw = self.raw_sync(raw_command)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_onkyo_ng/onkyo.py", line 322, in raw_sync
raise ValueError("Timeout waiting for response")
ValueError: Timeout waiting for response
from hass-onkyo-ng.
I can only assume your receiver model doesn’t support that command. I believe it’s NRIQSTN. I saw the Onkyo app also sends MDIQSTN which gives a smaller XML with less detail. Maybe certain receivers only support that one.
What model do you have? Is it multi zone?
Would you be willing to run some python code to collect the responses to certain commands so I can fix it for your case? I can prepare the commands, or a python script to run them and output the responses
from hass-onkyo-ng.
Where did you find this command documented. I cannot see it in the eiscp documentation? I have TX-NR616
from hass-onkyo-ng.
My device doesn't support this command
from hass-onkyo-ng.
Thanks, I’ll rework what I’ve done to only use that command if available
from hass-onkyo-ng.
#12 should now hopefully support your receiver.
If you receiver doesn't support the MDI command that is now used, I can rework that too.
I am curious though - when you use the Onkyo smartphone app, what sources does it display? I am wondering how it determines that info, unless its hardcoded in the app based on model ID.
from hass-onkyo-ng.
That's why I had the automatic source crawling in the integration, just looping through the sources to identify what is available. I guess the smartphone app uses a simple lookup table, which in fact would also be the most simple alternative for the integration as all combinations are known.
I'll try later.
from hass-onkyo-ng.
I've sent one more PR on this topic. This one should now only need the UDP response for info that your original had, so I'm 99% sure it should now work for you.
I agree a hardcoded mapping might be best. The problem with going through all the sources at config time was that it would get even slower for multiple zones (as each zone supports a different set of sources)
from hass-onkyo-ng.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass-onkyo-ng.