Initial Setup - Pi3 + Hass.io + Broadlink RM Pro + Google Home

Hi,

I have just got my Pi3, finished installing Hass.io with Samba and SSH. I have a broadlink RM Pro and Google Home.

Please can someone help with some simple steps of what to do next to configure Home Assistant to work with broadlink and then Google Home (from which I want to issue voice commands) for example ‘Hey Google, turn on lounge aircon’.

I am confused as there are no clear instructions out there for someone who has installed hass.io, somewhere it mentioned to install HA bridge by bwssystems is this right?

Please help

Thanks

1 Like

Really no one knows how to setup Hass.io and Broadlink RM Pro? I was told people are keen to help on this forum. Or may be I am posting in the wrong area?

I have RM Pro & hass.io working - I can tell you how I configure them. But I use Alexa for my voice commands and have an ESP8266 in the middle of Alexa & the RM Pro setup so not sure that would be much help to you.

If you want config just for the RM Pro side within HA then I just use this:

- platform: broadlink
  host: !secret broadlink_ip
  mac: !secret broadlink_mac
  name: broadlink
  timeout: 15
  switches:
    reciever1:
      friendly_name: "MBR Aircon"
      command_on: 'JgCWAAABQgABQQABQwABQphRDQsNHg0eDQsNHg0LDQsNCw4LDR4NCw0LDQsNHg0LDQsNHwwLDQsOCw0LDR4NCw0LDQsNCw0LDR8MHw0LDQsNCw0LDQsNCw0LDR8MCw4LDQsNCw0LDQsNCw0eDQsNCw0LDgsNHg0LDQsNCw0eDQsNCw0LDQwNHg0eDR4NCw0LDR4NAAKYmAANBQAA'
      command_off: 'JgCWAAABQgABQQABQwABQphRDQsNHg0eDQsNHg0LDQsNCw4LDR4NCw0LDQsNHg0LDQsNHwwLDQsOCw0LDR4NCw0LDQsNCw0LDR8MHw0LDQsNCw0LDQsNCw0LDR8MCw4LDQsNCw0LDQsNCw0eDQsNCw0LDgsNHg0LDQsNCw0eDQsNCw0LDQwNHg0eDR4NCw0LDR4NAAKYmAANBQAA'
    reciever2:
      friendly_name: "MBR TV"
      command_on: 'JgDqAZSUEjcTNhM3ExISEhMSExISExI3EzcSNxMSEhMSEhMSEhMSEhM3EhMSEhMSExISExISEzcSExI3EjcTNxI3EzcSNxMABf6VkxM2EzcSNxMSExISExISExISNxM3EjcTEhMSEhMSEhMSEhMSNxMSEhMSEhMSExISExI3ExISNxM3EjcTNhM3EjcTAAX+lZMSNxM3EjcTEhITEhITEhMSEjcTNxI3ExISExISExITEhITEjcTEhISExITEhITEhITNxISEzcSNxM3EjcTNxI3EwAF/pSUEjcTNxI3ExISExISExISExI3EzcSNxMSEhMSEhMSEhMSEhM3EhMSEhMSExISExISEzcSExI3EjcTNxI3EzcSNxMABfyXkxI3EzcSNxMSEhMSEhMSExISNxM3EjcTEhITEhITEhMSEhMSNxMSEhMSEhMSExISExI3EhMSNxM2EzcTNhM3EjcTAAX+lZMTNhM3EzYTEhMSEhMSEhMSEzcSNxM2ExITEhITEhITEhMSEjcTEhMSEhMSEhMSEhMSNxMSEjcTNxI3EzcSNxM3EgAF/5STEzcSNxM3EhMSEhMSExISExI3EjcTNxITEhITEhMSEhMSEhM3EhMSEhMSEhMSEhMSEzcSEhM3EjcTNxI3EzcSNxMADQUTEhITEhITEhI3EzcSNw=='
      command_off: 'JgDqAZSUEjcTNhM3ExISEhMSExISExI3EzcSNxMSEhMSEhMSEhMSEhM3EhMSEhMSExISExISEzcSExI3EjcTNxI3EzcSNxMABf6VkxM2EzcSNxMSExISExISExISNxM3EjcTEhMSEhMSEhMSEhMSNxMSEhMSEhMSExISExI3ExISNxM3EjcTNhM3EjcTAAX+lZMSNxM3EjcTEhITEhITEhMSEjcTNxI3ExISExISExITEhITEjcTEhISExITEhITEhITNxISEzcSNxM3EjcTNxI3EwAF/pSUEjcTNxI3ExISExISExISExI3EzcSNxMSEhMSEhMSEhMSEhM3EhMSEhMSExISExISEzcSExI3EjcTNxI3EzcSNxMABfyXkxI3EzcSNxMSEhMSEhMSExISNxM3EjcTEhITEhITEhMSEhMSNxMSEhMSEhMSExISExI3EhMSNxM2EzcTNhM3EjcTAAX+lZMTNhM3EzYTEhMSEhMSEhMSEzcSNxM2ExITEhITEhITEhMSEjcTEhMSEhMSEhMSEhMSNxMSEjcTNxI3EzcSNxM3EgAF/5STEzcSNxM3EhMSEhMSExISExI3EjcTNxITEhITEhMSEhMSEhM3EhMSEhMSEhMSEhMSEzcSEhM3EjcTNxI3EzcSNxMADQUTEhITEhITEhI3EzcSNw=='

The above goes in my switches.yaml which has a pointer to it in configuration.yaml.
And I have secrets.yaml where all my usernames & passwords are stored.

2 Likes

Hi,

Thanks I have learned more since posting this by myself, thought others would help.

I have added the broadlink and emulated_hue to the configuration.yaml file.

I have paired a remote control aircon which works to turn on but when I tell Google Home to turn aircon off it does not work. To make it work I have to tell Google Home to turn aircon on again (whilst it is already on) and if I tell Google Home to turn aircon off it works.

Any idea what I have to do to make it turn off first time? is there a command to check state or something first?

switch:
platform: broadlink
host: xxx.xxx.xxx.xxx
mac: ‘xx:xx:xx:xx:xx’
timeout: 30
switches:
boys_aircon:
friendly_name: “Boys Aircon”
command_on: ‘JgBAAAABF4oSNRISExETEhE1EhITERMREhISExESExESEhIRExESEhI2EhISERM1EhISEhI1EhISNhISEjUSNhIADQUAAAAAAAAAAA==’
command_off: ‘JgBAAAABFosTNBISEhMREhI1EhISEhISEjUSNhISEhISEhISEhESEhISEhISEhISExESNRITETYTERIRExESNhIADQUAAAAAAAAAAA==’
boys_tv:
friendly_name: “Boys TV”
command_on: ‘JgBYAAABJpITEhI3EhMSEhI4EjcSNxISEzcSEhI3EjcTNxMREjcTNxISEjcSNxM3EhISExISExISNxITEhQQExI3EjcSNxI3EwAE1AABJ0kSAAxCAAEmShIADQU=’
command_off: ‘JgBYAAABJpITEhI3EhMSEhM3EjcSNxMSEjcTERI4EjcTNhMREzcSNxISEzcTNhI3EhMSEhITEhISNxMSEhMSEhI3EzcSNxI3EgAE1QABJkkTAAxDAAEmSRIADQU=’
boys_foxtel:
friendly_name: “Boys Foxtel”
command_on: ‘JgCSAA8IBQoEFQUJBQ8FFQQVBQoECgUKBBUFDwUUBQoFCQUaBQoEAAtqDwgFCQUVBB4FFQQVBQoECgUKBBUEEAQVBQoEKQUKBAALag4JBAoFFQQKBQ8FFAUVBAoFCgQKBRUEEAcSBQoECgUaBQkFAArwDhcFFAUKBBAFFAUUBQoFCgQVBRQFDwUVBAoFCgQaBQoFAA0FAAAAAAAA’
command_off: ‘JgBOAA9SBi0GCAgHCAYIQAQAC7UNCQcIBBYHGwgRBRQHJQUVCAwHEwYGCTMIAAtoDTEFNgYjBwcITQYJBggIJgcACwYNlgQkBBYHNAQJBgANBQAAAAAAAAAAAAA=’

#Google Home example configuration.yaml entry
emulated_hue:
listen_port: 80

For some switch types there isn’t any way to tell - my TV & air conditioner both use a power toggle command to turn on or off using the remote - and so using the RM Pro. Same with some 433MHz fans/light units that I have.

So there is no way to tell if the unit is on or off if you also use the remote or the wall switch & home assistant gets out of sync. I have light sensors in each room & am thinking about using that light value to decide whether the light is on or off. Might be able to do the same with the air conditioner as I also have temperature sensors in each room.

I am starting to move to MQTT switches where possible, especially those with inbuilt voltage/current sensors that let the switch know whether the appliance is on or off.

Hi,

Sorry I meant to say is there a way to run a script that first checks variable for state ‘boys_airconstate’ to see what the state variable is set to for example 0 for off and 1 for on. Then if set to 0, swtich on IR device and set state variable to 1.

Like a toggle variable?

If so how do I do this in the configuration.yaml?

