Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.43 KB | None | 0 0
  1. #!/bin/bash
  2. sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
  3. sudo apt-key add mosquitto-repo.gpg.key
  4. cd /etc/apt/sources.list.d/
  5. sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
  6. sudo apt-get update
  7. sudo apt-get install mosquitto
  8. sudo apt-get install mosquitto mosquitto-clients python-mosquitto
  9. sudo /etc/init.d/mosquitto stop
  10. sudo /etc/init.d/mosquitto start
  11. sudo pip3 install paho-mqtt
  12. sudo apt-get update
  13. sudo apt-get upgrade -y
  14. sudo pip3 install homeassistant
  15. sudo echo "
  16. homeassistant:
  17. # Name of the location where Home Assistant is running
  18. name: Home
  19. # Location required to calculate the time the sun rises and sets
  20. latitude: 1
  21. longitude: 1
  22. # Impacts weather/sunrise data (altitude above sea level in meters)
  23. elevation: 191
  24. # metric for Metric, imperial for Imperial
  25. unit_system: metric
  26. # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  27. time_zone: Europe/Warsaw
  28.  
  29. # Show links to resources in log and frontend
  30. introduction:
  31. # Enables the frontend
  32. frontend:
  33. http:
  34. # Uncomment this to add a password (recommended!)
  35. # api_password: admin
  36.  
  37. # Checks for available updates
  38. updater:
  39. # Discover some devices automatically
  40. discovery:
  41. # Allows you to issue voice commands from the frontend in enabled browsers
  42. conversation:
  43. # Enables support for tracking state changes over time.
  44. history:
  45. # View all events in a logbook
  46. logbook:
  47. # Track the sun
  48. sun:
  49. # Weather Prediction
  50.  
  51. # platform: yr
  52.  
  53.  
  54. #MQTT
  55. mqtt:
  56. broker: localhost
  57. port: 1883
  58. client_id: home-assistant-1
  59. keepalive: 60
  60. username: jakub
  61. password: admin
  62. protocol: 3.1
  63.  
  64.  
  65. sensor:
  66. - platform: mqtt
  67.   name: "temperature"
  68.   state_topic: "temperature"
  69.   unit_of_measurement: "No."
  70. - platform: mqtt
  71.   name: "humidity"
  72.   state_topic: "humidity"
  73.   unit_of_measurement: "No."
  74.  
  75.  
  76.  
  77. alarm_control_panel:
  78. - platform: mqtt
  79.   name: Button alarm
  80.   state_topic: "alarm/big_red_button"
  81.   command_topic: "alarm/big_red_button/set"
  82.   payload_disarm: "disarmed"
  83. - platform: mqtt
  84.   name: "gas alarm"
  85.   state_topic: "MQ2"
  86.   command_topic: "MQ2"
  87.   payload_disarm: "disarmed"
  88. - platform: mqtt
  89.   name: "motion"
  90.   state_topic: "MS"
  91.   command_topic: "MS"
  92.   payload_disarm: "disarmed"
  93.  
  94.  
  95.  
  96. binary_sensor:
  97. - platform: rpi_gpio
  98.   ports:
  99.     21: Button alarm
  100.   invert_logic: TRUE
  101.   bounce_time: 300
  102. " > /home/pi/.homeassistant/configuration.yaml
  103. hass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement