HA-Bridge on HASS.IO

Hi

Sorry did not get back to you it was late. How do I uninstall emulated_hue?

Something slightly different. Is it possible to combine more than one ir command together?

I want boys tv to switch on and change source to be hdmi 3 which is 5 remote button presses.

Where do I go to create a script and do you know how to code a toggle variable?

Made some awesome progress in a short space of time yesterday thanks to your help cheers.

1 Like

Hi, when you installed Google Home 1.19.29 did it force you to upgrade to newest version mine did !!!

Defeats the purpose of installing an older version if the app forces you to newest. This happend when I went into Google Home device settings.

Did you get this?

Go to play store on your device.

Go to settings.

Adjust auto update apps to not auto update.

Uninstall new home app, reinstall old app.

I use an older device for this stuff and use the newer apps on my phone, I have been having compatibility problems with a few things since putting Android 8 on my phone.

Late for me too, I typed that on my phone in bed. To uninstall you just open your configuration.yaml and comment out the emulated hue section and restart hass. You can delete it entirely or put a # in front of it so it gets ignored.

# emulated_hue:
#   host_ip: 192.168.1.7
#   listen_port: 80
# emulated_hue 1:
#   type: alexa

If the service has toggle, like the light component you put that in the action of your automation…

  action:
    service: light.toggle
    entity_id: light.bedroom_ceiling

For scripts see…

For use with voice you would create two different scripts and map one script to the ON call and one script to the OFF call, a script is simply run, it doesn’t get turned off. So for your TV setup you would probably need to run a sequence of actions to turn on, change input etc and have delays if needed. I use a harmony remote so haven’t ventured into this.

As an example of another way to do things here is an automation I have for turning my yamaha AV reciever on and changing to the correct input automatically if my chromecast starts playing something.

- alias: khonsu begins playing
  trigger:
      - platform: state
        entity_id: media_player.khonsu
        to: 'playing'
        from: 'idle'
      - platform: state
        entity_id: media_player.khonsu
        to: 'playing'
        from: 'off'
      - platform: state
        entity_id: media_player.khonsu_2
        to: 'playing'
        from: 'idle'
      - platform: state
        entity_id: media_player.khonsu_2
        to: 'playing'
        from: 'off'
  action:
    - service: media_player.turn_on
      entity_id: media_player.kitchen_avr
    - service: media_player.select_source
      data:
        entity_id: media_player.kitchen_avr
        source: AUDIO1

Great lots to absorb here I will read the script syntax first wont get anywhere without this.

Just want to check the workflow for HAbridge versus Emulated_hue:

  1. HAbridge:
  • Add device in configuration.yaml under broadlink / switch with on and off ir codes (this is for HA to communicate with broadlink) makes availble manually in state section of HA.
  • Build HA device configure as required (add multiple in one if required Boys TV and Boys Foxtel together) and update bridge (this makes devices visible to Google Home?)
  • Google Home app add device and nickname (used for voice command? or is it the name of the HAdevice in Bridge that Google Home uses?)
  1. Emulated_hue: (uninstall HABridge addon)
  • Add device in configuration.yaml under broadlink / switch with on and off ir codes (this is for HA to communicate with broadlink) makes availble manually in state section of HA.
  • Enable Emulated_hue in configuration.yaml
  • How do I create a script that for example turns on Boys TV and Boys Foxtel at the same time and associate it with HA so that it is available to Google Home? how does it work?
  • Does the script then call what is in configuration.yaml that then passes it to Broadlink RM Pro?

Just can’t get me head around the Emulated_hue end to end approach?

I’m not really sure about most of that. I don’t use emulated hue.

For almost everything I build the switch or script in home-assistant. The exceptions are non home assistant things, like my harmony bridge which allows me to call an activity much like your tv, foxtel input setup.

So,for your activity first you need to be able to turn on the TV. Work that out. You will need to enable the specific component that works with your TV. This will come under media_player.

Then you need to turn on foxtel. Work that out. Also media_player? Or maybe you will need some sort of remote like a harmony or rf to reach it? Search forums for foxtel perhaps.

Then you need to select the correct inputs. Work that out. Media-player services.

Once you have all the pieces you can then call them in sequence with a script or automation.

Until you have each device available as a component in hass and can control it you can’t even begin to pass this control on to google home.

Ha-Bridge can then pull the info required for light, switch, script and so on directly from hass and very little is needed to be done to expose these as Hue light switches to google home or alexa.

The name you call each device in habridge is what google will pull the device in as. I have never used google nicknames so am unsure. You can do this same thing with Emulated hue.

I think you can use both ha-bridge and emulated hue at the same time but google home requires port 80, alexa uses different ports. I don’t think both emulated hue and habridge can use port 80. The docs for emulated hue would be worth reading through as well as all the threads on here.

For your specific devices I would search the forums for these and see what other people have done as well as read the component instructions. You want these working in Hass first.

And lastly I’m not sure but it sounds like you are trying to leap into the deep end. It would be worthwhile doing some basic automation’s and so on first to connect all the dots. Take it slowly and build everything up. A great resource here are the examples people have shared on git hub, even sharing their entire configuration setups.

Great thanks I will have a read through thanks VERY much for your guidance.

In the script syntax section is does not really say in laymans terms what a service is and why to use it?

To acelerate my learning, can I walk an Automation example through with you:

  1. When my mobile (for example is 192.100.100.2) is in range of wifi turn on boys aircon if boys aircon is not on already.

I have added device tracker to configuration.yaml but what do I do next?: I have ‘the boys aircon’ in HAbridge:

device_tracker:

  • platform: nmap_tracker
    hosts: 192.100.100.1/24
    home_interval: 10

What do I add next?

Cheers

Each domain has corresponding services. See here https://home-assistant.io/docs/automation/

So the domain is the component part but at the top of the hierarchy, for example I have three different types of lights. The domain is light. But I have limitlessled, lifx and xiaomi lights which all have different abilities.

The light domain allows for the services ‘turn_on’ , ‘turn_off’ , and ‘toggle’ on all of these.

In an action part of an automation you define the service call as domain.service

  action:
    service: light.turn_on
    entity_id: light.foyer

See https://home-assistant.io/components/light/

If you click on the little remote looking icon at the bottom of the hamburger menu you can explore the domains and services you have available. It will also show additional data commands you can send along with the call.

Would be well worthwhile following some basic tutorials to get the gist. Bruh automation on you tube has a lot of this stuff covered in easy to follow tutorials with examples. https://www.youtube.com/channel/UCLecVrux63S6aYiErxdiy4w

This is SO exciting stuff. Okay things are starting to make a bit more sense.

To really get it can you show me the end to end code syntax and where it is located for example:

For above: can you show me your configuration.yaml to follow the syntax for this.

Next:

Above: did you create the service to turn on, off etc or are these out of the box where are they located in configuration.yaml?

Next:

Above: where do you set the entity_id, surely light.foyer must resolve to an ip adress or something?

Once I get it I think it will prepare me to think through how it all hangs together, at the moment I am trying to stitich it together and need an end to end walkthrough with literal syntax and where to put the code.

Sorry this must be tedious for you but you are really helping me accelerate my practical learning.

The configuration I have is completely split and separated and would likely confuse you. It is not the recommended way to do things anymore. If you look through a couple of the cookbook examples I linked earlier you will see ten different ways of setting it up. It is probably going to be much easier to follow some of the basic tutorials before trying to get your head around splitting with includes.

The light component is added by putting

light:
  platform: limitlessled

or

light:
  - platform: xiaomi_philipslight
      ... config specific to this platform
  - platform: limitlessled
      ... config specific to this platform
  - platform: lifx
      ... config specific to this platform

see light component and install your specific light platforms according to the devices you have.

The three light services on, off and toggle I mentioned above are all available by default on all light platforms.

The entity ID is set by bringing the device into home assistant, if you look at the image above where I showed you how to check available domains and services you will see a button next to the one circled in red that looks like < > , if you click on this it will list all your available entities.

My foyer light entity id comes from my limitlessled part and is defined by the specific config of that component. It could just as easily be light.158d0000f430b1 for a different platform.

Great need to read up a lot more. One thing I noticed which is strange and messing around with Google commands working ias I have to say the command twice, now I have ligths appear which were not there before?

But only got this in the configuration.yaml:

And the following in HABridge UI:

Inside the boys aircon in HABridge UI:

I can see the names you have used in HaBridge are the names of your light switches that have mysteriously appeared.

HaBridge works by pretending to be a Philips hue hub and telling google that your aircon is actually a light switch. My guess is that your Hass setup is scanning the network and discovering these as lights which is where the discovery ignore comes in. I would add the line as mentioned above into your config and restart hass, probably even completely reboot the pi.

discovery:
  ignore:
  - philips_hue

I am guessing that when you say the command habridge is passing the call to homeassistant which is then passing it back to the habridge hue emulator.

Hi,

I have been reading and learning a little. My configuration.yaml has the following for Broadlink light:

switch:
platform: broadlink
host: 192.xxx.xxx.xxx
mac: ‘address’
timeout: 30
switches:
Test_light:
friendly_name: “Test Light”
command_on: ‘6RRGAN8JCRYJFgkWCRYWCQkWCRYWCQkWCRYJFgkWCRYWCRYJFgkJFgkWFgkJFhYJFgkJFhYJCRYJFhYJCRYJFhYJCRYJFgkg=’
command_off: ‘6RRGAN8JFgkWCQkWFgkWCRYJFgkWCQkWFgkJFhYJCRYJFgkWCRYJFhYJCRYJFhYJCRYWCQkWFgkWCRYJCRYWCQkWFgkJFgkg=’

Can you help tell me what code I need to turn on switch.Test_light to on at 5:00pm AEST?

Which file would I need to add the code to automation.yaml?

Just a simple switch automation. You’ll need to find the entity ID for your switch and that’s about it.

- alias: 5pm test light
  trigger:
    platform: time
    at: '17:00:00'
  action:
    service: switch.turn_on
    entity_id: switch.your_entity_id

Also, when posting your code it’s important to select it in the the comment box and press the button for preformatted text ( Ctrl Shift C) it looks like this </>

Hey Barry

Thanks for the info and note re code format will do.

As I read more I am learning enough to be dangerous :blush:

Noobs stuggle if not knowing the basics so excuse me for asking what might seem like dumb questions.

Which file does the code you provide go into?

If the code goes in atuomation.yaml then do I have to put anything in configuration.yaml to refer to -alias: 5pm test light?

Thanks

Paul

I am not sure how it works in hassio. I have it installed in a bit of a workaround way so mine operates differently and I have my automations split into many parts.

In one of the recent updates an automation.yaml file was created in my main directory however I don’t use it at all and it’s blank. I’d put it straight into there if I were you. There is also a built in automation builder in the hass interface but again, I don’t know how to use this.

Once you have an automation it is not required to reference it from home assistant, it should just show up. You can click on it once it shows on the front page and manually trigger it to test if your action part of the automation is working. For more info I would work through the getting started section of the docs and maybe check out a few you tube videos if that’s your thing. Follow along with same basic automations and you’ll ge the gist.

@inspired did you manage to get your Google Home to connect to HAbridge or emulated_Hue? In another topic we had the same problem with the older app forces to update. Did you manage to get around this? I have disabled automatic updates in my playstore setting but I’m still being forced to update. Looks like this is coming from my Google Home and not the app as I can use the app without any problem untill I try to add the Hue bridge.