I have the same hardware setup as yours but I use IFTTT to link Google Home to Broadlink. IFTTT can accept the voice commands recognized by Google Home and issue webhook request to your HASS to trigger a script. The script then do what you want it to do like toggle switch twice and turn on other device afterwards. So the execution flow as this one:

User speaks voice command -> GH recognized and sent it to IFTTT -> if IFTTT found pre-defined applets match the command then send webhook request to trigger script, otherwise no response -> HASS get the request and then execute script.

emulated_hue plays as IFTTT but is not so flexible. The problem of IFTTT is that you have to create as many applets as the voice commands you need. Applets of IFTTT are edited with web interface which is user-friendly but not efficient if you want to create tens of applets.

The alternative way is to use Google API.AI which also can send webhook request. It can replace IFTTT with more flexibility on voice commands (use intent instead) and can create more human-like responses. The trouble is that you will need some time to learn API.AI and it is always in test mode unless you publish it.

I have tried both and now use IFTTT. It is because the setup is easy and I just wan to have 10~20 commands to control home devices. IFTTT is enough for my purpose.

Thanks if I use IFTTT do you still need emulated_hue or HAbridge?

I prefer to have all running local, dont really want an online service being able to be hacked and my devices being able to be switched on and off by a hacker. However I might try it because Google Home app is forcing login to meethue.com anyway so not truely local setup.

I assume IFTTT is an online service?

Have you got an example of the code you put into IFTTT to turn on and turn off something?

Thanks

emulated_hue or HAbridge are to emulate you devices as Philips hue light bulb so that you can leverage GH’s builit-in hue control mechanism. IFTTT can fulfill the same on/off control with more possibilities.

Yes, IFTTT is online service so you still need to login to IFTTT to setup your applets. Once applets are enabled (no login again), as long as the network is stable, you will feel like running locally.

The setup is quite easy.

  1. add the following lines to configuration.yaml to enable IFTTT component
    ifttt:
    key: !secret ifttt_key # your password to IFTTT account
  2. create the scripts your want to use with IFTTT
  3. login to IFTTT and create your applets.
    this => google assistant channel and define your voice commands
    that => webhook and fill in URL like this one:
    assume the path to your hass is https://myhass.demo.com:8123 (suggest to setup ssl security for better security)

a. to run a script:
https://myhass.demo.com:8123/api/services/script/your_script_name?api_password=your_hass_login_password
Method: Post
Content Type: application/json
Body: not necessary

b. to turn on a switch:
https://myhass.demo.com:8123/api/services/switch/turn_on?api_password=your_hass_login_password
Method: Post
Content Type: application/json
Body: {“entity_id”:“switch.name_to_be_controlled”}

To run all locally, you may try the recent Snips component which is on-device voice recognition platform. It converts the voice to intents. Then you can setup intent components to execute specific task according to the intents. No communication to external network is necessary in the whole process. So there is no compromise on privacy. I have not tested it yet. Maybe you can try it.

Hello there !

Curxlin, i tried to use IFTTT with your explainations.

It work to turn on/off a switch !

But impossible with a script ! (even if it seems smplier)
I don’t know where i am wrong…

The following link is a good tutorial. You may check what you might miss.

In order to figure out what problem you encounter, you may:

  1. Try to call the script in Developer Tools->Services to check if script runs correctly.
  2. Show your script content defined in home assistant and webhook url configured in IFTTT. I may give some help.

Hello i’ve been strugling to find a way to turn on my switches with my GH + hass.io, the problem os that it’s being impossoble to open my ports 443 to outsode world, i think its something on my ISP blocking. Other problem its that I don’t have phillips hue box, and nowadays google home os asking to push a button on your box to setup, and whuthout 443 open I cant use the API google. My question is, whithout 443 port open I can use ifttt? How would be the setup? There is anyway to bypass this new setup on phue? Habridge its an option? Sorry for all the questions I’ve been two weeks trying to find a way to solve this.

Then don’t open 443. Open 6666 (or any number above 1024) externally and point it to 443 internally.

Tks very much I´ll try and will give you feedback, does these ports accept ssl certificates ?

Ports do not ‘accept’, or deny SSL. Ports forward any traffic hitting them to wherever they are told to go. In this case, external traffic hitting your router on port 6666 will be forwarded internally to your Home Assistant machine on port 443.

I recommend you learn what ports are for, and why you need to port forward. For example, read this thread to understand

It’s easy to ask someone to tell you what to do, but when things go wrong you won’t understand what you did, or how to fix it.

Thanks very much i was able to fix things here, I discover that i had to routers and one of them was messing with my hass.io, now it appears everything is running smoothly