Solving Automation Challenges: Logitech Harmony and LG C9 Compatibility

I recently encountered an intriguing issue with my Logitech Harmony and LG C9 setup, and I thought it would be helpful to share my journey in resolving it. This could potentially assist others facing similar challenges or spark some insightful discussions.

The Problem:
My Logitech Harmony remote is a cornerstone of my home automation setup, controlling a variety of devices seamlessly. However, I stumbled upon an inconsistency when using it with my LG C9 TV. Specifically, when the TV is turned off, initiating an activity via Harmony only works if it’s the same input as the TV’s last used state. If it’s a different input, Harmony fails to switch the TV to the desired input most of the time.

Initial Thoughts and Troubleshooting:
My first hypothesis was that this might be a CEC (Consumer Electronics Control) issue. I decided to test this by unplugging all HDMI cables, but the behavior remained unchanged. I then considered the possibility of timing delays. I experimented with adding delays between switching the TV on and changing the input, even extending it to 20 seconds. Unfortunately, this approach didn’t resolve the issue either.

Automation to the Rescue:
Determined to find a workaround, I devised an automation script. This script triggers on a state change in Harmony, checks the selected activity, and sends multiple ‘change input’ commands at intervals. While this significantly improved the situation, it wasn’t a perfect solution. Approximately 20-30% of the time, the TV still didn’t switch inputs as expected.

The Mystery Deepens:
What perplexed me the most was the inconsistency. When I manually triggered the input change via Home Assistant’s developer tools, it worked flawlessly. However, the same command within an automation script didn’t always yield the same result. This inconsistency suggested a deeper issue, possibly related to timing or how the commands were processed within the automation framework.

Exploring Further:
I decided to delve deeper into the automation logs and configurations. I considered the possibility that the automation wasn’t allowing sufficient time for the TV to fully power on and respond to input commands. To address this, I increased the number of repeated commands and extended the delay between them. While this helped, it wasn’t a foolproof solution.

Testing and Iteration:
Through persistent testing, I observed that the automation’s reliability improved with longer delays and more repeated commands. It became clear that the TV’s responsiveness could vary, and a more robust automation script was necessary to accommodate this variability.

Final Solution:
After several iterations, I settled on an enhanced automation script that includes multiple retries with extended delays. This approach ensures that the TV has ample time to respond, significantly reducing the instances of failed input changes. While it’s not a perfect solution, it represents a substantial improvement over the initial setup.

Lessons Learned:
This experience underscored the importance of thorough testing and the value of persistence in troubleshooting complex automation issues. It also highlighted the potential benefits of community collaboration, as sharing experiences and solutions can lead to more effective problem-solving.

I’m eager to hear from others who might have encountered similar issues or have insights into further refining this solution. Your experiences and suggestions could be invaluable in refining this setup and enhancing the reliability of home automation systems.