Htd gw-sl1 / mc-66

what happens if you set them to “none” like inn the htd app

I figured out a solution for now.

image

Using Mini Media Player Card to hide the sources and put buttons that will trigger a source so that you can set which ones are visible.

type: custom:mini-media-player
entity: media_player.zone_1
hide:
  source: true
shortcuts:
  columns: 4
  buttons:
    - icon: mdi:bluetooth
      type: source
      id: Bluetooth
    - name: Sonos
      type: source
      id: Sonos
icon: mdi:bed-double-outline

Have to test if it works later. but it looks like it does right now.

Let me know if this works for you.

I got it to look like that, but not to switch sources. Do you have a script or something that these buttons are triggers?

My current approach is just to do on/off buttons.

Then when you long press on a button, this screen comes up:

Then the list of sources is there, and it’s not pretty.

Mini Media Player is how i got it done.

use this code.

type: custom:mini-media-player
entity: media_player.zone_1
hide:
  source: true
  play_pause: true
shortcuts:
  columns: 4
  buttons:
    - icon: mdi:bluetooth
      type: source
      id: Bluetooth
    - name: Sonos
      type: source
      id: Sonos
icon: mdi:bed-double-outline
  • Where entity is the zone entity.
  • Hide sets which features you want to hide. so I hide play pause because that doesn’t work and i hide the default sources
  • Shortcuts let you add buttons. and one of the button types allow you to select the source attribute of a media player entity.
  • Id is the exact spelling and capitalization as your source name. this will make the zone switch to that source when pressed.

