Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
  2. sudo apt-get install -y nodejs
  3. sudo apt-get install libavahi-compat-libdnssd-dev
  4. sudo apt-get install libudev-dev
  5. sudo npm i --global --unsafe-perm room-assistant
  6.  
  7. mkdir room-assistant
  8. cd room-assistant
  9. mkdir config
  10. cd config
  11. nano local.yaml
  12.  
  13. put the text between the lines in the file
  14. to save: ctrl-x -> y -> enter
  15. edit mqttUrl to your server ip (keep the :1883 port at the end)
  16. edit your mqtt username and password
  17. add your bluetooth address
  18.  
  19. -----------------------------------------
  20. global:
  21. instanceName: Living Room
  22. integrations:
  23. - homeAssistant
  24. - bluetoothClassic
  25. homeAssistant:
  26. mqttUrl: mqtt://mqtt-server-ip:1883
  27. mqttOptions:
  28. username: mqtt-username
  29. password: mqtt-password
  30. bluetoothClassic:
  31. minRssi: -20
  32. addresses:
  33. - 'Bluetooh Mac Address'
  34. -----------------------------------------
  35.  
  36.  
  37. sudo nano /etc/systemd/system/room-assistant.service
  38.  
  39. put the text between the lines in the file
  40. to save: ctrl-x -> y -> enter
  41.  
  42. -----------------------------------------
  43. [Unit]
  44. Description=room-assistant service
  45.  
  46. [Service]
  47. ExecStart=/usr/bin/room-assistant
  48. WorkingDirectory=/home/pi/room-assistant
  49. Restart=always
  50. RestartSec=10
  51.  
  52. [Install]
  53. WantedBy=multi-user.target
  54. -----------------------------------------
  55.  
  56. sudo systemctl enable room-assistant.service
  57. sudo systemctl start room-assistant.service
  58.  
  59.  
  60. device tracker automations
  61. add these to your automation file in home assistant
  62.  
  63. -----------------------------------------
  64. - alias: Bluetooth Home
  65. trigger:
  66. - platform: state
  67. entity_id: sensor.sensorname
  68. from: not_home
  69. action:
  70. - service: device_tracker.see
  71. data:
  72. dev_id: sensorname
  73. location_name: home
  74.  
  75. - alias: Bluetooth Not Home
  76. trigger:
  77. - platform: state
  78. entity_id: sensor.sensorname
  79. to: not_home
  80. action:
  81. - service: device_tracker.see
  82. data:
  83. dev_id: sensorname
  84. location_name: not_home
  85. ----------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement