Denon Heos speakers working with domoticz

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Denon Heos speakers working with domoticz

Post 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
Attachments
Overzicht switches.jpg
Overzicht switches.jpg (119.85 KiB) Viewed 10168 times
HEOS overzicht.jpg
HEOS overzicht.jpg (121.8 KiB) Viewed 10169 times
Denon HEOS scripts.zip
Shellscript to communicate with the devices
(1.18 KiB) Downloaded 515 times
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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.
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Re: Denon Heos speakers working with domoticz

Post 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
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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.
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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.
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Re: Denon Heos speakers working with domoticz

Post by Steven84 »

Great work, can't wait.


Verzonden vanaf mijn iPhone met behulp van Tapatalk
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post by Sneezydevil »

I got some stuff working now, can't control them yet though.
HEOS Implementation Start.png
HEOS Implementation Start.png (33.75 KiB) Viewed 10001 times
HEOS Implementation Start 01.png
HEOS Implementation Start 01.png (28.93 KiB) Viewed 10001 times
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Re: Denon Heos speakers working with domoticz

Post by Steven84 »

I'am giggling over here like a little girl


Verzonden vanaf mijn iPhone met behulp van Tapatalk
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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&param=heosmediacommand&idx=1&action=play
Next up:

Working remote button.
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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.
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Re: Denon Heos speakers working with domoticz

Post by Steven84 »

Great work Sneezydevil! Can't wait


Verzonden vanaf mijn iPhone met behulp van Tapatalk
Steven84
Posts: 69
Joined: Tuesday 15 April 2014 17:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Vaassen
Contact:

Re: Denon Heos speakers working with domoticz

Post by Steven84 »

Hey Sneezydevil, can you give a little update? So happy with this functionality. Thanks!


Verzonden vanaf mijn iPhone met behulp van Tapatalk
Sneezydevil
Posts: 111
Joined: Monday 18 January 2016 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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 :).
Soulplayer
Posts: 29
Joined: Saturday 05 November 2016 16:54
Target OS: -
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post by Soulplayer »

Hy,

Nice to see someone working on this! Can't wait to see the progress!

Soul
westd001
Posts: 22
Joined: Friday 28 August 2015 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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
HEOS in Domoticz.JPG (149.69 KiB) Viewed 8553 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
peterkrijgsman
Posts: 2
Joined: Monday 15 May 2017 20:24
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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&param=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.
ArjanPeeters
Posts: 10
Joined: Wednesday 07 September 2016 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Location: Netherlands
Contact:

Re: Denon Heos speakers working with domoticz

Post 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?
yorickkk
Posts: 2
Joined: Sunday 10 December 2017 12:12
Target OS: Windows
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post 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)
yorickkk
Posts: 2
Joined: Sunday 10 December 2017 12:12
Target OS: Windows
Domoticz version:
Contact:

Re: Denon Heos speakers working with domoticz

Post by yorickkk »

I got the same.. nc: port number invalid: 1255
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: Denon Heos speakers working with domoticz

Post 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
Greetings McMelloW
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests