Denon Heos plugin

Posted on
Mon Jun 12, 2017 2:34 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Denon Heos plugin

I created my first plugin for the Denon Heos line of speakers.

https://github.com/blysik/indigo-heos

It's very basic. It auto-discovers Heos speakers on your network, and lets you create devices from them. It polls each device for state, and has a limited set of actions right now. (Play, pause, stop, volume up, volume down, set volume, and play input from other speaker.)

It's also my first attempt with Python, so be gentle.

Feel free to open github issues and I'll try to address them as I can.

Mods, can I get a blysik's Plugins forum? I intend to have a crack at a Tesla plugin soon also, and would like to group my projects together.

Thanks!
Last edited by blysik on Mon Jun 12, 2017 9:26 pm, edited 1 time in total.

Posted on
Mon Jun 12, 2017 9:25 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin, 0.04 release

Iterated on the plugin tonight, and up to version 0.0.4 Some bug fixes, and now input list is generated by querying the speaker device, rather than requiring you to type it into a text box.

Posted on
Tue Jun 13, 2017 10:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Denon Heos plugin

Excellent contribution, thanks!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Jun 14, 2017 3:43 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Denon Heos plugin

There's already a Tesla plugin somewhere.


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Jun 14, 2017 10:03 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin


Posted on
Sun Nov 26, 2017 3:54 pm
freshwuzhere offline
Posts: 101
Joined: Apr 05, 2012

Re: Denon Heos plugin

Hi Blysik!

I have been playing with your plugin and it is a great - and I appreciate you making this.

I have seen a bug when I execute the Heos On action. It generates :-

Traceback (most recent call last):
File "plugin.py", line 55, in runConcurrentThread
NameError: global name 'traceback' is not defined

Heos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)


It does seem to work despite the error message.

I also get these:-

Traceback (most recent call last):
File "plugin.py", line 55, in runConcurrentThread
NameError: global name 'traceback' is not defined

Heos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Heos Error Error in plugin execution runConcurrentThread:


Same error - different manifestation.

Hope this feedback is useful.

Posted on
Tue Jul 17, 2018 12:33 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin

I've added 0.0.5 to github, and submitted the plugin to the Plugin Store. I've fixed the traceback issue you reported, and also added some additional error handling.

Posted on
Fri Jul 20, 2018 10:57 am
7rdr7 offline
Posts: 163
Joined: Aug 16, 2017
Location: Washington DC Metro

Re: Denon Heos plugin

Hi Bruce,
Thanks for updating this plugin. Does it support HEOS Amplifiers as well? I tried to enable and got a stream of errors below:
Ron

Jul 20, 2018, 12:49:57 PM
v0.0.5 of plugin Heos is already installed but is disabled (enabling)
Loading plugin "Heos 0.0.5"
Starting plugin "Heos 0.0.5" (pid 71710)
Started plugin "Heos 0.0.5"
Heos Your plugin version, v0.0.5, is current.
Heos Error exception in deviceStartComm(Pool Speakers): 'station'
Heos Error runConcurrentThread error:
Traceback (most recent call last):
File "plugin.py", line 50, in runConcurrentThread
self.updateStatus(devId)
File "plugin.py", line 127, in updateStatus
{"key": "media-station", "value": media['station']},
KeyError: 'station'

Heos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Heos Error runConcurrentThread error:
Traceback (most recent call last):
File "plugin.py", line 50, in runConcurrentThread
self.updateStatus(devId)
File "plugin.py", line 127, in updateStatus
{"key": "media-station", "value": media['station']},
KeyError: 'station'

Heos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Heos Error runConcurrentThread error:
Traceback (most recent call last):
File "plugin.py", line 50, in runConcurrentThread
self.updateStatus(devId)
File "plugin.py", line 127, in updateStatus
{"key": "media-station", "value": media['station']},
KeyError: 'station'

Posted on
Fri Jul 20, 2018 11:11 am
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin

What hardware are you using?

The error you're showing is something I can guard against with better Python programming, which I can do shortly.

Posted on
Fri Jul 20, 2018 2:32 pm
7rdr7 offline
Posts: 163
Joined: Aug 16, 2017
Location: Washington DC Metro

Re: Denon Heos plugin

A first generation HEOS AMP (HS-1). I realized that only one of the amps was affected (I have 2 amps for the pool speakers), so I deleted and recreated the problem device, still had the issue, so played music from that amp and then paused it from the HEOS iPhone app, then the issue went away. If it comes back, I'll update the post. Thanks for your reply, and for developing this plugin!

Posted on
Fri Jul 20, 2018 2:55 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin

I went ahead and released 0.0.6, which should guard against that specific bug. (Not sure how it happens, but at least we catch if the key isn't present.)

Posted on
Sat Jul 21, 2018 10:05 am
7rdr7 offline
Posts: 163
Joined: Aug 16, 2017
Location: Washington DC Metro

Re: Denon Heos plugin

Thanks Bruce! That worked.

Posted on
Fri Aug 17, 2018 1:15 pm
7rdr7 offline
Posts: 163
Joined: Aug 16, 2017
Location: Washington DC Metro

Re: Denon Heos plugin

Hi Bruce! I'm getting the following error every few minutes, any idea? Thanks, Ron

Heos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Heos Error runConcurrentThread error:
Traceback (most recent call last):
File "plugin.py", line 50, in runConcurrentThread
self.updateStatus(devId)
File "plugin.py", line 117, in updateStatus
media = heos_obj.get_now_playing_media()
File "./lib/heos/heos.py", line 152, in get_now_playing_media
'player/get_now_playing_media', {'pid': self._get_player_id()})
File "./lib/heos/heos.py", line 78, in send_command
return self._recv_reply(command)
File "./lib/heos/heos.py", line 117, in _recv_reply
data = json.loads(msg.decode('ascii'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 145: ordinal not in range(128)

Posted on
Fri Aug 17, 2018 2:27 pm
blysik offline
Posts: 213
Joined: Jan 06, 2015

Re: Denon Heos plugin

Try reloading the plugin? Also make sure your Heos speakers are on. I've seen some problems where if they are sleeping, the plugin won't find them, but reloading a few times eventually works. I haven't been able to figure it out yet.

Posted on
Mon Aug 20, 2018 7:22 am
7rdr7 offline
Posts: 163
Joined: Aug 16, 2017
Location: Washington DC Metro

Re: Denon Heos plugin

Thanks Bruce, that will usually clear it for a while. I'll try that again.

Who is online

Users browsing this forum: No registered users and 5 guests