This is an old revision of the document!


Integration with Home Assistant

# Reference guide https://www.home-assistant.io/components/lirc/

# Create a .lircrc in /home/homeassistant/.lircrc (via samba) with the following lines begin

  remote = SONY
  button = KEY_1
  prog   = home-assistant
  config = see-this

end

# Add an entry for every button that you wont to be recognized. The button can be associated later to an automation

# The values you set for button must be the same as in the lircd.conf as well as the remote name

# the values you put for config entry will be the sensor value in Home Assistant when you press the button

# Restart lirc $ sudo systemctl restart lircd

# Test your LIRC installation before proceeding by running: $ ircat home-assistant # At every press of KEY_1 in the SONY remote a line should appear

# Restart home-assistant $ sudo systemctl restart home-assistant@homeassistant

# Now every time you press a button defined in the .lircrc the LIRC component fires ir_command_received events on the bus. You can capture the events and respond to them in automation scripts like this:

# Example configuration.yaml automation entry automation:

  1. alias: Off on Remote

trigger:

    platform: event
    event_type: ir_command_received
    event_data:
      button_name: see-this
  action:
    service: homeassistant.turn_off
    entity_id: group.a_lights

# The button_name data values (e.g., see-this) are set by you in the .lircrc file.

  • how_to/lirc/integration_with_home_assistant.1553962146.txt.gz
  • Last modified: 2019/03/30 16:09
  • by franzunix