Thank for your help regarding this thread. I’m brand new to hass. I added all files to the custom_components/htd_lync12 folder and inserted the yaml code in the configuration folder via [https://github.com/UngluedChalice/htd-lync12-home-assistant.] When I go to restart HASS I’m getting the following error message.

"Failed to restart Home Assistant

The system cannot restart because the configuration is not valid: Integration error: htd_lync12 - Integration ‘htd_lync12’ not found"

Does anyone know what I’m doing wrong? I’m using the visual studio code server to make changes.

Hi @UngluedChalice many thanks for the integration.

I have a question as to how you are connecting to the Lync12. Are you connecting a CAT6 to one of the Keypad Ports, or are you using the HTD?NET-Lync Server device?

If you connect to the Keypad Port, does this show up when you query your router, or use fing?

Thanks in advance.

I don’t have any keypads actually. I have the HTD GW-SL1, which I guess they no longer make and only offer a wireless version now?

There are 2 updates you need to make:

  1. Update the manifest.json file to add the Version:
{
    "domain": "htd_lync12",
    "name": "HTD Lync12 Series",
    "dependencies": [],
    "requirements": [],
    "version": "1.0.0"
}
  1. init.py (commenting out the Dict in line 8), just insert a # before the “, Dict” on line 8.

Thanks! I’ve never used Github like this before (I’ve only just copied from others) so I thought I made those changes, but hadn’t. Can you confirm they are updated now when you look at them and I didn’t just change them on my end?

The changes are there, thank you!.

On Line 8 of init.py you need to add the # before the comma,

“homeassistant.helpers.typing import ConfigType#, Dict”

I am using the same device. I get the connection refused error when trying to connect. Any advice?

2022-12-28 15:50:41.367 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up htd_lync12 platform for media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/htd_lync12/media_player.py", line 47, in setup_platform
entities.append(HtdDevice(k, client, sources, i + 1, zones[i]))
File "/config/custom_components/htd_lync12/media_player.py", line 59, in __init__
self.update()
File "/config/custom_components/htd_lync12/media_player.py", line 74, in update
self.zone_info = self.client.query_zone(self.zone)
File "/config/custom_components/htd_lync12/htd_lync12.py", line 172, in query_zone
return self.send_command(cmd, zone)
File "/config/custom_components/htd_lync12/htd_lync12.py", line 205, in send_command
mySocket.connect((self.ip_address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused

Right now I can’t check if things are working or not as I’m in the middle of a re-wire of my network closet. But, I just rebooted and checked the logs and I have the same thing:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/htd_lync12/media_player.py", line 47, in setup_platform
    entities.append(HtdDevice(k, client, sources, i + 1, zones[i]))
  File "/config/custom_components/htd_lync12/media_player.py", line 59, in __init__
    self.update()
  File "/config/custom_components/htd_lync12/media_player.py", line 74, in update
    self.zone_info = self.client.query_zone(self.zone)
  File "/config/custom_components/htd_lync12/htd_lync12.py", line 172, in query_zone
    return self.send_command(cmd, zone)
  File "/config/custom_components/htd_lync12/htd_lync12.py", line 205, in send_command
    mySocket.connect((self.ip_address, self.port))
OSError: [Errno 113] Host is unreachable

I re-wired stuff so I needed to change the zones and I could NOT get Home Assistant to update the zones. So I would try to turn on the Living Room speakers and the Office Speakers would turn on.

Here’s what finally worked. Really just putting it here for someone who needs to change the wiring on the HTD unit so they can update HA more easily than me.

  1. Remove the Lync YAML from configuration.yaml
  2. Download and then delete all the files in the custom_components/htd_lync12 folder.
  3. Restart Home Assistant.
  4. Go into Entities and delete all the Entities associated with HTD Lync 12 integration.
  5. Restart Home Assistant.
  6. Go and delete any groups you made for speaker. (I had to refresh the page as it originally gave me the same error about not being able to delete.)
  7. Restart Home Assistant.
  8. Upload the files I downloaded earlier to the custom_components/htd_lync12 folder.
  9. Restart Home Assistant. If you don’t, you get a “configuration not found” kind of error.
  10. Update the configuration.yaml file.
  11. Restart Home Assistant.
  12. Go and re-create the groups and change the icons for all the media players back to what I had them.
  13. Go to bed.

Thanks for the update. My problem is that I am using an earlier version of the GW-SL1 and will need to upgrade.

Thanks to all contributing to this integration!! I am moving from Homeseer (which has a HTD plugin that works perfectly) over to Home Assistant as Homeseer crashes and is buggy.

Now my issue, I have followed the above directions, and was able to reboot the system. As I am fairly new to HA, I don’t see any Entities or Devices that I can utilize. I have the Lync 12 and here is the section I have in my configuration.yaml.

My issue appears to be that there is something incorrect as when attempting to restart HA I am getting the error
The system cannot restart because the configuration is not valid: Integration error: htd_lync12 - Integration 'htd_lync12' not found.

Any assistance appreciated on how to get HTD control to my frontend!!

htd_lync12:
  - host: 192.168.1.77
    zones:
      - Great Room
      - Rear Deck
      - Cindy Office
      - John Office
      - Julia Bedroom
      - Master Bedroom
      - Garage
      - Downstairs Family Room
      - Jack Bedroom
      - HTD 10
      - Dance Room
      - Guest Room

    sources:
      - GR TV
      - Deck BT
      - C Ofc BT
      - John Ofc
      - Julia BT
      - Master TV
      - Garage TV
      - Family TV
      - Jack BR BT
      - Sauna BT
      - Dance BT
      - Guest BT
      - Google Cast
      - NA 14
      - NA 15
      - NA 16
      - Sonos
      - MP3 Player

This is my manifest.json

{
“domain”: “htd_lync12”,
“name”: “HTD Lync12 Series”,
“dependencies”: [],
“requirements”: [],
“version”: “1.0.0”
}

Does this integration include the Presets available in the HTD app? Thanks.

Hi All -

I see there’s a lot of activity and questions here. I am still supporting this Integration. I can comment on a few things.

  1. The way that the volume works is an unfortunate limitation with how the controller works. It only lets me set a value from 0 to 60. Based on how the increments work in Home Assistant, I have to convert this over to a number from 0 - 100, and you’ll lose precision. My suggestion would be to see if you can control the volume from another device. For example, I tend to keep my MCA at a higher volume and I use the ChromeCast to fine grain the volume.

  2. I see there’s another fork of this repo for the Lync12. I do not have this device but if it is what I think it is, then I think whoever has been heading this (I think @UngluedChalice?), then I think we should chat and I can help integreate the two together.

  3. I see a feature request for managing Presets, unfortunately, this is also another limitation with the controller. The presets for this device are managed by the App itself, and not the controller. Therefore, there’s no way for me to sync a command to the controller to load a preset. I would like to have more information about this request. I do not use the app at all since, well as you all probably know it’s dog shit. So … can you help explain to me how the presets feature works? Maybe I can replicate it as part of the integration.

  4. Lastly, as part of the latest update to comply with the new FeatureEnums, I am now officially supporting updates to the Integration via HACS and better support installation as well. I will also look into using config flows to see if I can discover the controller on the local network and automatically set it up for you. Check out my github for more information. GitHub - hikirsch/htd_mc-home-assistant: An integration for the HTD MC/MCA-66 Series for Home Assistant

Thanks all!

–Adam

2 Likes

Hey All -

I’ve been working on a much more improved client to communicate with the HTD gateway. I have been able to see much improvement on the previous version. Here are some new updates. You’ll be able to install these updates by installing the pre-release v1.2.0-BETA.1.

  • the volume actually goes to 100% now! aside from this, setting the volume is also a lot better and more precise than it was before. i am still new to HASS and I think there’s even more I can do here, I’ll be asking the discord community for some tips.
  • improved communications - the way the client worked wasn’t exactly the way it should have been. after finding lounsbrough’ s MCA 66 client in PHP, I have been able to port over his logic into Python and clean up a lot of the innerworkings. thank you very much for your work!
  • retry logic - there are times the device just, doesn’t respond with an expected result. if this happens, we’ll try up to retry_attempts times (default is 3)
  • command_delay - ok, so if no one has told you guys yet, then let me say that the gateway isn’t the best thing out there. it… can’t handle requests quickly, therefore a delay is recommended inbetween every command. the default is 100ms. you can override this by setting command_delay.
  • support for Balance, Bass, Treble, Party Mode coming soon! to be honest, i don’t even know what Party Mode is, but also soon we’ll be able to set the Balance, Treble and Party Mode. I’m thinking I’m going to have support these features as Number entities since again, I’m not as familiar with HASS. If you have any better ideas, please feel free to suggest them.

That’s all for now. I’ll be testing these personally over the next few days and I’ll make a proper release to the stable channel once I can confirm things are worse than before.

Enjoy!

–Adam

1 Like

Awesome! Thank you so much!

Party mode just sets all zones to on. So you can turn the whole house on without going to every controller or doing it with automation