Home Assistant direct control of Control4 AMP and Tuner (no plugin needed)

Thanks @Hansen8601! The strange thing is that I am and have been using your custom component and have all my media players defined like so:

media_player:  
  - platform: control4-mediaplayer
    name: Great Room
    host: "10.0.12.95"
    channel: 1
    on_volume: 15
    source_list:
      - "HC800-1"
      - "HC800-2"
      - "Server"
      - "N/A"
      - "Home Assistant"
      - "Bridge"
      - "Gym Bridge"
      - "Aux Audio"

It works fine as long as the Controller is on. When I unplug the controller, it works for a few minutes and then stops working until I plug it back in. I have tried twice now.

The IP address is assigned to the amp by pfSense. Is there maybe something I need to do from the Controller side to “reset” the amp config or something?

@OtisPresley, the controller has an ethernet pass-through port. Is the amp ethernet connected to the controller? I tested mine again with the controller off for ten minutes, and I can still control the amp.

Hi @Hansen8601, no it is not connected to the controller…only to the switch. I can still ping the amp IP address while the Controller is off.

So what I did last night is I removed all the Amp’s Connections configured in the Controller. I just tested again.

So far, it has been 25 minutes. It is working, but it is not updating the player states in HA anymore. For instance, the Player in the Study, reports that it is Off in Developer Tools, but I can set the Source of the player by calling the service, and it works; however, the state in Developer tools remains the same…Off and no Source.

I can change the source and things, which is an improvement over before where it produced an error message when I tried to control it. This is very strange behavior indeed.

I think my next step would be to actually remote the amp from the Controller and try again to see if that does it.

I removed the amp from the Controller configuration and get the same results. I can control the zones, but the status in HA does not udate. It works fine once I turn the Controller back on…very strange.

I’m able to reproduce it @OtisPresley. My guess is that when the controller is off, the amp tries to communicate with the controller about the state change, causing a different or delayed message back to the component when the controller is off.

I’m going to be traveling for a week, but I will test more when back. Maybe it can be solved by changing timeouts.

@OtisPresley, I pushed a new version to github that fixed the issue for me. It’s a little slower but does change states if the controller is off.

Thank you very much @Hansen8601! I will try it out and report back.

@Hansen8601, I have confirmed that this works. Thank you so much. I can now factory reset the controller and get rid of it. :slight_smile:

I see the delay, but it is not bad at all. I primarily use Alexa Media Player as the input via an Echo Dot, and it takes a few seconds to start streaming anyway.

I like your HA card. I recently built these using Mini Media Player, the Expander Card for all the zones, Slider Rows for the volume controls, and Card Mod for CSS styling.

Tapping the zone switches the Input Boolean, which triggers an automation to change the input and change the speaker icon color to green to indicate it is on the correct input for the media player above.

I leave all my zones powered on all the time and use Input Booleans to switch between the 2 main inputs I use. The buttons on the media player sends variables to a script that plays stations on Alexa and switches the input for the room/view the button is clicked from. I also use Alexa Media for TTS for reminders:

Question about this, I think from reading I already got my answer but would this work at all for the C4-16ZAMSV3-B? I have a audio matrix that does 16in / 16out and I’d love to use but don’t know if this would even work for my case, any help would be nice to point me in the right way!

I haven’t tried it on a matrix switch, only the matrix amp. There’s a good chance the commands are the same, so I’d try. Each output channel is configured as its own media player in HA, so you could start with output one and see if it works.

FYI @Hansen8601, it seems that the delay when the Controller is not powered on causes issues when you have these media players in a scene. I have a scene with 7 of them in it for announcements.

When the scene activates, it takes some time due to the delay, but the power state and source end up changing fine. The volume changes for a couple seconds and then goes back to where it was before the scene activated. Not sure if you see the same or not.

@OtisPresley , I don’t use scenes for my media control, so I haven’t seen this. It sounds like a timeout.

You could change sock.settimeout(1) in the control4Amp.py file to something like 0.5 or 0.25 to see if timing out each command faster works.

Thanks @Hansen8601. I have been experimenting with different values here, but none seem to fix the volume situation in scenes. The Source response is much better at lower values. I currently have it at 0.1 and am testing with Call Service instead of scenes. I will let you know how it goes.

Hi @Hansen8601, So far so good with a timeout of 0.1. I am continuing to test and will report back.

After much experiementation, 0.2 seems to be the sweet spot on this for me so far.

Hi there, this looks super useful, thank you to @bigmac and @Hansen8601 for all the amazing work.

I started with GitHub - kmakar89/Home-Assistant---Control4: Home-Assistant---Control4 (direct control of C4 Amp and Tuner) and am able to get it installed and see it on the HA dashboard. I have a C4 amp but no tuner. I am new to HA and have some questions.

Questions:

If you have a router that shows a list of devices on your network, the easiest way to get the IP address of the C4 amp is to find it in that list.

To cast audio, you would need something plugged into the amp. I have a Sonos Port, but almost anything you can cast to with output jacks should work.

The custom component I wrote does nearly the same thing as the kmakar89 one you installed but wraps all the “stuff” into the Home Assistant media component. You get a media player in HA for each C4 amp channel where you can power on, power off, adjust the volume, and change the source.

Thank you, I didn’t realize I need another device to plug into the amp. The Sonos Port might be too expensive for me. I am looking at something called WiiM Pro.

It looks like the WiiM Pro will do what you need.

@lappet, please be aware that if you want to be able to listen to different things in different zones, then you need multiple sources plugged into the amp. For an inexpensive solution, I have a couple 3rd gen Echo Dots plugged into mine with 3.5mm to stereo cables and use the Alexa Media Player integration in HA so I can create automations around it.

It is more limited than the device you mention, but I stream 99% of my media anyway.