Advertisement
Guest User

Untitled

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