This shows you the differences between two versions of the page.

Link to this comparison view

how_to:lirc:integration_with_home_assistant [2019/03/30 17:09]
franzunix [Use the RESTful API of lirc_web]
how_to:lirc:integration_with_home_assistant [2019/03/30 20:05]
Line 1: Line 1:
-====== Integration with Home Assistant ====== 
-See the Home Assistant documentation of the [[https://​www.home-assistant.io/​components/​lirc/​|LIRC component]] to have a more details. If you wont that Home Assistant recognize the press of a specific button of your remote, you have to add the button and the remote name in the .lircrc file located in /​home/​homeassistant/​.\\ 
-The .lircrc file is accessible [[system_administration:​common_operation:​connect_to_samba_share|via samba]]. 
-See this example of entry in the .lircrc file: 
-<file text /​home/​homeassistant/​.lircrc>​ 
-    remote = SONY 
-    button = KEY_1 
-    prog   = home-assistant 
-    config = see-this 
-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 the field "​button"​ must be the same as in the lircd.conf file as well as the "​remote"​ name. 
-The values you put in the "​config"​ field will be the sensor value in Home Assistant when you press the button. 
-Restart lirc to load the changes. 
-pi@d-diot:~ $ sudo systemctl restart lircd 
-Test your LIRC installation before proceeding by running: ​ 
-pi@d-diot:~ $ sudo -u homeassistant -H -s 
-homeassistant@d-diot:/​home/​pi $ ircat home-assistant 
-At every press of KEY_1 in the SONY remote a line should appear. Switch back to user "​pi"​ and restart Home Assistant 
-homeassistant@d-diot:/​home/​pi $ exit 
-pi@d-diot:~ $ 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 an automation script. See the [[https://​www.home-assistant.io/​components/​lirc/​|LIRC component]] documentation to learn more. 
-===== Use the RESTful API of lirc_web ===== 
-If you wont to send an IR command directly from Home Assistant, that is useful when you are on a remote connection where the lirc_web interface is not accessible, you can use the built in [[https://​github.com/​alexbain/​lirc_web#​using-the-json-api|RESTful API of lirc_web]]. 
  • how_to/lirc/integration_with_home_assistant.txt
  • Last modified: 2019/03/30 20:05
  • (external edit)