Also back on topic, with the Onkyo receiver, do you have multiple zones? As with Zone 1, I can switch it on and back to being on standby, but Zone 2 I can only switch it on only, but not off/or back to standby... bit strange

cheers

Larry

Hey Larry,

No I don't have multiple Zones, so can't check that, sorry. And for the speech part, I gave up after trying the mentioned speech packages. The sound stuff all seems very buggy (tested it on multiple Rasps). Think I'll just wait until it's fixed I guess.

regards,

I don't know if you noticed or not, but I'm an extremely arrogant man who tends to think all of his plans will work ...

Finally found some time to make use of this.
Apart from removing the Kaku switch power on/off the Onkyo and switching it on by "onkyo PWR01" and off by "onkyo PWR00" i now have some breakfast music.
Swiching off the burglar alarm after i get up will trigger:

Finally found some time to make use of this.
Apart from removing the Kaku switch power on/off the Onkyo and switching it on by "onkyo PWR01" and off by "onkyo PWR00" i now have some breakfast music.
Swiching off the burglar alarm after i get up will trigger:

bizziebis wrote:
[edit]
Think I found it: onkyo network-usb:play. I'm gonna try it when I'm at home later today. I'n now remotely logged in trough SSH. Chance that the music is already playing at home haha
[/edit]

Great! Thanks guys, really usefull

Oh, I found out if you 'select' a stream, sometimes the OSD needs some confirmation(s) in the form of

The SLI28 seems redundant, but you'll have to be "somewhere" in the OSD menu for the NSV command to work

This will also time-out the 'button-press'-event within the domoticz-webinterface, thinking the switch-command failed. Maybe the Dev's can increase (or make it user configurable) the time-out on dummy switches?

I don't know if you noticed or not, but I'm an extremely arrogant man who tends to think all of his plans will work ...

I recently found the Wiki about connecting an Onkyo receiver to Domoticz.

At the moment I am working on a little project to automate some steps when I let Kodi (running on a 2nd RPI) plays either video or audio. The Onkyo receiver needs then to switch from 'listening-mode'. I got this partially working, however...

To make the code more robust, I need to verify that both the receiver is "on" and that the "input-selector" is 'BD/DVD' since that is the HDMI port connection that the Kodi RPI is on.
I am able to check the current input by using the provided 'Status' Function:

-- function to get information from receiver
function onkyo_status(command)
local result = {}
local output = io.popen ('onkyo '..command)
for line in output:lines() do
table.insert(result, line)
end
output:close()
return result
end

I recently started using Domoticz on my Synology NAS, so no experienced user yet, but I'm trying hard to get some things to work. One of them being controlling my receiver.
I managed to install necessary packages and I can control my Onkyo from the command line in Putty. So far so good. Next step is to control it via a script in Domoticz (lua or bash, don't really care, but I''m not very familiar with either). Steps I took:

I was hoping this would allow me to switch on the receiver, but unfortunately nothing happens when switching on or off. Who knows where this goes wrong? My guess for possible causes:
a. Incorrect script
b. Incorrect script location (also tried directory /usr/local/domoticz/scripts and /usr/local/domoticz/scripts/lua)
c. Incorrect script location referral (I entered full path, should I use a script home folder instead?)
d. Incorrect rights (script appears to have execution rights for all users)
e. Incorrect setup of hardware/device
f. General misconception of this functionality

I would not use a LUA script for this. Creating a virtual device like you did is oke. Then use the following code in you "domoticz_main" script file. This file is in the root of your scripts folder. If it starts with an underscore "_" rename the file so that it doesn't start with _

Ok, works using domoticz_main. Had to set rights to 755 to be able to execute.

So if I want to add additional functions (e.g. change input selector or volume), I should add additional switches?

What type is adviced in those cases? On/off is applicable to switch on and off, but how to control the other switch types? E.g. how to control a dimmer, as this could be convenient for volume control?
And if I want to select the input selector, I would like to have more than 2 options, so are there any switch types that have more statuses than on/off?

I can't help you with that. I just use it as on/off for the Onkyo.
I guess you would have to create on/off devices for each and every function. Perhaps us a scene to switch multiple items?
A virtual dimmer should work for volume control with a proper LUA script. Perhaps someone on the forum has more experience with that.

@Jake: I saw you're working on a better integration of your Onkyo in Domoticz. Could you give some more info on your project to get the status and write it to the log?

I'm looking to find a way to resolve the following issue: when I turn on the Onkyo using Domoticz, but turn it off using the regular remote control, the status is not updated and it looks like the receiver is still on.

Possible solution would be:
1. Create a switch to query Onkyo status
2. Write the status to this switch
3. Run a blockly script every x minutes that adjusts the actual Onkyo On/Off switch accordingly

Obviously, step 2 is the hard part. Any ideas how to do that? Or another way to resolve the issue?

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 in now have two LUA scripts in the Domoticz database. One is able to turn on or off the receiver. The other queries the receiver so that the correct power state is always visible in Domoticz.

It is probably not the best LUA scripting out there but
I just wanted to share my script. I hope it is of any use to others...

mcwieger wrote:@Jake: I saw you're working on a better integration of your Onkyo in Domoticz. Could you give some more info on your project to get the status and write it to the log?

I'm looking to find a way to resolve the following issue: when I turn on the Onkyo using Domoticz, but turn it off using the regular remote control, the status is not updated and it looks like the receiver is still on.

Possible solution would be:
1. Create a switch to query Onkyo status
2. Write the status to this switch
3. Run a blockly script every x minutes that adjusts the actual Onkyo On/Off switch accordingly

Obviously, step 2 is the hard part. Any ideas how to do that? Or another way to resolve the issue?

My project scope is to let the Onkyo receiver follow my use of Kodi media player. What works at the moment is:

I choose an album with the Yatse app, connected to a 2nd RPI running Kodi (Xbian).
The script will do the following
- detect a devicechange on the Kodi Media player from 'on' to 'audio' (or 'video')
- Domoticz changes the Onkyo input to the HDMI input for the Kodi player
Result: if the receiver is off, it will be turned on to the right input, if it was already on, it will just change input
- Last used listening mode (stored in a Domoticz variable, one for 'audio' one for 'video') will be made active
- Detect a devicechange from 'audio' to 'video' or vice versa or to 'on'
- Store the actual 'listening mode' in the Domotiz variable

Problems I run into:

-Timing, timing, timing:
Command order like:
- Detect 'Audio' --> SET to 'pause'
- Turn Onkyo on
- wait 2 seconds (to let the Onkyo boot, it seems to miss the command completely during boot
- change listening mode
- Set 'play'
are not executed on time, or not at all. The Kodi media player is not always put to 'pause', the 2 second delay will not delay the next command, but seems to be executed somewhat later etc. Very strange

- Querying listening modes for instance, returns a different string then the string needed to SET the listening mode (for instance: Query result is 'Video 6' 'PC', while setting it to that same input, 'pc' is sufficient. I started a new topic for that: how can can make a sort of table that compares query results, with SET commands? http://www.domoticz.com/forum/viewtopic.php?t=9854 Unfortunately no answers yet and as a mechanical engineer, I can't dream it up myself

- The Onkyo status needs to be pulled, while Onky itself is pushing it's status over the network:
I have the ONKYO app installed on my phone. When this app is running and I change input/volume/listening mode with my std IR remote, the app is updated immediately. My conclusion is that therefore the receiver must be pushing / publishing it's status changes all the time. How to catch these results?

proohu01 wrote:The other queries the receiver so that the correct power state is always visible in Domoticz.

I'm trying to get the second script to work. Since I'm not using a RPI but a Synology, I slightly changed it to reflect the correct path of the Onkyo control app. Placed it in the /scripts/lua folder, gave execute rights and restarted Domoticz. It doesn't update the status, however.

Any idea what the issue could be? I use the name of the switch, not the ID. Switch is type X10 (On/Off) and controlled via domoticz_main.