If you followed this tutorial, you know how to retrieve the device status in Domoticz.
But this is only the status, what if you want to shutdown the Onkyo receiver from Domoticz?
This tutorial will work for most of the Onkyo models, i’ve a Onkyo 616.

Onkyohex0

There are 3 ways to control your Onkyo receiver:

1: With a PHP script (you need a webserver)
2: With a LUA script
3: With a netcat hex string, send directly to the Onkyo receiver.

I will explain number 3 today:

First update your raspberry pi.

sudo apt-get update

Install Netcat:

sudo apt-get install netcat

Download this Microsoft Excel sheet to get all the commands,

Now you need to know the IP adres of your Onkyo receiver. If you get that, use the following command to switch your receiver off.
Change the 192.168.1.236 to your Onkyo receiver IP address.

echo -e 'ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR00\x0D' | nc 192.168.1.236 60128 &> /dev/null

 

Now create a bash script with the echo command above in it.

#!/bin/bash
echo -e 'ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR00\x0D' | nc 192.168.1.236 60128 &> /dev/null

Save it, for examle: onkyo-off.sh  and make it executable.

sudo chmod +x filename

Add the script as OFF action on your Onkyo witch. If you toggle the switch, the receiver will switch off.
IF you want to use the switch ON function, you must switch the standby modus on, on your Onkyo receiver.
Onkyohex2
Page 5 on the excel sheet will tell you ALL THE POSSIBLE COMMANDS.
The command for muting the sound will be:

echo -e 'ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1AMT00\x0D' | nc 192.168.1.236 60128 &> /dev/null

AMT00 = Muting sound
PWR00 = Onkyo power off
Don’t change the “x00!1”
Get it?  Have fun!