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

I don’t have any control for the matrix switch in my component, but the amps should be able to both work. The yaml for each media player defines the amp IP address, so as long as that’s correct it should work.

My Matrix switch is actually from TRIAD. The amps are pure power amps only connected to the matrix switch without ethernet.
Might need to do some Wireshark magic to see what is happening on the network. :thinking:

This is awesome - quick, probably dumb, question - does this mean I can then remove the c4_services and other configuration out of my setup? And simply replace it with this? - what about the wider c4_services custom component? Do I remove that? I appreciate the help @Hansen8601 and @gadgetbazza

c4_services:

input_select:
  kitchen_c4_input:
    name: Audio Input
    options:
      - House Chromecast
  kitchen_amp_input:
    name: Zone Input
    options:
      - 1
  lounge_c4_input:
    name: Audio Input
    options:
      - House Chromecast
  lounge_amp_input:
    name: Zone Input
    options:
      - 1
  garden_c4_input:
    name: Audio Input
    options:
      - House Chromecast
  garden_amp_input:
    name: Zone Input
    options:
      - 1
  office_c4_input:
    name: Audio Input
    options:
      - House Chromecast
  office_amp_input:
    name: Zone Input
    options:
      - 1
      
input_number:
  kitchen_amp_volume:
    name: Volume
    min: 0
    max: 1
    step: .01
    initial: .04
  lounge_amp_volume:
    name: Volume
    min: 0
    max: 1
    step: .01
    initial: .04
  garden_amp_volume:
    name: Volume
    min: 0
    max: 1
    step: .01
    initial: .04
  office_amp_volume:
    name: Volume
    min: 0
    max: 1
    step: .01
    initial: .04
    
input_boolean:
  switch_state_1:
    name: Kitchen Switch
  switch_state_2:
    name: Lounge Switch    
  switch_state_3:
    name: Garden Switch    
  switch_state_4:
    name: Office Switch
    
switch:
  - platform: template
    switches:
      kitchen_switch:
        friendly_name: Kitchen
        unique_id: kitchen_c4_switch_uid
        value_template: "{{ is_state('input_boolean.switch_state_1', 'on') }}"
        turn_on:
          - service: c4_services.handle_kitchen_amp_on_select
          - service: input_boolean.turn_on
            data:
              entity_id: input_boolean.switch_state_1
        turn_off:
          - service: c4_services.handle_kitchen_amp_off_select
          - service: input_boolean.turn_off
            data:
              entity_id: input_boolean.switch_state_1
  - platform: template
    switches:
      lounge_switch:
        friendly_name: Lounge
        unique_id: lounge_c4_switch_uid
        value_template: "{{ is_state('input_boolean.switch_state_2', 'on') }}"
        turn_on:
          - service: c4_services.handle_lounge_amp_on_select
          - service: input_boolean.turn_on
            data:
              entity_id: input_boolean.switch_state_2
        turn_off:
          - service: c4_services.handle_lounge_amp_off_select
          - service: input_boolean.turn_off
            data:
              entity_id: input_boolean.switch_state_2
  - platform: template
    switches:
      garden_switch:
        friendly_name: Garden
        unique_id: garden_c4_switch_uid
        value_template: "{{ is_state('input_boolean.switch_state_3', 'on') }}"
        turn_on:
          - service: c4_services.handle_garden_amp_on_select
          - service: input_boolean.turn_on
            data:
              entity_id: input_boolean.switch_state_3
        turn_off:
          - service: c4_services.handle_garden_amp_off_select
          - service: input_boolean.turn_off
            data:
              entity_id: input_boolean.switch_state_3
  - platform: template
    switches:
      office_switch:
        friendly_name: Office
        unique_id: office_c4_switch_uid
        value_template: "{{ is_state('input_boolean.switch_state_4', 'on') }}"
        turn_on:
          - service: c4_services.handle_office_amp_on_select
          - service: input_boolean.turn_on
            data:
              entity_id: input_boolean.switch_state_4
        turn_off:
          - service: c4_services.handle_office_amp_off_select
          - service: input_boolean.turn_off
            data:
              entity_id: input_boolean.switch_state_4

c4_services are the actual files that control the amp and tuner. The c4 services you’re displaying are what sends the commands to c4_services.

For clarity sake, what you displayed should probably be renamed something like c4_interface.

I’d venture to say control 4 caught on and changed the amp so it couldn’t be directly interfaces by IP and most likely you’d need to wireshark commands that are sent to the c4 controller itself as that’s what’s driving the matrix amp.

Thanks - so I keep the c4 services custom component? As well as all the config above in my configuration file?

Yes, unless you opt to make changes to your configuration files of course.

If you use my media player custom component, you would remove the other c4 service.

I also have a Triad matrix and need to get it working with HA. Have you made any progress on capturing the commands on the network? This is a must-do for me, so I’m happy to help develop.

I couldn’t get it to work on my matrix, which was still a control 4. My suggestion is to buy a cheap used HC800 (still has software support), and pay a online C4 installer to configure it and load a generic TCP command driver in the system so it can be controlled by HA.

You could also get an old HC250 etc… and jailbreak the controller and program all this yourself. Google jailbreak control4, but I am not sure about the legality of all that.

Amazing, thank you @Hansen8601 This cleared up so much of my config and automations now with your plugin!

Quick question, I saw you have put the sources option there to name them, how do you actually select a source though? I created a media card similar to yours, so I can now turn on the speakers on and off, as well as one big button calling a script to turn all the speakers off at once - but not sure how to select source:

If you use the mini-media-player custom card, you unhide the source.

type: custom:mini-media-player
entity: media_player.kitchen
group: true
icon: mdi:speaker
volume_stateless: true
hide:
  play_pause: true
  volume_level: false
  source: false
  mute: true

Did some Wireshark sessions but could not yet find any commands send to the matrix. Only found the SSDP requests send from the matrix IP but nothing sent to this IP. I wonder if they use a kind of internal vlan to communicate.

@MrBrad see my other comment

Ah, amazing, yes I have that from HACS and have used it before. Many thanks!

That’s possible, but I’d be more inclined to believe they made it completely proprietary. I suspect after C4 found out their commands and access had been captured and made public, they made those changes. One of the reasons I kept only the matrix amp and tuner was it was far superior (at the time) for power. I haven’t investigated anything else since, but after spending a chunk on money on the C4 system, I was determined to keep what I felt were the best parts.

A vlan would have to be configured at the router/switch level, so unlikely they are creating a vlan. It. could be ssl/tsl encrypted, but you should still see the wire shark traffic. The devices are probably talking directly so you don’t see the traffic. Are you using port replication or something to make sure you see all the traffic?

I try to do remote tcpdump from ubiquity switch, see specific Triad tread Directly Controlling a Control4/Triad Audio Matrix via SDDP - #10 by kiwidan

Hi Folks, just wondering if anyone here is able to use the Control4 Matrix Amp without a Controller? I turned my Controller off, and now this integration is no longer able to control the amp. When I turn the controller back on, the amp is immediately controllable again. Is there something I need to do on the amp itself? It still has an IP address and is pingable. I am specifically using C4-16AMP3-B I bought in 2015.

After reading through the entire thread, it seems that I may have to keep the controller running just for this. :frowning:

Using my custom component you don’t need the controller. Use the amp IP address in the component and it works without the controller.