Page 1 of 1
Denon Heos speakers working with domoticz
Posted: Tuesday 06 September 2016 20:24
by Steven84
Hi,
I’ve managed to get Denon HEOS speaker to work with domoticz. I’am no coder so the way I did it is not nice but It works and I hope that coder will pick this up and get it right.
The Heos speakers have their own Telnet network which communicates on port 1255. The shellscript are giving commands en closes with a telnet cmd. For now a took just a few commands. I will post the API document for more commands.
Putty
• Install/Open putty
• Fill at Host the Heos device IP and set port to 1255
• Give following command in cmd screen:
• heos://player/get_players
The response will be like example below. Important is the PID number. You will need it to command the player.
"name": "'player name 1'",
"pid": "player id 1'",
"gid": "group id'",
"model": "'player model 1'",
"version": "'player verison 1'"
Shellscripts
• Download the Denon HEOS scripts.zip and put in in the scripts location on your raspberry.
• Edit the config.conf file
For example:
HOST=192.168.xxx.xxx
PORT=1255
PID= -133XXXXXX
• Edit path at every .sh file to your own location.
Domoticz
• Add a dummy selector switch with button set
• Make multiple sets en give them names like Play, Pause etc. etc.
• Put script after every levelset.
• And your done.
Next steps
• The device response with a json payload so would be great for the future that the button shows which artist and song the device plays.
• Tunein radio stations listed and playable.
• To implent error handling such as connection timeouts, reconnecting etc. And of course, implement all the API commands and events
API documentation:
http://www.eurostar-ostrava.cz/files/01 ... OL_V01.pdf
Re: Denon Heos speakers working with domoticz
Posted: Wednesday 07 September 2016 8:57
by Sneezydevil
Very nice, coincidentally I was doing the exact same thing last week, I even compiled some code instead of a bash script to create a socket connection.
I started looking into the Domoticz code and I think adding the code for communication with Heos isn’t that hard. But adding it to the control panel would be to time-consuming for me at the moment.
Re: Denon Heos speakers working with domoticz
Posted: Wednesday 07 September 2016 11:15
by Steven84
Great to hear that other People are working on it. Are you willing to share your code?
Verzonden vanaf mijn iPhone met behulp van Tapatalk
Re: Denon Heos speakers working with domoticz
Posted: Monday 12 September 2016 8:23
by Sneezydevil
Sure all my Domoticz related work I am willing to share.
Everything I have sofar is this:
https://github.com/Sneezydevil/DomoticzHeos/
Don't expect it to be finished real soon though.
Re: Denon Heos speakers working with domoticz
Posted: Thursday 15 September 2016 9:00
by Sneezydevil
A little update on my part, I now forked the Domoticz repository and added my previous work. Tonight I will try compiling, if that works like expected maybe we can see if it can be added to Domoticz. Will have to see how gizmocuz thinks about it, its alot like the Logitech Media Server that is already there.
Re: Denon Heos speakers working with domoticz
Posted: Thursday 15 September 2016 9:07
by Steven84
Great work, can't wait.
Verzonden vanaf mijn iPhone met behulp van Tapatalk
Re: Denon Heos speakers working with domoticz
Posted: Friday 16 September 2016 20:59
by Sneezydevil
I got some stuff working now, can't control them yet though.
- HEOS Implementation Start.png (33.75 KiB) Viewed 10004 times
- HEOS Implementation Start 01.png (28.93 KiB) Viewed 10004 times
Re: Denon Heos speakers working with domoticz
Posted: Friday 16 September 2016 21:02
by Steven84
I'am giggling over here like a little girl
Verzonden vanaf mijn iPhone met behulp van Tapatalk
Re: Denon Heos speakers working with domoticz
Posted: Friday 16 September 2016 22:52
by Sneezydevil
In the latest version you can use urls to start / stop / pause the players.
Code: Select all
http://127.0.0.1:8080/json.htm?type=command¶m=heosmediacommand&idx=1&action=play
Next up:
Working remote button.
Re: Denon Heos speakers working with domoticz
Posted: Wednesday 21 September 2016 8:20
by Sneezydevil
Good news last night gizmocuz merged my HEOS work into the master branch. I have some improvements and a remote lined up, but I still need to do a bit more testing on them.
Re: Denon Heos speakers working with domoticz
Posted: Wednesday 21 September 2016 9:54
by Steven84
Great work Sneezydevil! Can't wait
Verzonden vanaf mijn iPhone met behulp van Tapatalk
Re: Denon Heos speakers working with domoticz
Posted: Monday 24 October 2016 23:44
by Steven84
Hey Sneezydevil, can you give a little update? So happy with this functionality. Thanks!
Verzonden vanaf mijn iPhone met behulp van Tapatalk
Re: Denon Heos speakers working with domoticz
Posted: Tuesday 25 October 2016 9:49
by Sneezydevil
Been very busy in my new house, so didn't have alot of time to tinker around with this.
Hope to have some more time soon, with the upcoming dark / cold evenings its likely
.
Re: Denon Heos speakers working with domoticz
Posted: Saturday 05 November 2016 18:39
by Soulplayer
Hy,
Nice to see someone working on this! Can't wait to see the progress!
Soul
Re: Denon Heos speakers working with domoticz
Posted: Sunday 30 April 2017 12:31
by westd001
Hi,
Mabye this is interesting for some users that want to control there HEOS speakers via Domoticz. In my configuration my HEOS speaker isn't working via Domoticz (only start, stop and pause buttons are working OK). The other buttons (for example Favorites button) result in a "2017-04-30 12:01:37.623 Error: HEOS by DENON: Command: 'Favorites'. Unknown command" error.
I used the scripts from steven84 and made some changes.
Here is the layout of my screen :
- HEOS in Domoticz.JPG (149.69 KiB) Viewed 8556 times
For every button I made a dummy switch/push on button with the following "on" commands :
script:///home/pi/domoticz/scripts/heos/stop.sh
script:///home/pi/domoticz/scripts/heos/play.sh
script:///home/pi/domoticz/scripts/heos/volume_up.sh
script:///home/pi/domoticz/scripts/heos/volume_down.sh
script:///home/pi/domoticz/scripts/heos/radio10.sh
etc.
For example the code of the play script (see the zip file of steven84):
PS: For play, pause, stop, volume up and down you don't need to be logged in.
Code: Select all
#!/bin/sh
. /home/pi/domoticz/scripts/heos/config.conf
echo "heos://player/set_play_state?pid=$PID&state=play\r" | nc $HOST $PORT
To be able to select presets via favorites you need to be logged in.
For example the code of the Radio10 script:
Code: Select all
#!/bin/sh
. /home/pi/domoticz/scripts/heos/config.conf
echo "heos://system/sign_in?un=<username HEOS account>&pw=<password HEOS account>\r" | nc $HOST $PORT
sleep 1s
echo "heos://browse/play_preset?pid=$PID&preset=1\r" | nc $HOST $PORT
The number of the preset (preset=1) corresponds to the first, second, third etc. station in your favorites list.
Much more HEOS commands can be found in the CLI description on the DENON site.
Have fun with it.
JJ
Re: Denon Heos speakers working with domoticz
Posted: Monday 15 May 2017 20:27
by peterkrijgsman
Sneezydevil wrote:In the latest version you can use urls to start / stop / pause the players.
Code: Select all
http://127.0.0.1:8080/json.htm?type=command¶m=heosmediacommand&idx=1&action=play
Next up:
Working remote button.
Can you please give a summary of what commands can be used with these urls?
I tried to change volume levels with this, but was unable to get this working.
Re: Denon Heos speakers working with domoticz
Posted: Wednesday 06 September 2017 9:58
by ArjanPeeters
I' couldn't get it to work ether. When i bash the script with te command line. it says port number invalid 1255.
Anybody an idear?
Re: Denon Heos speakers working with domoticz
Posted: Sunday 10 December 2017 12:23
by yorickkk
Does this also works when the heos is connected via the wifi? Because when i communicate with putty ( set the ip address and port 1255) it let me see a black screen. ( i found out, set your putty on telnet)
Re: Denon Heos speakers working with domoticz
Posted: Monday 11 December 2017 22:51
by yorickkk
I got the same.. nc: port number invalid: 1255
Re: Denon Heos speakers working with domoticz
Posted: Tuesday 12 December 2017 12:57
by McMelloW
yorickkk wrote: ↑Sunday 10 December 2017 12:23
Does this also works when the heos is connected via the wifi? Because when i communicate with putty ( set the ip address and port 1255) it let me see a black screen. ( i found out, set your putty on telnet)
yorickkk wrote: ↑Monday 11 December 2017 22:51
I got the same.. nc: port number invalid: 1255
Set the connection to telnet with port 1255
You will get a black screen, but are able to enter commands like heos://player/get_players and get a respons