Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- homeassistant:
- # Name of the location where Home Assistant is running
- name: Casa
- # Location required to calculate the time the sun rises and sets
- latitude: !secret zone_home_lat
- longitude: !secret zone_home_long
- # Impacts weather/sunrise data (altitude above sea level in meters)
- elevation: 39
- # 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/Lisbon
- # https://materialdesignicons.com
- customize:
- sun.sun:
- friendly_name: Sol
- sensor.badlogin:
- friendly_name: 'Bad Logins'
- # Date & Time
- sensor.date:
- friendly_name: Data
- sensor.time:
- friendly_name: Hora
- group.Quarto_Adultos:
- friendly_name: 'Quarto Adultos'
- group.Quarto_Kids:
- friendly_name: 'Quarto Kids'
- group.tab_definicoes:
- friendly_name: 'Definições'
- group.AC_Info:
- friendly_name: 'Ar condicionado'
- group.AC_Settings:
- friendly_name: 'Ar condicionado'
- group.automacoes:
- friendly_name: 'Automações'
- input_slider.slider_temp_min:
- friendly_name: 'Mínima'
- icon: mdi:arrow-down-bold-circle-outline
- input_slider.slider_temp_max:
- friendly_name: 'Máxima'
- icon: mdi:arrow-up-bold-circle-outline
- # Xiaomi Gateway
- sensor.temperature_158d00010bedca:
- friendly_name: 'Temperatura'
- sensor.humidity_158d00010bedca:
- friendly_name: 'Humidade'
- icon: mdi:water-percent
- binary_sensor.magnet_158d00010026a9:
- friendly_name: 'Porta'
- icon: mdi:glassdoor
- binary_sensor.motion_158d000129355b:
- friendly_name: 'Movimento'
- icon: mdi:run-fast
- # Weather Underground
- sensor.PWS_weather:
- friendly_name: 'Estado'
- sensor.PWS_precip_1hr_metric:
- friendly_name: 'Chuva'
- icon: mdi:weather-rainy
- sensor.PWS_temp_c:
- friendly_name: 'Temperatura'
- sensor.PWS_relative_humidity:
- friendly_name: 'Humidade'
- icon: mdi:water-percent
- # Speedtest
- sensor.speedtest_download:
- friendly_name: 'WAN Download Speed'
- sensor.speedtest_upload:
- friendly_name: 'WAN Upload Speed'
- sensor.speedtest_ping:
- friendly_name: 'WAN Ping'
- # MEWaGO
- sensor.geral_kwh:
- friendly_name: 'Consumo energia'
- icon: mdi:power-plug
- sensor.cpu_hass:
- friendly_name: 'BLUE CPU %'
- # GPIO
- switch.bomba:
- icon: mdi:oil-temperature
- switch.ventiladores:
- icon: mdi:air-conditioner
- # Devices
- switch.gray:
- icon: mdi:desktop-tower
- switch.green:
- icon: mdi:desktop-tower
- device_tracker.nexus_6p:
- hidden: true
- input_boolean.aquecimento_nocturno:
- friendly_name: 'Aquecimento nocturno'
- zone.escola_lara:
- friendly_name: 'Escola Lara'
- zone.escola_eva:
- friendly_name: 'Escola Eva'
- zone.escola_simao:
- friendly_name: 'Escola Simão'
- # Show links to resources in log and frontend
- # introduction:
- # Enables the frontend
- frontend:
- http:
- # Uncomment this to add a password (recommended!)
- api_password: !secret http_password
- server_port: 443
- ssl_certificate: /etc/letsencrypt/live/famaia.ddns.net/fullchain.pem
- ssl_key: /etc/letsencrypt/live/famaia.ddns.net/privkey.pem
- ip_ban_enabled: True
- login_attempts_threshold: 5
- logger:
- default: info
- logs:
- homeassistant.components.http: warning
- # 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:
- # Text to speech
- tts:
- platform: google
- # MySQL Database
- recorder:
- db_url: !secret db_url
- mqtt:
- broker: m20.cloudmqtt.com
- port: 29716
- username: !secret mqtt_username
- password: !secret mqtt_password
- ####################################################################################
- ### Web Links
- ####################################################################################
- weblink:
- entities:
- - name: Router Linksys
- url: https://10.12.12.253
- ####################################################################################
- ### Sensors
- ####################################################################################
- sensor datetime:
- - platform: time_date
- display_options:
- - 'date'
- - 'time'
- sensor speedtest:
- - platform: speedtest
- monitored_conditions:
- - ping
- - download
- - upload
- sensor wunderground:
- - platform: wunderground
- api_key: !secret wunderground
- monitored_conditions:
- - relative_humidity
- - temp_c
- - weather
- - precip_1hr_metric
- # - location
- # - feelslike_c
- sensor pi_hole:
- - platform: pi_hole
- sensor geral_kwh:
- - platform: command_line
- name: Geral kWh
- command: "/opt/maia/hass_energy"
- unit_of_measurement: "kWh"
- sensor bad_attempt:
- - platform: command_line
- name: badlogin
- command: grep -c 'Login attempt' /root/.homeassistant/home-assistant.log
- sensor cpu_hass:
- - platform: command_line
- name: CPU HASS
- command: '/opt/maia/hass_cpu'
- unit_of_measurement: "%"
- ####################################################################################
- ### Zones
- ### Get coordinates at http://www.gps-coordinates.net
- ####################################################################################
- zone zone_deec:
- name: DEEC
- latitude: !secret zone_deec_lat
- longitude: !secret zone_deec_long
- radius: 200
- icon: mdi:worker
- zone zone_isec:
- name: ISEC
- latitude: !secret zone_isec_lat
- longitude: !secret zone_isec_long
- radius: 150
- icon: mdi:worker
- zone zone_escola_lara:
- name: escola_lara
- latitude: !secret zone_lara_lat
- longitude: !secret zone_lara_long
- radius: 150
- icon: mdi:school
- zone zone_escola_eva:
- name: escola_eva
- latitude: !secret zone_eva_lat
- longitude: !secret zone_eva_long
- radius: 150
- icon: mdi:school
- zone zone_escola_simao:
- name: escola_simao
- latitude: !secret zone_simao_lat
- longitude: !secret zone_simao_long
- radius: 150
- icon: mdi:school
- ####################################################################################
- ### Notifications
- ####################################################################################
- notify:
- - name: famaia
- platform: simplepush
- device_key: !secret simplepush
- ####################################################################################
- ### Devices
- ####################################################################################
- device_tracker:
- - platform: ping
- hosts:
- Nexus_6P: 10.12.12.21
- - platform: owntracks
- max_gps_accuracy: 200
- waypoints: True
- waypoint_whitelist:
- - jon
- - ram
- switch:
- - platform: rpi_gpio
- ports:
- 17: Bomba
- 27: Ventiladores
- light:
- - platform: yeelight
- devices:
- 10.12.12.41:
- name: Lâmpada Sala
- aqara:
- gateway_password: !secret xiaomi_home_gateway
- # Wan on LAN
- switch pc_gray:
- - platform: wake_on_lan
- name: "GRAY"
- mac_address: "00-23-54-35-5E-3B"
- host: 10.12.12.1
- switch pc_green:
- - platform: wake_on_lan
- name: "GREEN"
- mac_address: "00-24-21-7A-A8-8B"
- host: 10.12.12.10
- ####################################################################################
- ### Virtual Inputs
- ####################################################################################
- input_boolean:
- aquecimento_nocturno:
- name: aquecimento_nocturno
- initial: on
- icon: mdi:weather-night
- input_slider:
- slider_temp_min:
- name: Temperatura_Minima
- initial: 18
- min: 17
- max: 23
- step: 0.5
- slider_temp_max:
- name: Temperatura_Maxima
- initial: 20
- min: 17
- max: 23
- step: 0.5
- sensor ac_state_min:
- - platform: template
- sensors:
- ac_state_min:
- value_template: '{{ states.input_slider.slider_temp_min.state }}'
- friendly_name: 'Setpoint Mínimo'
- unit_of_measurement: 'ºC'
- sensor ac_state_max:
- - platform: template
- sensors:
- ac_state_max:
- value_template: '{{ states.input_slider.slider_temp_max.state }}'
- friendly_name: 'Setpoint Máximo'
- unit_of_measurement: 'ºC'
- ####################################################################################
- ### Groups
- ####################################################################################
- group:
- default_view:
- view: yes
- entities:
- - device_tracker.twbghzzp_maianexus6p
- - device_tracker.twbghzzp_patuxaa5
- - group.Geral
- - group.Rua
- - group.AC_Info
- - group.Sala
- - group.Quarto_Adultos
- - group.Quarto_Kids
- - group.Hall
- - group.Garagem
- Servidor:
- name: 'Definições'
- view: yes
- entities:
- - sensor.cpu_hass
- - sensor.badlogin
- - sensor.speedtest_download
- - sensor.speedtest_upload
- - sensor.speedtest_ping
- - sensor.pihole
- - group.Automacoes
- - group.Devices
- - group.AC_Settings
- Devices:
- - weblink.Router_Linksys
- Geral:
- - sensor.date
- - sensor.time
- - sensor.geral_kwh
- Rua:
- - sun.sun
- - sensor.PWS_weather
- - sensor.PWS_temp_c
- - sensor.PWS_relative_humidity
- - sensor.PWS_precip_1hr_metric
- AC_Info:
- - switch.Bomba
- - switch.Ventiladores
- - sensor.ac_state_min
- - sensor.temperature_158d00010bedca
- - sensor.ac_state_max
- AC_Settings:
- - input_slider.slider_temp_min
- - sensor.temperature_158d00010bedca
- - input_slider.slider_temp_max
- Sala:
- - light.Lampada_Sala
- - sensor.temperature_158d00010bedca
- - sensor.humidity_158d00010bedca
- # - switch.switch_one_click_158d00013e4c7f
- Quarto_Kids:
- - binary_sensor.motion_158d000129355b
- Quarto_Adultos:
- - media_player.Quarto
- Hall:
- - binary_sensor.magnet_158d00010026a9
- Garagem:
- - switch.gray
- - switch.green
- Automacoes:
- - input_boolean.aquecimento_nocturno
- ####################################################################################
- ### Scenes
- ####################################################################################
- scene:
- - name: AC_On
- entities:
- switch.bomba:
- state: on
- switch.ventiladores:
- state: on
- - name: AC_Off
- entities:
- switch.bomba:
- state: on
- switch.ventiladores:
- state: on
- ####################################################################################
- ### Automation
- ####################################################################################
- automation:
- - alias: 'Update Available Notifications'
- trigger:
- platform: state
- entity_id: updater.updater
- action:
- service: notify.famaia
- data:
- message: 'Update for Home Assistant is available.'
- - alias: 'Em casa. Muito frio'
- hide_entity: true
- trigger:
- platform: template
- value_template: "{% if (states.sensor.temperature_158d00010bedca.state < states.input_slider.slider_temp_min.state) %}true{% endif %}"
- condition:
- condition: and
- conditions:
- - condition: time
- after: '08:01:00'
- before: '23:59:00'
- - condition: state
- entity_id: switch.Bomba
- state: 'off'
- - condition: or
- conditions:
- - condition: state
- entity_id: 'device_tracker.twbghzzp_maianexus6p'
- state: 'home'
- - condition: state
- entity_id: 'device_tracker.twbghzzp_patuxaa5'
- state: 'home'
- action:
- - service: switch.turn_on
- entity_id: switch.bomba
- - service: switch.turn_on
- entity_id: switch.ventiladores
- - service: notify.famaia
- data:
- message: 'Em casa e temperatura < setpoint {{ states.input_slider.slider_temp_min.state | float }}º, ligando ar condicionado.'
- # Aquecimento concluído, dentro ou fora de casa, a qualquer hora
- - alias: 'Aquecimento concluido'
- hide_entity: true
- trigger:
- platform: template
- value_template: "{% if (states.sensor.temperature_158d00010bedca.state > states.input_slider.slider_temp_max.state) %}true{% endif %}"
- condition:
- - condition: state
- entity_id: switch.Bomba
- state: 'on'
- action:
- - service: switch.turn_off
- entity_id: switch.bomba
- - service: switch.turn_off
- entity_id: switch.ventiladores
- - service: notify.famaia
- data:
- message: 'Temperatura > setpoint {{ states.input_slider.slider_temp_max.state | float }}º, desligando ar condicionado.'
- - alias: 'Nocturno. Muito frio'
- hide_entity: true
- trigger:
- platform: template
- value_template: "{% if (states.sensor.temperature_158d00010bedca.state < states.input_slider.slider_temp_min.state) %}true{% endif %}"
- condition:
- condition: and
- conditions:
- - condition: state
- entity_id: switch.Bomba
- state: 'off'
- - condition: state
- entity_id: input_boolean.aquecimento_nocturno
- state: 'on'
- - condition: time
- after: '00:00:00'
- before: '08:00:00'
- action:
- - service: switch.turn_on
- entity_id: switch.bomba
- - service: switch.turn_on
- entity_id: switch.ventiladores
- - service: notify.famaia
- data:
- message: 'Aquecimento nocturno activo e temperatura < setpoint {{ states.input_slider.slider_temp_min.state | float }}º, ligando ar condicionado.'
- - alias: 'Patuxa na Escola da Lara'
- trigger:
- platform: zone
- entity_id: device_tracker.twbghzzp_patuxaa5
- zone: zone.escola_lara
- event: enter
- action:
- - service: notify.famaia
- data:
- message: 'Patuxa está na Escola da Lara'
- - alias: 'Patuxa na Escola da Eva'
- trigger:
- platform: zone
- entity_id: device_tracker.twbghzzp_patuxaa5
- zone: zone.escola_eva
- event: enter
- action:
- - service: notify.famaia
- data:
- message: 'Patuxa está na Escola da Eva'
- - alias: 'Patuxa na Escola do Simao'
- trigger:
- platform: zone
- entity_id: device_tracker.twbghzzp_patuxaa5
- zone: zone.escola_simao
- event: enter
- action:
- - service: notify.famaia
- data:
- message: 'Patuxa está na Escola do Simão'
- - alias: 'Sala | Switch Long Pressed'
- trigger:
- platform: state
- entity_id: switch.switch_long_press_158d00013e4c7f
- to: 'on'
- condition:
- - condition: state
- entity_id: switch.Bomba
- state: 'off'
- action:
- - service: scene.turn_on
- entity_id: scene.AC_on
- - service: notify.famaia
- data:
- message: 'Botão sala pressionado longamente, ligando ar condicionado.'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement