Onkyo receiver <--> Domoticz

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

mcwieger
Posts: 107
Joined: Tuesday 08 December 2015 9:59
Target OS: NAS (Synology & others)
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mcwieger »

We've discussed writing the status of the Onkyo to the log in this thread, but is it actually possible to display a status in the switch? E.g. in the Kodi switch you can see what's playing, in the Synology utility the CPU% used. I'd like to show the input selected on the Onkyo in the On/Off switch. Does anyone know how to do something like this?
I moved to HomeAssistant. It was fun while it lasted!
jake
Posts: 744
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: RE: Re: Onkyo receiver <--> Domoticz

Post by jake »

mcwieger wrote:We've discussed writing the status of the Onkyo to the log in this thread, but is it actually possible to display a status in the switch? E.g. in the Kodi switch you can see what's playing, in the Synology utility the CPU% used. I'd like to show the input selected on the Onkyo in the On/Off switch. Does anyone know how to do something like this?
It is a good idea! With 'current technology' we will need a repeting task to check every so many minutes for the actual input and power state. Nicer would be if the messages that are broadcasted by the receiver could be caught, like the Onkyo app does (when I use the std. IR remote, the app immediately updates as well)
mcwieger
Posts: 107
Joined: Tuesday 08 December 2015 9:59
Target OS: NAS (Synology & others)
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mcwieger »

I believe it can be done using LUA, with this command:

Code: Select all

commandArray['UpdateDevice']='idx|nValue|sValue'
Two challenges:
- I'm using domoticz_main currently to operate my Onkyo, which is not LUA. Don't know the syntax of domoticz_main
- I don't know how to query input from the Onkyo

And two personal challenges:
- Find the time to do this
- Figuring out if I'm actually going to use it, as I will probably control the Onkyo with their app
I moved to HomeAssistant. It was fun while it lasted!
User avatar
mvveelen
Posts: 688
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mvveelen »

Don't you have Onkyo installed on your Syno :) ?

You can then use something like:

Code: Select all

onkyo --host 192.168.0.115 --port 60128 system-power:query
The result should be something like:
('system-power', 'standby')

