Remote control any Infrared device using ha and alexa

Nice job!

I do a very similar thing using a broadlink rm pro, although without needing tasker or any other web service, but instead using custom Alexa intents from amazon dev account.

Its helpful isnt it, only problem i have is getting the language right:

alexa, ask home assistant to change channel to bbc one (quite lengthy, working on slimming that)

@CommonBlob Could you share any example config for the RM Pro side of things, im thinking of getting one myself, so would like to hit the ground running :slight_smile:

Can i ask if you use Broadlink’s light switches, or others such as LightwaveRF, if the later, is it controllable from the RM Pro?

Hey Daemonic,

You can check out my config here: https://github.com/CommonBlob/homeassistant_config

I dont use any light switches im afraid. Im in the UK with no neutral wire so they are no good for me, but i do have some plugs and also control tv/amp/xbox etc

Hi

You looked into lightwave rf dimmers? They comply with British Standards but are pricey. Check them out!

I have, but still not totally swayed yet. But this is my current choice for when i take the plunge :slight_smile: Do they report state?

I haven’t got it yet but I will be soon, tried out some infrared controlled dimmers and found out they are no good. I have read somewhere in the forum that they do report state.

Hello mate.

Just read your post again on alexa custom skills and was wondering if you could help me please as I am struggling setting it up.

My ISP is Virgin Media and they do not allow forwarding internal to external ports so I tried setting up custom skills using lambda but failed many times.

Could you please advise me on how you set up your custom skills on amazon’s developer page i.e. location etc.

I have a rm mini 3 and trying to get alexa to change channels on my Virgin box. Any idea on how I could set that up without using a spare android phone plugged on charge (using rm bridge or tasker plugin) waiting for its battery to explode?

Many thanks.

Sure, though i haven’t used the lambda forwarding. I have an Alexa skills kit setup on the amazon dev site.

This is my config:

My intent schema is:

{
  "intents": [
    {
      "intent": "LocateIntent",
      "slots": [
        {
          "name": "User",
          "type": "AMAZON.US_FIRST_NAME"
        }
      ]
    },
    {
      "intent": "WhereAreWeIntent",
      "slots": []
    },
    {
      "intent": "ActivateSceneIntent",
      "slots": [
        {
          "name": "Scene",
          "type": "Scenes"
        }
      ]
    },
    {
      "intent": "RunScriptIntent",
      "slots": [
        {
          "name": "Script",
          "type": "Scripts"
        }
      ]
    },
    {
      "intent": "ChangeChannelIntent",
      "slots": [
        {
          "name": "Channel",
          "type": "Channels"
        }
      ]
    }
  ]
}

Then I have the following Custom Slot types:

Then my sample utterences are:

LocateIntent Where is {User}
LocateIntent Where's {User}
LocateIntent Where {User} is
LocateIntent Where be {User}
LocateIntent Where did {User} go

WhereAreWeIntent where we are all
WhereAreWeIntent where everyone is

ActivateSceneIntent activate {Scene}

RunScriptIntent run {Script}
RunScriptIntent turn {Script}

ChangeChannelIntent watch {Channel}

Then i have my endpoint, which goes to my https server (not forgetting the api_password

That is about it on the Amazon side!

You can see my home assistant side on my github repository: https://github.com/CommonBlob/homeassistant_config

Thanks for this mate really appreciate it. May I ask who your ISP is? And have you forwarded your 443 port to 8123?

And finally how did you configure your RM pro/mini to get Alexa to change your TV channels etc?

Many thanks once again bud.

Im on Plusnet. My router is set to port forward 443 -> 8123 yes.

The config for configuring the broadlink is on my github. But essentially i have a set of automations that change the channels. (test it works locally first). Then alexa just tells HA to run these same automations.

So i say, alexa, tell home assistant to watch bbc 1. This uses the utterence: “ChangeChannelIntent” because it matches the watch {Channel}. And because bbc 1 is in the channel slot, this is the info that is passed on. If you check my channels.yaml in the alexa dir on github it has the other side of it. Also with the chanels.yaml in the automations folder.

Sorry, a lot of moving parts I know :slight_smile:

Tell homeassistant to watch BBC1 is a mouthful…

My approach allows me to simply say, Alexa, Turn BBC1 on.

@Rich_Paul I wouldn’t mind that but like I mentioned earlier having a spare old android phone on charge 24/7 is a little dodgy to me.

@CommonBlob thanks for the detailed info again. I guess I need to get another router and my super hub 2 in modem mode.

Mine works direct with rm pro, not tasker, so no android phone needed, which seems a bit clunky to me, even if my language is a bit clunky instead :slight_smile: Although i think i could get the same effect with emulated_hue, although im not sure you can do automations in that.
However this was part experiment for other things as there are some things you can’t do. Unless you want to turn everything on or off or dim.

Id be suprised if you can do a simple port forward. I think all of my routers have done that in the past, even my crappy sky one. But then, ive never been with Virgin :slight_smile:

I send tenet commands straight to my box and as they are switches, emulated hue can control them…

As above, my switch is a cmd line switch. I expose these to alexa via emulated hue, then I’m able to control each switch by the name of it…

Alexa, Turn e4 on…

Will turn my switch on which will send a tenet command straight to my box.

I cannot forward one port to another which is what is required in the custom skill set up.

Apologies - thought we were discussing my telnet project:

I charge it once every 3/4 days. It doesn’t do anything really so battery lasts.

I was charging it straight from my virgin box/tv, which meant it only started charging when I turned my TV on. So around 4hrs a day…

Iv heard of people using ifttt but the delay is 8 seconds before alexa changes the channel.

I only use the above solution to control my amp as that’s the only thing controlled by ir. A python request was about 7 seconds. A Curl request done it immediately.

I’m now using my old Android as a cctv camera, but more fir the motion detectors. My lights will come on if the sun has set and it detects motion. So iv increased the camera sensitivity and made sure it can see the TV!

If the TV ain’t on there’s a good chance I won’t be I’m that room so works for me.

I am still figuring out how to connect my tivo box to the internet like I mentioned before but I am having no joy. Did you follow or do anything specific after plugging the ethernet cable from your tivo box to your router?

Also are you using anymore or any remote for the project you described in your OP?

Yeah I use anymote. So…

When autoremote sends a message using ha(curl) to the android device - on

Tasker reacts to this message and tells anymote to change the channel. Tasker has a plugin which allows you to perform actions within certain apps.

You just need to install autoremote on the android and follow instructions to get your message url.

Once you’ve don’t that, use my switch config and replace the cmd_on with your URL autoremote provides.

Not sure what to say about your virgin box mate. Most boxes are connected to Internet nowadays and it’s fairly obvious when it’s online, so im assuming yours is an old box with no on demand facilities /catch up tv?

If this is the case, you’ll just need to use the approach above - an old Android device to control it. It’s really not that bad and only a fraction slower than a telnet command,yoh just need to make sure it has a line of sight to the virgin box.

And you’ll be able to say - alexa, turn bb1 on.

You can get the auto remote skill fir alexa but I wasn’t impressed. You need to say alexa, tell anymote to turn the channel to BBC1, and let’s be honest, if we’re automating stuff we need the interaction to be minimum and its more interesting coming up with your own solution (even if using a remote is still quicker, And pretty much ALWAYS within reach ! )