Mine is doing this too. I am not sure why but the gateway at times sends back too much information. That is why I set it to print the error to the console when that happens instead of sending an error back to HA. I haven’t noticed any issues controlling it through HA since I made that change and it isn’t reporting any errors in HA. Im sure this isnt the most ideal way to handle it but it seems to work so far. And being able to tie the HTD in with Automations in HA has been awesome!
So, mine’s not behaving like this unfortunately, so when I turn ‘on’ the zone 1 switch, it’s not reflecting correctly in the front-end - so causing all kinds of weird behaivor.
I did notice this - that the gateway does return different length results, but in looking at these above - my ‘middle’ snippet is the SUCCESS, and the bottom is an ERROR, but they both contain the SAME INFORMATION, it’s just in different places in the results:
Wonder if there’s a way to use the length part of the function and if < 28 use what it does now and if > 28 then parse it differently to grab the correct ‘part’.
Looks like the longer result includes ALL zone’s information (\x02\x00\x02…) after the hilighted piece in the ‘error’ result is ZONE2’s information I believe.
Doing further research, I’m not really seeing it successfully pass ANY information back into HA. I can turn ON a Zone successfully - which I guess is something - but I can’t then see inputs, volume etc. - it’s like it’s not translating the values being sent back from the controller.
I know Brandon Clap’s method parsed all zones a bit differently, but haven’t had time to take the deeper dive (that and my 0% knowledge of python) into his code to see the changes / differences.
Hi All -
So I made an integration that should take this project to the next level. I was able to make the device a “MediaPlayerDevice” which gives full control over the MCA66.
My integration can power on/off, mute, control volume as well as control the source.
Let me know how this works out for you guys. I hope it works out of the box.
–Adam
ps. I rushed to post this out tonight so if there are holes or things don’t work, I’ll try and help.
Hi All -
So I did some more reading in this thread and noticed that @jagee23 wanted to get mini-media-player
working with the HTD. This was actually exactly what I wanted and I was successful in getting it to work with my integration. After installing the resource (protip: make sure you have advanced options on when going to Configuration --> Love Lace Dashboards --> Resources) and creating a card with the yaml below, I was able to get it to display this -
entity: media_player.zone_1
type: 'custom:mini-media-player'
hide:
controls: true
Hopefully you guys are able to get this to work.
–Adam
This looks great @hikirsch - will definitely check it out, thank you!
Quick question - I have two MCA-66 and two GW-SL1s setup - does your integration allow for the setup of multiple systems perchance?
htd_mc:
- name: Upstairs
host: 192.168.1.123
port: 10006
...
- name: Downstairs
host: 192.168.1.124
port: 10006
...
or maybe:
htd_mc 1:
host: 192.168.1.123
...
htd_mc 2:
host: 192.168.1.124
...
Also, side note for @jagee23 - turns out my Downstairs system (the one I’ve been testing on has the OLD SCHOOL HTDNET-MC Server not the GW-SL1 controller - so THAT’s the reason I’ve been getting all these errors… Called HTD and purchased another GW-SL1 for my Downstairs system and should have it here tomorrow.
@Markus99, No I didn’t account for multiple MCAs. This shouldn’t be too hard for me to update and get rolling. Let me see what I can do.
That would be awesome, thank you so much @hikirsch! Happy to beta test these - though my 2nd GW-SL1 doesn’t arrive until tomorrow, fwiw. Thx again!
Been 3-4 YEARS I’ve been trying to integrate my HTD systems into some kind of home automation - feels like I’m finally nearing the finish line…!
no problems! glad i could help someone out here.
fortunately, these changes were actually really simple, i just pushed the updates to my github repo. the configuration.yaml updates are also there (a bit different from yours so take a look) so check out the example there.
let me know how it pans out!
Hey!
This is awesome, great work! I am actually trying to integrate the MCA-66 with HomeKit, but I am having a hard time figuring out what the command is for getting all zone information back in one command. Does anyone know the command for this? Thanks!
Received my new GW-SL1 yesterday and working to set it up today. Tried configuring mulitple systems and getting an error. Created a ticket on GitHub w/ more info (https://github.com/hikirsch/htd_mc-home-assistant/issues/1)
Thanks in advance!
I truely think HTD is holdiing some kind of grudge against me. All seemed to be working great last night, and now this morning, all media_players are showing unavailable.
Tried a reboot and still showing the same.
Log Details showing:
Logger: homeassistant.components.media_player
Integration: Media player (documentation, issues)
First occured: 8:40:07 AM (1 occurences)
Last logged: 8:40:07 AM
Setup of platform htd_mc is taking longer than 60 seconds. Startup will proceed without waiting any longer.
and
Log Details (ERROR)
Logger: homeassistant.core
First occured: 8:44:47 AM (1 occurences)
Last logged: 8:44:47 AM
Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/htd_mc/media_player.py", line 42, in setup_platform
entities.append(HtdDevice(k, host, port, sources, i + 1, zones[i]))
File "/config/custom_components/htd_mc/media_player.py", line 55, in __init__
self.update()
File "/config/custom_components/htd_mc/media_player.py", line 70, in update
self.zone_info = self.client.query_zone(self.zone)
File "/config/custom_components/htd_mc/htd_mc.py", line 130, in query_zone
return self.send_command(cmd, zone)
File "/config/custom_components/htd_mc/htd_mc.py", line 156, in send_command
return self.parse_reply(data, zone)
File "/config/custom_components/htd_mc/htd_mc.py", line 52, in parse_reply
self.zonelist[zone]['power'] = "on" if (i[4] & 1 << 7) >> 7 else "off"
KeyError: 0
just to keep everyone else following updated, i spoke to @Markus99 and we think we might have found some solution for him, we’re still testing and personally, I’m not 100% comfortable checking in that update until someone else posts this issue too. i’m going to look into further researching the communications portion specifically of the MCA so lets see how it goes.
Adam, great job on taking it to the next level. I’ve replaced my implementation with yours. Have you tried playing TTS over it? Would be neat to use is for alerts, fire alarm, etc.
the HTD device can only play sound from a source, it can’t generate audio. you’d have to trigger something from a source, what you would be able to do now though is turn all the zones on and change the source, control that source and generate your TTS there.
Adam,
Excellent work. This is something I’ve been wanting for years. With my limited capabilities, I settled for just sending on/off commands as part of a few routines, but I’m so happy to see a real integration.
Adam,
Also wanted to say thank you. Just installed and so for so good. Have been keeping an eye out for a solution for a while now that just worked. This appears to be it. This was one of the final components I needed integrated with HA so thank you! Is there a way I can send a donation for your work?
Thanks!
glad i could help here. i am still looking for people to help test a few things out so i can polish this off. if you’re interested in helping and can, please send me a DM and i’ll send you a python test file.
donate to my friends feeding america group! https://www.facebook.com/donate/531771524192224/10222044734936682/
So I finally got around to trying out this integration, and I’m having the same basic issue as @Markus99. I get the “Setup of platform htd_mc is taking longer than 60 seconds” message, though I don’t see anything related the “homeassistant.core” errors he listed.
Hi all, I’m brand-new to Home Assistant, having just installed it via Docker in an Ubuntu system 3 days ago. One of my first test project was to try to integrate it with my HTC MC-66 whole-house audio system via the GW-SL1 and I came across this thread.
Reading through the README file in https://github.com/hikirsch/htd_mc-home-assistant, I came across my very first question… Where in the system do I create the ‘custom_components’ folder relative to where I have my ‘configuration.yaml’ file (which, on my system I have at ‘/etc/homeassistant/’)?
My apologies in advance for the newbie question.