Page 1 of 2

Denon Heos plugin

PostPosted: Mon Jun 12, 2017 2:34 pm
by blysik
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!

Re: Denon Heos plugin, 0.04 release

PostPosted: Mon Jun 12, 2017 9:25 pm
by blysik
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.

Re: Denon Heos plugin

PostPosted: Tue Jun 13, 2017 10:13 am
by jay (support)
Excellent contribution, thanks!

Re: Denon Heos plugin

PostPosted: Wed Jun 14, 2017 3:43 pm
by howartp
There's already a Tesla plugin somewhere.


Sent from my iPhone using Tapatalk Pro

Re: Denon Heos plugin

PostPosted: Wed Jun 14, 2017 10:03 pm
by blysik

Re: Denon Heos plugin

PostPosted: Sun Nov 26, 2017 3:54 pm
by freshwuzhere
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.

Re: Denon Heos plugin

PostPosted: Tue Jul 17, 2018 12:33 pm
by blysik
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.

Re: Denon Heos plugin

PostPosted: Fri Jul 20, 2018 10:57 am
by 7rdr7
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'

Re: Denon Heos plugin

PostPosted: Fri Jul 20, 2018 11:11 am
by blysik
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.

Re: Denon Heos plugin

PostPosted: Fri Jul 20, 2018 2:32 pm
by 7rdr7
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!

Re: Denon Heos plugin

PostPosted: Fri Jul 20, 2018 2:55 pm
by blysik
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.)

Re: Denon Heos plugin

PostPosted: Sat Jul 21, 2018 10:05 am
by 7rdr7
Thanks Bruce! That worked.

Re: Denon Heos plugin

PostPosted: Fri Aug 17, 2018 1:15 pm
by 7rdr7
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)

Re: Denon Heos plugin

PostPosted: Fri Aug 17, 2018 2:27 pm
by blysik
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.

Re: Denon Heos plugin

PostPosted: Mon Aug 20, 2018 7:22 am
by 7rdr7
Thanks Bruce, that will usually clear it for a while. I'll try that again.