With the Harmony Remote Component in Home Assistant, it makes it possible to send commands to devices controlled by your Harmony Hub using automations and scripts. Here's a script that will send a series of numbers representing a channel and the "OK" button which on my Windows Media Center PC will change to the entered channel.

This script below is used in the morning: I have an automation setup to trigger this script when the TV is turned on between the hours of 6 and 7 AM on weekdays. So in the event I left a different channel the previous night, it will appropriately change the channel to our local ABC affiliate.

script:
    - alias: "Harmony Set HTPC To KETV Channel 7"
      sequence:
        - service: remote.send_command
          data_template:
            entity_id: remote.harmony
            device: 39179774
            command: LiveTV
        - delay:
            seconds: 2
        - service: remote.send_command
          data_template:
            entity_id: remote.harmony
            device: 39179774
            command: ["1", "0", "0", "9", "OK"]

It took me some trial and error and digging through the underlying code for the Harmony Remote component to discover that this command combination was possible, so I hope this blog post helps someone out!

Check out my other posts on Home Automation and other Smart Home technologies here!