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: Home
- # Location required to calculate the time the sun rises and sets
- latitude: !secret latitude
- longitude: !secret longitude
- # Impacts weather/sunrise data (altitude above sea level in meters)
- elevation: 84
- # 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
- ## WHITELIST
- whitelist_external_dirs:
- - '/home/homeassistant/.homeassistant/script'
- - '/home/homeassistant/.homeassistant/tts'
- - '/home/pi/certbot'
- auth_providers: #combustiveis nao dar erro
- - type: homeassistant
- - type: legacy_api_password
- - type: trusted_networks
- # Customization file
- customize: !include customize.yaml
- # Show links to resources in log and frontend
- #introduction:
- api:
- # Enables the frontend
- frontend:
- # Enables configuration UI
- #ffmpeg:
- # ffmpeg_bin: /usr/bin/ffmpeg
- http:
- # Secrets are defined in the file secrets.yaml
- # api_password: !secret http_password
- # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
- # base_url: example.duckdns.org:8123
- api_password: !secret http_password
- ssl_certificate: /etc/letsencrypt/live/skysurf.duckdns.org/fullchain.pem
- ssl_key: /etc/letsencrypt/live/skysurf.duckdns.org/privkey.pem
- ip_ban_enabled: True
- base_url: !secret meu_dns
- login_attempts_threshold: 5
- trusted_networks:
- - 127.0.0.1
- - 192.168.1.0/24
- # Checks for available updates
- # Note: This component will send some information about your system to
- # the developers to assist with development of Home Assistant.
- # For more information, please see:
- # https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
- updater:
- # Optional, allows Home Assistant developers to focus on popular components.
- include_used_components: true
- # Discover some devices automatically
- discovery:
- # Enables support for tracking state changes over time
- history:
- # View all events in a logbook
- logbook:
- # Enables a map showing the location of tracked devices
- map:
- # Track the sun
- sun:
- #notificaçao
- notify:
- - platform: pushbullet
- name: noti_pushbullet
- api_key: !secret API_Notificaao_pushbullet
- #html5 notificaçao
- - name: html5_notificaçao_chrome
- platform: html5
- gcm_api_key: !secret API_Notificao_gcm-server-key
- gcm_sender_id: !secret API_Notificao_gcm-sender-id
- # Weather prediction
- ############# SENSORES: ########
- sensor:
- - platform: yr
- - platform: command_line
- name: Dias para o certificado SSL expirar
- unit_of_measurement: days
- scan_interval: 10800
- command: "ssl-cert-check -b -c /etc/letsencrypt/live/skysurf.duckdns.org/cert.pem | awk '{ print $NF }'"
- - platform: mqtt
- state_topic: "zanzito/skysurf_phone/battery_level"
- name: "Bateria Telemovel SkySurf"
- unit_of_measurement: '%'
- retain: true
- - platform: template
- sensors:
- skysurf_phone:
- friendly_name: 'Estado skysurf'
- value_template: >
- {%- if is_state('device_tracker.skysurf_phone', 'not_home') -%}
- Ausente
- {%- endif -%}
- {%- if is_state('device_tracker.skysurf_phone', 'home') -%}
- Em Casa
- {%- endif -%}
- {%- if is_state('device_tracker.skysurf_phone', 'notrabalho') -%}
- No Trabalho
- {%- endif -%}
- #- platform: time_date
- - platform: version
- - platform: rest
- name: "Last version"
- resource: https://pypi.python.org/pypi/homeassistant/json
- value_template: '{{ value_json.info.version }}'
- scan_interval: 3600
- ############# RASPBERRY PI SENSORS #############
- - platform: systemmonitor
- resources:
- - type: disk_use
- arg: /home
- - type: disk_free
- arg: /home
- - type: processor_use
- - type: last_boot
- - type: since_last_boot
- - type: memory_use
- - type: memory_use_percent
- - platform: command_line
- name: CPU Temp
- command: "cat /sys/class/thermal/thermal_zone0/temp"
- unit_of_measurement: "°C"
- value_template: '{{ value | multiply(0.001) | round(0) }}'
- ############### SENSORES TOMADA INTELIGENTE DESUDIMIFICADOR #######
- - platform: mqtt
- name: "Power"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Power }}"
- unit_of_measurement: "W"
- icon: mdi:power-plug
- - platform: mqtt
- name: "Voltage"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Voltage }}"
- unit_of_measurement: "V"
- icon: mdi:flash
- - platform: mqtt
- name: "Current"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Current }}"
- unit_of_measurement: "A"
- icon: mdi:power-socket
- - platform: mqtt
- name: "Energy today"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Today }}"
- unit_of_measurement: "kWh"
- icon: mdi:power-socket-eu
- - platform: mqtt
- name: "Energy yesterday"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Yesterday }}"
- unit_of_measurement: "kWh"
- icon: mdi:power-socket-eu
- - platform: mqtt
- name: "Energy total"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Total }}"
- unit_of_measurement: "kWh"
- icon: mdi:power-socket-eu
- - platform: mqtt
- name: "Power Factor"
- state_topic: "tele/tomada_1_consu/SENSOR"
- value_template: "{{ value_json.ENERGY.Factor }}"
- icon: mdi:percent
- # - platform: mqtt
- # name: "Temp"
- # state_topic: "tele/sonoff/SENSOR"
- # value_template: "{{ value_json.DS18B20.Temperature }}"
- # unit_of_measurement: "°C"
- # icon: mdi:thermometer
- ############# medir energia em € ####################
- - platform: utility_meter
- name: Electricidade
- cycle: monthly
- source: sensor.energy
- ###### SWITCH TOMADA SONOFF DESUMIFICADOR ############
- switch:
- - platform: mqtt
- name: "tomada 1 consumos sonoff"
- state_topic: "stat/tomada_1_consu/POWER"
- command_topic: "cmnd/tomada_1_consu/power"
- availability_topic: "tele/tomada_1_consu/LWT"
- payload_available: "Online"
- payload_not_available: "Offline"
- qos: 1
- payload_on: "ON"
- payload_off: "OFF"
- retain: true
- ################### PREÇO COMBUSTIVEIS HA ####################
- #combustiveis
- shell_command:
- #test: touch /home/homeassistant/.homeassistant/hassteste.txt
- # correr_combustiveis: 'bash /home/homeassistant/.homeassistant/script/fuel_info.sh -f "184685"'
- ######### som polly:
- #play_sound: 'sudo /usr/bin/omxplayer /home/homeassistant/.homeassistant/tts/cf5fc48cf182c32ecfe3d12239125929c313b8fd_pt-pt_3358069112_amazon_polly.mp3'
- # já da som na coluna é preciso ter o kodi ligado (mxplayer)
- # renovar certificado automaticamente:
- #renew_ssl: '/home/pi/certbot/certbot-auto renew --quiet --no-self-upgrade --standalone --preferred-challenges tls-sni-01 --tls-sni-01-port 8123 --pre-hook "sudo systemctl stop home-assistant@homeassistant.service" --post-hook "sudo systemctl start home-assistant@homeassistant.service"'
- renew_ssl: 'bash /home/pi/certbot/certbot-auto renew --verbose --no-self-upgrade --standalone --preferred-challenges tls-sni-01 --tls-sni-01-port 8123 --pre-hook "sudo systemctl stop home-assistant@homeassistant.service" --post-hook "sudo systemctl start home-assistant@homeassistant.service"'
- # update automatico do ha:
- scriptupdate_ha: 'bash /home/homeassistant/.homeassistant/script/update_ha.sh'
- # Text to speech
- tts:
- - platform: google
- #languague: PT
- - platform: amazon_polly
- aws_access_key_id: !secret pooly_id
- aws_secret_access_key: !secret polly_password
- text_type: ssml
- voice: Cristiano
- #voice: Ines #PT VOZES
- # Example base configuration.yaml entry
- conversation:
- # Cloud
- cloud:
- group: !include groups.yaml
- #automation: !include automations.yaml
- script: !include scripts.yaml
- #sensor: !include sensors.yaml
- #UTILIZAÇAO DO PACKAGE:
- #homeassistant:
- # packages: !include_dir_named packages/
- #config:
- ############# MQTT: ########
- mqtt:
- broker: 127.0.0.1
- discovery: true
- discovery_prefix: homeassistant
- birth_message: #mqtt pen zinbee
- topic: 'hass/status'
- payload: 'online'
- will_message:
- topic: 'hass/status'
- payload: 'offline'
- light:
- - platform: yeelight
- devices:
- 192.168.1.70:
- name: Quarto Skysurf
- use_music_mode: True #(defaults to False - True will help keep the communications open)
- save_on_change: True #(defaults to True)
- 192.168.1.69:
- name: Quarto Cristina
- use_music_mode: True #(defaults to False - True will help keep the communications open)
- save_on_change: True #(defaults to True)
- 192.168.1.111:
- name: LedstripSala
- use_music_mode: True #(defaults to False - True will help keep the communications open)
- save_on_change: True #(defaults to True)
- ## Example configuration.yaml entry
- #media_player:
- ############# MEDIA PLAYERS: ########
- ###### kodi:
- media_player:
- - platform: kodi
- host: 192.168.1.67 #telemovel s2
- name: kodi
- port: 8080
- username: !secret kodi_user
- password: !secret kodi_password
- #turn_off_action: hibernate
- method: System.Hibernate
- ###########samsung tv media player
- - platform: samsungtv
- host: 192.168.1.50
- port: 8001
- mac: 40:16:3B:C8:7E:D9
- ############# MEDIA PLAYER ALEXA: ########
- - platform: alexa
- email: !secret email_alexa_amaz
- password: !secret password_alexa
- url: amazon.com
- automation: !include automations.yaml
- ############# ZONAS: ########
- zone:
- - name: home
- latitude: !secret latitude
- longitude: !secret longitude
- radius: 50
- icon: mdi:home
- - name: notrabalho
- latitude: !secret latitude_meutrabalho
- longitude: !secret longitude_meutrabalho
- radius: 200
- icon: mdi:airplane
- device_tracker:
- - platform: mqtt_json
- devices:
- skysurf_phone: zanzito/skysurf_phone/location
- track_new_devices: True
- interval_seconds: 10
- consider_home: 20
- config:
- ############# CAMERAS: ########
- camera:
- - name: skysurf_cam
- platform: generic
- still_image_url: https://maps.googleapis.com/maps/api/staticmap?center={{ states.device_tracker.skysurf_phone.attributes.latitude }},{{ states.device_tracker.skysurf_phone.attributes.longitude }}&zoom=16&size=500x500&maptype=roadmap&markers=color:green%7Clabel:JA%7C{{ states.device_tracker.skysurf_phone.attributes.latitude }},{{ states.device_tracker.skysurf_phone.attributes.longitude }}&key=AIzaSyCi9RxsJfpO6hMEDUOVLbTqVAhOtfnLBfI
- limit_refetch_to_url_change: true
- #camera:
- # - platform: ffmpeg
- #input: http://192.168.1.105:5000/onvif/device_service
- # input: rtsp://192.168.1.105:554/onvif1
- #a FUNCIONAR:
- # input: rtsp://192.168.1.105:554/onvif1 FUNCIONA ... ESTE
- #input: -rtsp_transport tcp -i rtsp://192.168.1.105:554/onvif1
- #- platform: onvif
- #host: 192.168.1.105
- #host: http://192.168.1.105:5000/onvif/device_service
- #username: "@gmail.com"
- #password: "*******"
- #port: 554
- #port: 5000
- # name: Camera Loureço quarto
- ################### RECORDER É O QUE GRAVA E NAO GRAVA NA BASE DE DADOS ###########
- #recorder: ## https://www.home-assistant.io/components/recorder/
- # purge_keep_days: 5 #GUARDA DURANTE 5 DIAS...
- # exclude: # NAO GUARDA OS DOMINIOS E ENTIDADES:
- # domains:
- # - automation
- # - updater
- # - systemmonitor
- # entities:
- # - sun.sun # Don't record sun data
- #- sensor.last_boot # Comes from 'systemmonitor' sensor platform
- # - sensor.last_boot
- ## - sensor.processor_use
- # - sensor.CPU_Temp
- # - sensor.cpu_temperature
- # - sensor.disk_free_home
- # - sensor.disk_use_home
- # - sensor.memory_use_percent
- # - sensor.dias_para_o_certificado_ssl_expirar
- #include: #GRAVA NA BASE DE DADOS:
- # domains:
- # - sensor
- # - switch
- panel_iframe: #### MOSTRAR PAINEL DO LADO ESQ. NODE RED...
- nodered:
- title: 'Node-Red'
- icon: 'mdi:shuffle-variant'
- #url: 'http://192.168.1.100:1880/'
- url: 'https://skysurf.duckdns.org:1880/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement