Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
- sudo apt-key add mosquitto-repo.gpg.key
- cd /etc/apt/sources.list.d/
- sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
- sudo apt-get update
- sudo apt-get install mosquitto
- sudo apt-get install mosquitto mosquitto-clients python-mosquitto
- sudo /etc/init.d/mosquitto stop
- sudo /etc/init.d/mosquitto start
- sudo pip3 install paho-mqtt
- sudo apt-get update
- sudo apt-get upgrade -y
- sudo pip3 install homeassistant
- sudo echo "
- homeassistant:
- # Name of the location where Home Assistant is running
- name: Home
- # Location required to calculate the time the sun rises and sets
- latitude: 1
- longitude: 1
- # Impacts weather/sunrise data (altitude above sea level in meters)
- elevation: 191
- # metric for Metric, imperial for Imperial
- unit_system: metric
- # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- time_zone: Europe/Warsaw
- # Show links to resources in log and frontend
- introduction:
- # Enables the frontend
- frontend:
- http:
- # Uncomment this to add a password (recommended!)
- # api_password: admin
- # Checks for available updates
- updater:
- # Discover some devices automatically
- discovery:
- # Allows you to issue voice commands from the frontend in enabled browsers
- conversation:
- # Enables support for tracking state changes over time.
- history:
- # View all events in a logbook
- logbook:
- # Track the sun
- sun:
- # Weather Prediction
- # platform: yr
- #MQTT
- mqtt:
- broker: localhost
- port: 1883
- client_id: home-assistant-1
- keepalive: 60
- username: jakub
- password: admin
- protocol: 3.1
- sensor:
- - platform: mqtt
- name: "temperature"
- state_topic: "temperature"
- unit_of_measurement: "No."
- - platform: mqtt
- name: "humidity"
- state_topic: "humidity"
- unit_of_measurement: "No."
- alarm_control_panel:
- - platform: mqtt
- name: Button alarm
- state_topic: "alarm/big_red_button"
- command_topic: "alarm/big_red_button/set"
- payload_disarm: "disarmed"
- - platform: mqtt
- name: "gas alarm"
- state_topic: "MQ2"
- command_topic: "MQ2"
- payload_disarm: "disarmed"
- - platform: mqtt
- name: "motion"
- state_topic: "MS"
- command_topic: "MS"
- payload_disarm: "disarmed"
- binary_sensor:
- - platform: rpi_gpio
- ports:
- 21: Button alarm
- invert_logic: TRUE
- bounce_time: 300
- " > /home/pi/.homeassistant/configuration.yaml
- hass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement