Alexa - Broadlink/OpenMQTTGateway - TV Channel changing goodness!

Alexa - Broadlink/OpenMQTTGateway - Home Assistant TV controller including channel selection.

This customization uses a modified broadlink.py file from from Vassilis Panos’s project at https://github.com/vpnmaster/homeassistant-custom-components as well as a modified version of the default Home Assistant Alexa component module (added ChannelController and Steppedvolume control).

Background

I was using the Broadlink Alexa skill and found it had a tendency to keep adding extra digits when responding to a change channel command on my TV. Since I am also using Home Assistant (with Haaska) at home, I felt I would rather be able to control all aspects of the broadlink from my own system instead of depending on a third party buggy tool which I have no control of. After looking around, I could not find anything that was accomplishing all I wanted to do without ugly hacks. I decided to use Vassilis broadlink.py component as as base since it had most base functions setup. I would then add the rest of the functions I needed.

The missing functions that were added.

  • Ability to switch a tv channel simply by typing in the channel number or TV Callsign in an input box or use Alexa phrases such as “Alexa, change channel to 123 on TV” , “Alexa, change channel to PBS on TV”

  • Play/Pause a TV broadcast (I have a PVR)

  • Volume stepped control via Alexa . For example say" Alexa, increase volume by 10 on TV:.

  • Also added an OpenMQTTGateway media_player component with same functionality as the broadlink component. With OpenMQTTGateway firmware and a sonoff RF bridge we can also control RF devices as well as IR.

FYI, changing channels can also be done with Google home by having your code call the media_player.play_media service with the following payload:

{
“entity_id”: “media_player.tv”, # where tv is whatever you named your broadlink/openmqtt device
“media_content_id”: “channelnumber” or “channel name”
“media_content_type”: “channel”
}

See the project here:

3 Likes