(I'm at work at the moment, and my wife is not at home, so the Onkyo is 'off' / 'standby')

I guess you could use the onkyo program to get more info, but I haven't tried it myself. Yet.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
mvveelen
Posts: 688
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mvveelen »

mcwieger wrote:You can use easy_install or pip on Synology.

Please check if you have pip installed (e.g. using Putty). If not, install the Python package first in the package center.
Use pip install onkyo-eiscp to install the package. You can now find it in /usr/bin.

An alternative is to use the php script which is available here: https://www.domoticz.com/wiki/Control_Onkyo

Just place this on any location on your Synology (e.g. create folder /web/onkyo/ and place the script there. You can use it immediately via the command line or in a script using curl (should also be installed on your Synology).

The only thing with the script is that not all commands are in it, but you can very easily modify the script to your needs, using the Excel document with EISCP commands you can find in this topic. Let me know if you need the version I created.
Hi.

I upgraded to DSM6 and am missing 'onkyo' all of a sudden. Tried this, but I don't get 'pip' to install onkyo on my Synology. Don't want to use the .php version, because my scripts use the onkyo. Any idea on how I can install it on DSM6 ?
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
mcwieger
Posts: 107
Joined: Tuesday 08 December 2015 9:59
Target OS: NAS (Synology & others)
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mcwieger »

Yes, I remember that upgrading to DSM6 gave me some issues too. I don't fully recall, but I think you need to upgrade pip first:
pip install --upgrade pip

I do have issues with the app since DSM6, but currently not enough time to do something about it.
I moved to HomeAssistant. It was fun while it lasted!
User avatar
mvveelen
Posts: 688
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mvveelen »

Full with hope I drove back home and tried it.

Code: Select all

root@DiskStation:~# pip install --upgrade pip
Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages
But.....

Code: Select all

root@DiskStation:~# pip install onkyo-eiscp
Collecting onkyo-eiscp
Requirement already satisfied (use --upgrade to upgrade): docopt>=0.4.1 in /usr/lib/python2.7/site-packages (from onkyo-eiscp)
Collecting netifaces (from onkyo-eiscp)
  Using cached netifaces-0.10.5.tar.gz
Building wheels for collected packages: netifaces
  Running setup.py bdist_wheel for netifaces ... error
  Complete output from command /bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1oEGJ1/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpVZl4Ztpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  checking for getifaddrs...not found.
  checking for getnameinfo...not found.
  checking for socket IOCTLs...not found.
  checking for optional header files...none found.
  checking whether struct sockaddr has a length field...no.
  checking which sockaddr_xxx structs are defined...none!
  checking for routing socket support...no.
  checking for sysctl(CTL_NET...) support...no.
  checking for netlink support...no.
  building 'netifaces' extension
  /usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc -fno-strict-aliasing -mhard-float -mfpu=vfpv3-d16 -DSYNO_MARVELL_ARMADAXP -DSYNOPLAT_F_ARMV7 -O2 -mhard-float -mfpu=vfpv3 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DSYNO_PLATFORM=MARVELL_ARMADAXP -DSYNO_RUNNING_DSM_BUILD_SYSTEM -g -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -DOPENSSL_NO_SSL3 -I/usr/local/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/lib/libffi-3.2.1/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNETIFACES_VERSION=0.10.5 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-armv7l-2.7/netifaces.o
  unable to execute '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc': No such file or directory
  error: command '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for netifaces
  Running setup.py clean for netifaces
Failed to build netifaces
Installing collected packages: netifaces, onkyo-eiscp
  Running setup.py install for netifaces ... error
    Complete output from command /bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1oEGJ1/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-27s4wg-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    checking for getifaddrs...not found.
    checking for getnameinfo...not found.
    checking for socket IOCTLs...not found.
    checking for optional header files...none found.
    checking whether struct sockaddr has a length field...no.
    checking which sockaddr_xxx structs are defined...none!
    checking for routing socket support...no.
    checking for sysctl(CTL_NET...) support...no.
    checking for netlink support...no.
    building 'netifaces' extension
    /usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc -fno-strict-aliasing -mhard-float -mfpu=vfpv3-d16 -DSYNO_MARVELL_ARMADAXP -DSYNOPLAT_F_ARMV7 -O2 -mhard-float -mfpu=vfpv3 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DSYNO_PLATFORM=MARVELL_ARMADAXP -DSYNO_RUNNING_DSM_BUILD_SYSTEM -g -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -DOPENSSL_NO_SSL3 -I/usr/local/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sysroot/usr/lib/libffi-3.2.1/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DNETIFACES_VERSION=0.10.5 -I/usr/include/python2.7 -c netifaces.c -o build/temp.linux-armv7l-2.7/netifaces.o
    unable to execute '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc': No such file or directory
    error: command '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc' failed with exit status 1
    
    ----------------------------------------
Command "/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1oEGJ1/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-27s4wg-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1oEGJ1/netifaces/
root@DiskStation:~# 
What can be wrong here? Lots of errors. The command 'onkyo' is still unknown. What ??

Edit:

One small step further??

Tried the easy_install method:

Code: Select all

root@DiskStation:/usr/local/bin# easy_install onkyo-eiscp
Searching for onkyo-eiscp
Reading https://pypi.python.org/simple/onkyo-eiscp/
Best match: onkyo-eiscp 1.0
Downloading https://pypi.python.org/packages/1e/19/868713408faca7782c59dffbf3a2673d0f753fab050b79787c675269ebd5/onkyo-eiscp-1.0.tar.gz#md5=71e20dad69f41a751391f73f5047be4d
Processing onkyo-eiscp-1.0.tar.gz
Writing /tmp/easy_install-p8JLtV/onkyo-eiscp-1.0/setup.cfg
Running onkyo-eiscp-1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-p8JLtV/onkyo-eiscp-1.0/egg-dist-tmp-kgSm8Q
zip_safe flag not set; analyzing archive contents...
Moving onkyo_eiscp-1.0-py2.7.egg to /usr/lib/python2.7/site-packages
Adding onkyo-eiscp 1.0 to easy-install.pth file
Installing onkyo script to /usr/bin

Installed /usr/lib/python2.7/site-packages/onkyo_eiscp-1.0-py2.7.egg
Processing dependencies for onkyo-eiscp
Searching for netifaces
Reading https://pypi.python.org/simple/netifaces/
Best match: netifaces 0.10.5
Downloading https://pypi.python.org/packages/a7/4c/8e0771a59fd6e55aac993a7cc1b6a0db993f299514c464ae6a1ecf83b31d/netifaces-0.10.5.tar.gz#md5=5b4d1f1310ed279e6df27ef3a9b71519
Processing netifaces-0.10.5.tar.gz
Writing /tmp/easy_install-5hO0J9/netifaces-0.10.5/setup.cfg
Running netifaces-0.10.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5hO0J9/netifaces-0.10.5/egg-dist-tmp-sURbmP
checking for getifaddrs...not found. 
checking for getnameinfo...not found. 
checking for socket IOCTLs...not found. 
checking for optional header files...none found. 
checking whether struct sockaddr has a length field...no. 
checking which sockaddr_xxx structs are defined...none! 
checking for routing socket support...no. 
checking for sysctl(CTL_NET...) support...no. 
checking for netlink support...no. 
unable to execute '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc': No such file or directory
error: Setup script exited with error: command '/usr/local/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-ccache-gcc' failed with exit status 1
Now the command 'onkyo' gives me the following:

Code: Select all

root@DiskStation:/usr/local/bin# onkyo
Traceback (most recent call last):
  File "/bin/onkyo", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'netifaces' distribution was not found and is required by onkyo-eiscp
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
mcwieger
Posts: 107
Joined: Tuesday 08 December 2015 9:59
Target OS: NAS (Synology & others)
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mcwieger »

It appears the onkyo-eiscp developers added a dependency to a tool called netifaces. This fails to install, same for me. I've reported this issue to the developers. I fear they'll send me to the netifaces developers, but let's see.
I'm not a Linux expert, but I suspect that it's platform related i.e. a specific issue for this Synology type.
I moved to HomeAssistant. It was fun while it lasted!
User avatar
jumbotroll
Posts: 793
Joined: Tuesday 13 January 2015 14:36
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Oslo,Norway
Contact:

Re: Onkyo receiver <--> Domoticz

Post by jumbotroll »

Try the older version onkyo-eiscp-0.9

sudo pip install https://pypi.python.org/packages/6f/48/ ... 4e6742eeb0

This is my results:

admin@DS712:/usr/local$ sudo pip install https://pypi.python.org/packages/6f/48/ ... 4e6742eeb0
Collecting https://pypi.python.org/packages/6f/48/ ... 4e6742eeb0
Downloading onkyo-eiscp-0.9.tar.gz
Collecting docopt==0.4.1 (from onkyo-eiscp==0.9)
Downloading docopt-0.4.1.tar.gz
Building wheels for collected packages: onkyo-eiscp, docopt
Running setup.py bdist_wheel for onkyo-eiscp ... done
Stored in directory: /root/.cache/pip/wheels/5c/3b/4a/746ce7e38d5eda4a8351a4c75316479a1be2b76489b1146a81
Running setup.py bdist_wheel for docopt ... done
Stored in directory: /root/.cache/pip/wheels/c5/9f/af/d47b6944834280fd76fb97192bf5d4241256f7d22b51dd3adc
Successfully built onkyo-eiscp docopt
Installing collected packages: docopt, onkyo-eiscp
Found existing installation: docopt 0.6.2
Uninstalling docopt-0.6.2:
Successfully uninstalled docopt-0.6.2
Successfully installed docopt-0.4.1 onkyo-eiscp-0.9
If you like the work I do for synology and domoticz, I appreciate a donation.
https://paypal.me/Jumbotroll
Regards
Jumbotroll
http://www.jadahl.com
User avatar
mvveelen
Posts: 688
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mvveelen »

Jadahl for president !

This fixed it (for me). The "old" version is all I needed and indeed, this was installed without errors. And 'onkyo' is now working for me. Thanks again !
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
mrefex
Posts: 26
Joined: Tuesday 14 March 2017 14:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7041
Contact:

Re: Onkyo receiver <--> Domoticz

Post by mrefex »

I just read this thread and have installed the tool. After struggling with some missing files it finally worked.
But i have the TX-RN656 and want to switch to the internet radio preset . : ONKYO SLI28.. but this paramater is Not Available on my receiver.
is there a work arround to go to this preset ?

As somebody did i also want to create a script which will turn on the radio when i come home from work.
Bishop
Posts: 22
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Onkyo receiver <--> Domoticz

Post by Bishop »

Hello,

I've used a script I found in this thread to check the on or off status of the Onkyo.
While trying to control my Onkyo I've managed to create a selector-switch with 3 options so far: Off | CBL/SAT | Shield

I don't know how to write lua and I can somewhat understand the code. Below I've tried to create a query to input-selector but it's not working.
Can someone help me out?

Code: Select all

   -- check if the value is valid or has some weird reading
   if (result == 0 or result == nil) then
      print_color('RED', 'Input error. Value is 0 or nil. Skipping this reading')
      return commandArray
   else
      if (result == "standby") and otherdevices[virt_onkyo] == 'On' then
         print_color('GREEN', 'Now powering off the Onkyo.')
         commandArray[virt_onkyo]='Off'
      end
      if (result == "on") and otherdevices[virt_onkyo] == 'Off' then
         print_color('GREEN', 'Now powering on the Onkyo.')
         commandArray[virt_onkyo]='On'
      end
   end

   if (result == 0 or result == nil) then
      print_color('RED', 'Input error. Value is 0 or nil. Skipping this reading')
      return commandArray
   else
      if (result == "video2,cbl,sat") and otherdevices[virt_onkyo] == 'Shield|On|Off' then
         print_color('GREEN', 'The Onkyo is set to watching TV. (CBL/SAT)')
         commandArray[virt_onkyo]='CBL/SAT'
      end
      if (result == "strm-box") and otherdevices[virt_onkyo] == 'CBL/SAT|On|Off' then
         print_color('GREEN', 'The Onkyo is set to the Nvidia Shield input.')
         commandArray[virt_onkyo]='Shield'
      end
   end
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: Onkyo receiver <--> Domoticz

Post by nixalsschrott »

proohu01 wrote: Wednesday 13 January 2016 15:12 The recent addition of the script editor in Domoticz triggered me to put all my LUA scripts into the database. I wanted to have the Onkyo logic in there also. I re-wrote a LUA script with some input from this page: https://www.domoticz.com/wiki/Control_Onkyo ...
Basically it seems to work, but only when the receiver is on. Then I get the status report. When the receiver is in standby I get the following error message: "Input error. Value is 0 or nil. Skipping this reading." Actually using latest domoticz v3.8143 on synology NAS. Any idea whats the problem and how to solve ?

Kind regards
matty
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
jake
Posts: 744
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Onkyo receiver <--> Domoticz

Post by jake »

As far as I know you can only query these kind of things when the receiver in on. To prevent an error, you better check with the script if the receiver is on, before going further. Please take a look at the Python plugin for Onkyo. Much faster and it also pushes information from Onkyo to Domoticz, rather than pulling. No coding involved
viewtopic.php?t=16313
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests