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

Looking at the instructions on the GitHub how did you ‘Stop Home Assistant’ without losing access to the config folder? I connect to the file system via Samba

***** 0.92 Break Change Fix *****

Stop Home Assistant
Remove/Rename/Delete c4_services.py
Copy the c4_services folder into the custom_components folder
Open __ init __.py (underscore underscore init underscore underscore.py) and change the IP Address of your AMP and Tuner in all instances.
Start Home Assistant

If successful, a __ pycache __ (underscore underscore pycache underscore underscore) folder will be automatically created registering the c4_services. >> In my case pycache is not created

Can I ask you how you stopped Home Assistant and updated init.py?

I run a HA in virtual, so it’s just a program that runs under the linux OS, so I just stop it, but still have access to modify the files, then restart HA.

If you’re running HA another way, you can modify the files and then restart HA and that’ll do the same thing.

I run HA in VirtualBox. So you have access to the filesystem and the HA config folder (and custom_components) from the host OS (Linux in my case)?

  • I left HA running and access custom_components via Samba to update __init__.py then restart
  • __pycache__ is not created
  • Also what’s not clear is the second step refers to a c4_services.py I can’t find this
  • I know __init__.py is ok as I have successfulyl run this on another HA server

Hi. Thanks for this code and all the help!

I wonder if it could be adapted to my use case. I am trying to use a Control 4 C4-16S2-E-B 16 Channel Audio Matrix Switch. This is a lot like the system you have, but no amp builtin. What I would like to be able to do is control which input goes to which output, and also set attenuation on the outputs so the sound volume levels are not blowing out the speakers (I use old Crestron amps that are made my ATI and are beasts).

Do I need to have the switch talking to a controller, or do you control the matrix directly?

Stop HA, remove the all files from c4_services, modify copies of the originals you should have, put those back in the directory, then restart HA and you should be good to go.

Not sure if it’ll work or not, but you can try using Packet Sender Portable and try sending commands to your matrix to see if you can indeed control it. If packet sender portable can control your matrix, then you can use parts of what I’ve written.

I stopped HA then opened a terminal on the Linux host running VirtualBox but couldn’t find custom_components or c4_services. How do I access these files/directories from the Linux filesystem?

Wherever your config files are located (installed). It’ll be in a directory called .homeassistant .

Really struggling here. Opening up a terminal on the Fedora host I’m running VirtualBox on the command from the root directory

sudo find / -type d -name "c4_services" -print

finds nothing. I can’t find custom_components or .homeassistant either.

Can I maybe copy the __cache__ directory from my other instance that runs? The IP address of the C4 amp is still the same

Try using WinSCP to look as .homeassistant is a hidden dir.

I accessed the Linux file system via WinSCP and did a search from root (/) for a few of the HA directories/files (e.g. config filder, configuration.yaml, .homeassistant) none of which can be found. I’m running HA in a KVM VM.

What am I missing out here? I really love that C4 amp integration and would like to get it back. Hopefully this is not related to HassOS as the working copy is on 2021.9

HassOS is it’s own operating system and you’ll most likely need to use a file manager within HassOS.

I use a virtual environment in linux (Ubuntu 20.04) because I also use my dedicated brix pc (i5 with 8 gigs ram and M2 sata 512 gig) which also allows me to play my MP3’s out of the headphone port into the C4 amp.

Yeah, was able to access the homeassistant folder from within Hass OS (as well as externally via Samba). Removed everything in c4_services, copied the code from GitHub and used my working __input__.py.

What’s your environment?
My working install runs on

  • core-2021.9.5
  • Home Assistant OS 6.2
  • supervisor-2022.05.3

When I have some time I create another new VM with the above version to see whether I can get it started; there will be lots of differences between HAOS6.2 and the latest 8.2…

Hey @bigmac, still having issues in getting my C4 amp to work on the new environment. The services are not registered - I also don’t get a __pycache__ directory in c4_services (per your GitHub).

2022-07-12 22:46:54 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration c4_services which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-07-12 22:48:37 ERROR (MainThread) [homeassistant.components.automation.master_amp_volume] Master Amp Volume: Error executing script. Service not found for call_service at pos 1: Unable to find service c4_services.handle_master_amp_volume_select
2022-07-12 22:48:37 ERROR (MainThread) [homeassistant.components.automation.master_amp_volume] Error while executing automation automation.master_amp_volume: Unable to find service c4_services.handle_master_amp_volume_select
2022-07-12 22:48:39 ERROR (MainThread) [homeassistant.components.automation.gallery_amp_volume] Gallery Amp Volume: Error executing script. Service not found for call_service at pos 1: Unable to find service c4_services.handle_gallery_amp_volume_select
2022-07-12 22:48:39 ERROR (MainThread) [homeassistant.components.automation.gallery_amp_volume] Error while executing automation automation.gallery_amp_volume: Unable to find service c4_services.handle_gallery_amp_volume_select
2022-07-12 22:48:42 ERROR (MainThread) [homeassistant.components.automation.family_living_amp_volume] Family Living Amp Volume: Error executing script. Service not found for call_service at pos 1: Unable to find service c4_services.handle_family_living_amp_volume_select
2022-07-12 22:48:42 ERROR (MainThread) [homeassistant.components.automation.family_living_amp_volume] Error while executing automation automation.family_living_amp_volume: Unable to find service c4_services.handle_family_living_amp_volume_select
2022-07-12 22:48:43 ERROR (MainThread) [homeassistant.components.automation.family_living_amp_volume] Family Living Amp Volume: Error executing script. Service not found for call_service at pos 1: Unable to find service c4_services.handle_family_living_amp_volume_select
2022-07-12 22:48:43 ERROR (MainThread) [homeassistant.components.automation.family_living_amp_volume] Error while executing automation automation.family_living_amp_volume: Unable to find service c4_services.handle_family_living_amp_volume_select
2022-07-12 22:48:51 ERROR (MainThread) [homeassistant.components.automation.gallery_amp_input] Gallery Amp Input: Error executing script. Service not found for call_service at pos 1: Unable to find service c4_services.handle_gallery_amp_input_select

Apart from the edits to configuration.yaml and automations.yaml, copying the files to config/custom_components/c4_services and editing __init__.py is there anything else I need to have on my environment; e.g. HACS, python_script enabled etc.?

What environment are you running on? Python version etc. Would you be able to send through the config snapshot under system health?

Did you add the service to config yaml?

Turns out that the issue was related to the splitting of configuration.yaml. Had some issues with indentation (although no errors).

Anyway all good now :slight_smile:

Thanks

I only “see” a few of the entities I have left under my Control4 system (after I have successfully added the HA/C4 cloud integration). At the moment I “see” a few lights and a C4puck in HA. How do I add entities on the Control4 side so they appear as entities to be controllable on the HA side? Thanks!

For whatever reason I can’t control my C4 amp anylonger. I have shutdown my system as we were away for a while - although this shouldn’t change anything.

How can I enable logging to see what happens here?

Uncomment the log lines in the init.py.