Page 1 of 4
Onkyo receiver <--> Domoticz
Posted: Tuesday 21 January 2014 21:51
by Keptenkurk
Connected my Onkyo receiver through a Python library on the Rasp (<- cool, switching it on and off through LUA)
@safi78 do you mind sharing how that's done? I now switch off my entire onkyo receiver with a KAKU switch...
/paul
Re: Onkyo receiver <--> Domoticz
Posted: Tuesday 21 January 2014 22:10
by safi78
Hi sure,
There are several python libraries available to do this you can use on your Rasp.
I used to do it your way, but that didn't 'sound' right, right
Anyway, with the library you have full control over your Onkyo, so you can change the inputs, volume, zones, etc.
I'm just about to install a new Rasp with it, so I'll let you know in a minute how it's done.
Re: Onkyo receiver <--> Domoticz
Posted: Tuesday 21 January 2014 22:56
by safi78
if you followed the wiki you need to install python-setuptools first, seemed to be missing in my setup:
Code: Select all
sudo apt-get install python-setuptools
then do:
then you have a new command for use in terminal, for example:
or
it will discover your onkyo in your local network automagically
see
https://github.com/miracle2k/onkyo-eiscp for some more examples / functions.
after that you can use it in LUA for example:
Code: Select all
if (devicechanged['FakeOnkyoSwitch']="Off") then
os.execute('/usr/local/bin/onkyo blablabla)
end
Other cool thingy: I'm also using this to let my home 'talk' to me

work in progress, but it's pretty fun ...
for instance, on alarm, turn to the right input/output on your receiver, put volume high and talk to your burgler ... or sound alarm through your speakers
or on doorbell, idem.
or when the bluetooth adresses of my familiy is detected, tell me,
weather status, suggestions, reports, etc.
Re: Onkyo receiver <--> Domoticz
Posted: Tuesday 21 January 2014 23:06
by safi78
Oh btw, that also works on Apple. I think I used Brew for all the python stuff, but works like a charm (didn't get the autodiscover working, but you can also specify the hostname when issuing the command!)
happy hacking

Re: Onkyo receiver <--> Domoticz
Posted: Wednesday 22 January 2014 8:14
by Keptenkurk
Thanks Sander!
You're right about the Onkyo: the "Ahummmm" when switched on doesn't sound right!
That doesn't look too complicated and will try it this evening. I noticed Onkyo's commandset but couldn't figure out how to send these in TCP to the receiver.
Somebody already did the hard work
Will report back
/paul
Re: Onkyo receiver <--> Domoticz
Posted: Wednesday 22 January 2014 10:33
by safi78
Do you mean you found that excelsheet with all Onkyo receivers / possible commands? If not, I'll post that here as well, very useful
Re: Onkyo receiver <--> Domoticz
Posted: Wednesday 22 January 2014 13:28
by Keptenkurk
I did find that earlier and also the protocol description.
Did put it on my to do list to investigate further until i read your comment

/paul
Re: Onkyo receiver <--> Domoticz
Posted: Wednesday 22 January 2014 16:57
by safi78
Hehe. This actually was my reason to leave HomeWizard and move to Domoticz.
I'm really curious what you're gonna use / commands you implement! Let me know

Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 21:06
by l0gic
I've just seen this thread and as I have an Onkyo......
I had to make the Onkyo network setting to enable network on standby but I've had some success!
I've used the command line to discover and then fire up my Onkyo, excellent.
Volume control works but I've not had any success putting the system back into standby.
Power:on works but power:off just gives an error even though it is an example in the documentation.
I've not had any real time to devote to it at the moment but it looks like it has some potential.
Cheers
Kevin
Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 21:10
by safi78
shows all available commands for zone "main":
output:
Code: Select all
root@jarvis ~ $ onkyo --help-commands main system-power
Possible values for this command:
standby - sets System Standby
on - sets System On
query - gets the System Power Status
that'll get you started

Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 21:29
by l0gic
Nice one!
I'll have a play tomorrow if I get a quiet minute.
Thanks
Kevin
Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 22:27
by mongoose
Notes on Power On
For the power on command to work while the device is in standby, make sure you turn on the obtusely named Setup -> Hardware -> Network -> Network Control option.
Without it, you can only connect to your receiver while it is already turned on.
--------------
Ahhhh was wondering about that.
Really cool all working!
Can't wait to play with it more!
Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 22:32
by Keptenkurk
Magic!
Works right out of the box.
The power:standby needs a device setting on the receiver to work. It helped reading the notes on that
For the power on command to work while the device is in standby, make sure you turn on the obtusely named Setup -> Hardware -> Network -> Network Control option. Without it, you can only connect to your receiver while it is already turned on.
Not only will it give tracebacks due to a timeout while waiting for a response of a switched off receiver, but you will also not be able to put it on again through the network...
Thanks Sander!
/paul
Re: Onkyo receiver <--> Domoticz
Posted: Thursday 23 January 2014 22:33
by Keptenkurk

not the only one ...
Re: Onkyo receiver <--> Domoticz
Posted: Friday 24 January 2014 10:15
by mongoose
Bit new my self to LUA so cheers for posting the code above... for any one like me that is no programmer

the exact code below to put on the pi (it works, might have stuff it doesn't need... lol)
Code: Select all
commandArray = {}
if (devicechanged['Dummy_onkyo_switch'] == "On") then
os.execute('/usr/local/bin/onkyo system-power:on')
commandArray['Dummy_onkyo_switch'] = on
end
return commandArray
right now to turn zone 2 on to a certain internet station at a certain sound level.
and still to figure out how to play an mp3 welcome msg when I enter the house... any idea how to do that one, commands to use etc?
Re: Onkyo receiver <--> Domoticz
Posted: Friday 24 January 2014 11:07
by safi78
Hi Mongoose,
You'll have to hookup your Rasp to your receiver for that, but you surely can influence the inputs/outputs through code now, so that's easy
1. Check condition (Door open, Motion, whatever);
2. put Onkyo in the right state;
3. Play Sound or speak
There are two 'speech' libraries i know off that work on Raspberry:
espeak (apt-get install espeak)
flite (apt-get install flite)
I'm playing around with it, but for some reason it crashes my Raspberry after a few 'sentences' (full halt, needs reboot).
To play a .wav or .mp3 (barking dog for burglars that triggers event when in alarm 'state' was my idea

) you can google around. Or just 'cat' it to your /dev/audio device, that'll probably work too. (I'm not there yet, trying to figure out the crashing with speech first)...
regards,
Re: Onkyo receiver <--> Domoticz
Posted: Saturday 25 January 2014 1:57
by safi78
If anyone is playing around with Raps and speech stuff as well: I can't seen to figure out why my Rasp keeps crashing after using the speech packages (flite, espeak) ... putting this one in the fridge for a while

Re: Onkyo receiver <--> Domoticz
Posted: Saturday 25 January 2014 2:58
by mongoose
safi78: are you using a powerful enough power supply with your pi... I am using a crappy low 500mA one, which worked good until I wanted to put XBMC on the Pi and it didn't let me use a usb keyboard, hunted around for a solution, and found that... so now if I want to play around with XMBC I use my 2A phone one

could be a similar thing...
Re: Onkyo receiver <--> Domoticz
Posted: Saturday 25 January 2014 3:03
by safi78
Hi mongoose,
yeah, thought of that, tried a 'decent' adapter, and several other stuff (plugged it into my synology, mac mini, etc to rule out the power issues) it's really 'audio device related'. Found several reports on the rasp-forums (older, but similar problems) as well. Not sure, but I don't think it's power related. Oh well, lot's of stuff to do, this just went at the end of my wish list

I might do the feedback / speech handling on a decent debian server then

Re: Onkyo receiver <--> Domoticz
Posted: Thursday 27 February 2014 1:06
by mongoose
Safi78: any progress with the speech? I just came across this:
http://www.rmnd.net/speech-recognition- ... d-arduino/
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