Onkyo configuration for commands

Anyone using Onkyo reciver having a ready made example configuration which can not only set but also query the settings for the reciever?
Or what is the best way to integrate shell commands which can also read the state?

For example for the dimmer level - the following shell command can be issued

#onkyo -n709 dimmer-level=dark

That is a one way communication. And can be easily done via the switch or input select + automation
But at the same time the following can be issued

onkyo -n709 dimmer-level=query

Which will recive the result in shell as such

<eISCP(TX-NR709) 1xx.1x.x.106:60128>: DIMQSTN
('dimmer-level', 'bright')

Or without coding of a custom component this can not be done?

Are you using the onkyo component?

media_player:
  - platform: onkyo
    host: 192.168.1.80
    name: receiver
    sources:
      video1: 'Roku'
      cd: 'TV'

I can see its state in the dev-state tab of HA

Yes. But the media player component for the onkyo receiver will only let you do basic stuff.

Controlling the listening mode or sound properties (like late night, audyssey mode) e.t.c is not supported via component so have to use shell scripts.

So any ideas?

Currently setting the switches as the following. But don’t know what to put for the value tamplate

  onkyo_dimmer_night:
    command_on: 'python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/eiscp/script.py -n709 dimmer-level=dark'
    command_off: 'python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/eiscp/script.py -n709 dimmer-level=bright'
    command_state: 'python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/eiscp/script.py -n709 dimmer-level=query'
    value_template: '{{ return_value == "dark" }}'

On running the state command this is the output i get:

$ python3 /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/eiscp/script.py -n709 dimmer-level=query
<eISCP(TX-NR709) 172.16.5.106:60128>: DIMQSTN
('dimmer-level', 'bright')

What library are you using on the command line?

It’s the onkyo-eiscp
https://github.com/miracle2k/onkyo-eiscp

Dear,
Don’t know is it correct/appropriate to ask for guidance

I have Onkyo TX-SR508 whose remote no is RC-764m
My remote is damaged and had stopped working.
Well I would like to request if any one can provide me all button ir codes.
Please provide

I wrote this in a few other pages, I’ll copy and paste here because I think it may be useful to other newbies like myself as took me an afternoon to figure out how to configure hassio to use “onkyo” as a command :slight_smile:

what I found on https://github.com/home-assistant/core/issues/1578 is that by modifying the configuration.yaml adding the following lines, it is possible to activate and turn off the onkyo:

  - platform: command_line
    switches:
      onkyo_test:
        command_on: "/usr/local/bin/onkyo system-power=on SLI23"
        command_off: "/usr/local/bin/onkyo system-power=standby"

for that to work in gui: you go on lovelace, and add a button called -in my example- onkyo_test.

This worked.

following the above, there are a ton of commands that should be usable and they are documented here:

in particular, once you understand the logic, the file
https://github.com/miracle2k/onkyo-eiscp/blob/b27e8158c09b04a2160e395d9710f6748f431bf5/eiscp-commands.yaml
is particularly rich of information , for example there are commands to setup listening-mode (stereo, direct, etc), audyssey-dynamic-eq, late-night, music-optimizer-sound-retriever, audyssey-dynamic-volume, preset-memory / preset / internet-radio-preset (1-40 for network radios eg), etc etc etc

hope this helps :slight_smile:

1 Like

Hi, do I understand correctly, Hassbian has been shutdown so shell and python commands cant be done in Hassio?

just get root access install the library and use raw commands. if you need them i made some notes on how i did it on mine step by step.

Yes, please share those notes…excited to hear there is a way!

sorry to disappoint but cant find my notes , but i still found my history of where i got the info so here it is

also send me a private message to send you the excel file with all the codes that i got from Onkyo.


and this are random notes:
onkyo SLI2B
#sets the onkyo to tunin radio
onkyo NSV0E0
$ Selects the first entry (my prestes)
Onkyo NLSI00001
#Selects the third entre(my rock station)
onkyo NLSI00003

------------------------------------------------------------Spotify—

sets the Onkyo to NET

onkyo SLI2B
#Sets it to Spotify
onkyo NSV0A0


Python module
In a simple case, this might look like this:

import eiscp

Create a receiver object, connecting to the host

receiver = eiscp.eISCP(‘192.168.1.125’)

Turn the receiver on, select PC input

receiver.command(‘power on’)
receiver.command(‘source pc’)

receiver.disconnect()
Don’t forget to call disconnect() to close the socket. You can also use a with statement:

with eiscp.eISCP(‘192.168.1.125’) as receiver:
receiver.command(‘source all-ch-stereo’)
The command language is explained above. You can also be more explict with the structure:

receiver.command(‘power’, ‘on’, zone=‘main’)
If you prefer to send low-level ISCP commands directly, you can use the raw method:

receiver.raw(‘MVLUP’)

Found my notes :smiley:

intall onkyo coomands in Ubuntu
sudo -i
apt install python3-pip
pip3 --version
apt-get install python-setuptools
pip3 install onkyo-eiscp

---------------------------------examples to put tun in radio-

sets the Onkyo to NET

onkyo SLI2B
#sets the onkyo to tunin radio
onkyo NSV0E0
$ Selects the first entry (my prestes)
Onkyo NLSI00001
#Selects the third entre(my rock station)
onkyo NLSI00003

------------------------------------------------------------Spotify—

sets the Onkyo to NET

onkyo SLI2B
#Sets it to Spotify
onkyo NSV0A0


Python module
In a simple case, this might look like this:

import eiscp

Create a receiver object, connecting to the host

receiver = eiscp.eISCP(‘192.168.1.125’)

Turn the receiver on, select PC input

receiver.command(‘power on’)
receiver.command(‘source pc’)

receiver.disconnect()
Don’t forget to call disconnect() to close the socket. You can also use a with statement:

with eiscp.eISCP(‘192.168.1.125’) as receiver:
receiver.command(‘source all-ch-stereo’)
The command language is explained above. You can also be more explict with the structure:

receiver.command(‘power’, ‘on’, zone=‘main’)
If you prefer to send low-level ISCP commands directly, you can use the raw method:

receiver.raw(‘MVLUP’)

-------------if you have problems installing—
pip3 install --upgrade https://github.com/danieljkemp/onkyo-eiscp/archive/v0.9.2.zip

“onkyo” is gone from my system, it used to be in

/usr/local/bin/onkyo

but I now get command not found and
find / -name onkyo returns nothing…

anyone knows what happened / how to fix?

It seems like some sort of update may have broken things