Luckily, there is a method to capture the SOAP commands sent from the MyHome app. So far, I've only tried this on Android
Step 1 - Packet Capture:
Requirements:
- Android Phone
- tPacketCapture
- Wireshark
Steps:
- Install tPacketCapture and Wireshark
- Start Capturing
- Open MyHome Application
- Perform functions that you would like to capture
- Stop Capturing
- Upload pcap file to PC via USB/Email
Step 2 - Filtering the data
- Open the pcap file in Wireshark
- Use the following filter: frame matches "(?i)sendtodevice"
You'll have to read through the filtered message to find what's relevant to your command. I wanted to determine the volume up, volume down, info, and cancel buttons. The following was captured for volume down:
SOAP Command captured from Wireshark:
<c4soap name="SendToDeviceAsync" async="1" seq="866">
<param name="iddevice" type="number">10</param>
<param name="data" type="string">
<devicecommand>
<command>PULSE_VOL_DOWN</command>
<params></params>
</devicecommand>
</param>
</c4soap>
The iddevice number is 10. For my Control4 system 10 is the family room. In an earlier post I showed how to list Director items by ID. I modified the script to list rooms. The script is called getControl4Rooms.py. The modification was really trivial, but I uploaded the script in case there's people that aren't familiar with python.
Step 3 - Sending SOAP Command with Python
If you clone my git repo there will be a script called TestSendSOAP.py. You can insert the message that you captured in Wireshark to test it out.
If anything is unclear, please let me know. This is far from complete. I'm not sure if some commands only work if the system is in a specific state. I'm currently working on encapsulating Control4 items in a python module. Lighting is currently implemented and will be a future post, but the code is on git.