commit efa905a0944be2c02a8668afffbf2a4693c869b1 Author: Valter Ferreira Date: Fri Feb 19 17:08:33 2021 +0000 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d49da9a --- /dev/null +++ b/.gitignore @@ -0,0 +1,70 @@ +# Example .gitignore file for your config dir. +# An * ensures that everything will be ignored. +* +# You can whitelist files/folders with !, these will not be ignored. +!*.yaml +!.gitignore +!*.md + +# Ignore folders. +.storage +.vs +.cloud +.google.token + +# Ensure these YAML files are ignored, otherwise your secret data/credentials will leak. +# Logs +logs +*.log +# Python cache +__pycache__ +*.pyc + +# Other +*.uuid +*.conf +*.db +*.db-journal +*.log +*.noload +*.txt +*.sqlite +*.xml +*.backup +*.json +life360.sh +.ip_authenticated.yaml +ip_bans.yaml +.config_entries.json +*.google.token +.google.token +.ring_cache.pickle +.spotify-token-cache +.storage +abodepy_cache.pickle +camera_recording.py +home-assistant.env +home-assistant.* +known_devices.yaml +entity_registry.yaml +secrets.yaml +google_calendars.yaml +SERVICE_ACCOUNT.json +components +deps +tts +www/icons +www/floorplans +www/community +custom_components/hacs +downloads +icloud +dlib_faces +dlib_nofaces +dlib_known_faces +dlib_unknown_faces +.cloud +*.pickle +.pc-session +google*.deb +.homekit.state \ No newline at end of file diff --git a/automations.yaml b/automations.yaml new file mode 100755 index 0000000..142f266 --- /dev/null +++ b/automations.yaml @@ -0,0 +1,252 @@ +- id: '1589065904158' + alias: Aquecimento Agua + description: '' + trigger: + - at: 06:30:00 + platform: time + - at: 08:00:00 + platform: time + - at: '18:00:00' + platform: time + - at: '19:00:00' + platform: time + action: + - data: {} + entity_id: switch.aquecimento_agua + service: switch.toggle + mode: single +- id: '1589067784246' + alias: Aquario + description: '' + trigger: + - at: '15:00:00' + platform: time + condition: [] + action: + - data: {} + entity_id: light.luz_aquario + service: light.turn_on + - delay: 05:00:00 + - data: {} + entity_id: light.luz_aquario + service: light.turn_off + mode: single +- id: '1578994958446' + alias: Warn garage gate Open + description: '' + trigger: + - entity_id: cover.portao_garagem + from: closed + platform: state + to: open + condition: [] + action: + - data: + message: O portao da garagem foi aberto + title: '*Portao da garagem*' + service: notify.buttler +- id: '1579542436595' + alias: warn portao garagem closed + description: '' + trigger: + - entity_id: cover.portao_garagem + from: open + platform: state + to: closed + condition: [] + action: + - data: + message: O portao da garagem foi fechado + title: '*Portao da garagem*' + service: notify.buttler +- id: '1583841493592' + alias: Notify when hacs needs update + description: '' + trigger: + - entity_id: sensor.hacs + from: '0' + platform: state + to: '1' + action: + - data: + message: System HACS needs updating + title: '*HACS*' + service: notify.buttler +- id: '1590057590266' + alias: Sistema Rega Valvula 1 - 22h + description: '' + trigger: + - at: '22:00:00' + platform: time + condition: [] + action: + - data: {} + entity_id: switch.valvula_jardim_1 + service: switch.turn_on + - delay: 00:10:00 + - data: {} + entity_id: switch.valvula_jardim_1 + service: switch.turn_off + mode: single +- id: sisRega2 + alias: Sistema Rega Valvula 2 - 22h + description: '' + trigger: + - at: '22:10:00' + platform: time + condition: [] + action: + - data: {} + entity_id: switch.valvula_jardim_2 + service: switch.turn_on + - delay: 00:10:00 + - data: {} + entity_id: switch.valvula_jardim_2 + service: switch.turn_off + mode: single +- id: sisRega3 + alias: Sistema Rega Valvula 3 - 22h + description: '' + trigger: + - at: '22:20:00' + platform: time + condition: [] + action: + - data: {} + entity_id: switch.valvula_jardim_3 + service: switch.turn_on + - delay: 00:10:00 + - data: {} + entity_id: switch.valvula_jardim_3 + service: switch.turn_off + mode: single +- id: '1590425966320' + alias: Watering Garden Manual cycle + description: '' + trigger: [] + condition: [] + action: + - data: {} + entity_id: automation.sistema_rega_valvula_1 + service: automation.trigger + - delay: 00:10:00 + - data: {} + entity_id: automation.sistema_rega_valvula_2 + service: automation.trigger + - delay: 00:10:00 + - data: {} + entity_id: automation.sistema_rega_valvula_3 + service: automation.trigger +- alias: Smart Irrigation + description: Start Smart Irrigation at 06:00 and run it only if the adjusted_run_time + is >0 and run it for precisely that many seconds + trigger: + - event_data: {} + event_type: smart_irrigation_start + platform: event + condition: + - above: '0' + condition: numeric_state + entity_id: sensor.smart_irrigation_daily_adjusted_run_time + action: + - data: {} + entity_id: switch.valvula_jardim_1 + service: switch.turn_on + - delay: + seconds: '{{states("sensor.smart_irrigation_daily_adjusted_run_time")}}' + - data: {} + entity_id: switch.valvula_jardim_1 + service: switch.turn_off + - data: {} + service: smart_irrigation.reset_bucket + id: 7b2df872a37148adaa4f33c3dd91905b +- id: '1598985491596' + alias: WC Red luz demasiado tempo ligada +10' + description: Avisa se luz Wc Vermelha acesa por mais de 10 minutos + trigger: + - entity_id: switch.luz_wc_vermelha + for: 00:10:00 + from: 'off' + platform: state + to: 'on' + condition: [] + action: + - data: + message: Wc Vermelha luz acesa + title: '*Luz WC Vermelha*' + service: notify.buttler + - data: + message: Wc Vermelha luz acesa + title: '*Luz WC Vermelha*' + service: notify.mobile_app_redmi_k20 + mode: single +- id: '1603375184553' + alias: 'Garagem luz 1 demasiado tempo ligada +10'' ' + description: Avisa se luz Wc Vermelha acesa por mais de 10 minutos + trigger: + - entity_id: light.luz_garagem_1 + for: 00:10:00 + from: 'off' + platform: state + to: 'on' + condition: [] + action: + - data: + message: Luz garagem 1 acesa + title: '*Luz garagem 1*' + service: notify.buttler + - data: + message: Luz garagem 1 acesa + title: '*Luz garagem 1*' + service: notify.mobile_app_redmi_k20 + mode: single +- id: '1603375213791' + alias: Garagem luz 2 demasiado tempo ligada +10' + description: Avisa se luz Wc Vermelha acesa por mais de 10 minutos + trigger: + - entity_id: light.luz_garagem_2 + for: 00:10:00 + from: 'off' + platform: state + to: 'on' + condition: [] + action: + - data: + message: Luz garagem 2 acesa + title: '*Luz garagem 2*' + service: notify.buttler + - data: + message: Luz garagem 2 acesa + title: '*Luz garagem 2*' + service: notify.mobile_app_redmi_k20 + mode: single +- id: '1604863723383' + alias: WC Preto luz demasiado tempo ligada +10' + description: Avisa se luz Wc Preto acesa por mais de 10 minutos + trigger: + - entity_id: light.luz_wc_preto + for: 00:10:00 + from: 'off' + platform: state + to: 'on' + condition: [] + action: + - data: + message: Wc Preto luz acesa + title: '*Luz WC Preto *' + service: notify.buttler + mode: single +- id: '1605814123567' + alias: Arvore Natal + description: '' + trigger: + - at: '17:30:00' + platform: time + - at: '23:00:00' + platform: time + condition: [] + action: + - data: {} + entity_id: switch.tomada_escritorio + service: switch.toggle + mode: single diff --git a/configuration.yaml b/configuration.yaml new file mode 100755 index 0000000..0501f02 --- /dev/null +++ b/configuration.yaml @@ -0,0 +1,46 @@ + +# Configure a default setup of Home Assistant (frontend, api, etc) +default_config: + +# Uncomment this if you are using SSL/TLS, running in Docker container, etc. +# http: +# base_url: home.vferreira.pt:8123 + +# Text to speech +tts: + - platform: google_translate + +google_assistant: + project_id: haintegration-655c6 + exposed_domains: + - switch + - light + +speedtestdotnet: + scan_interval: + minutes: 30 + monitored_conditions: + - ping + - download + - upload + +notify: + - name: Buttler + platform: telegram + chat_id: 564913435 + +telegram_bot: + - platform: polling + api_key: !secret telegram_bot_token + allowed_chat_ids: + - 564913435 + +group: !include groups.yaml +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml +sensor: !include sensor.yaml +cover: !include cover.yaml +light: !include light.yaml +switch: !include switch.yaml +media_player: !include mediaplayers.yaml diff --git a/cover.yaml b/cover.yaml new file mode 100755 index 0000000..fe63465 --- /dev/null +++ b/cover.yaml @@ -0,0 +1,13 @@ + - platform: mqtt + name: "Portao Garagem" + state_topic: "garageGate/state" + command_topic: "garageGate/cmd" + qos: 1 + #payload_open: "push" + #payload_close: "push" + #payload_stop: "push" + state_open: "ope" + state_closed: "close" + optimistic: true + retain: true + device_class: garage diff --git a/groups.yaml b/groups.yaml new file mode 100755 index 0000000..b3c9154 --- /dev/null +++ b/groups.yaml @@ -0,0 +1,71 @@ +################################################################# +## Groups +################################################################# +#VISTAS +# default_view: +# view: yes +# icon: mdi:home +# entities: +# - group.Sun +# - group.previsao_tempo +# +# divsala: +# name: Sala +# view: yes +# icon: mdi:sofa +# entities: +# - group.sala + +# divescritorio: +# name: Escritorio +# view: yes +# icon: mdi:deskphone +# entities: +# - group.escritorio + +# mediaCenter: +# name: MediaCenter +# view: yes +# icon: mdi:play-protected-content +# entities: +# - group.media + +# internet: +# name: Internet +# control: hidden +# entities: +# - sensor.speedtest_download +# - sensor.speedtest_upload +# - sensor.speedtest_ping +# sala: +# name: Sala +# control: hidden +# entities: +# - media_player.mediaroom_2e2b8cad_08ba_4a61_aa9e_eed8246ce17f +# - group.Aquario + +# Sun: +# name: Sol +# control: hidden +# entities: +# - sun.sun + +# Aquario: +# name: aquario +# control: hidden +# entities: +# - switch.luz_aquario +# dispositivos: +# name: Dispositivos +# entities: +# - device_tracker.oneplus_3 +# - device_tracker.android6b624d787f17d7a5 + + sisHealth: + name: Sistema + entities: + - sensor.cpu_speed + - sensor.disk_use_percent_home + - sensor.memory_free + - sensor.last_boot + - group.internet \ No newline at end of file diff --git a/light.yaml b/light.yaml new file mode 100755 index 0000000..5b6983a --- /dev/null +++ b/light.yaml @@ -0,0 +1,104 @@ + - platform: mqtt + name: "Luz Hall Quarto Principal" + state_topic: "stat/tasmota_BC6546/POWER" + command_topic: "cmnd/tasmota_BC6546/POWER" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz WC Vermelha" + state_topic: "stat/Luzwcred/POWER" + command_topic: "cmnd/Luzwcred/POWER" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Aquario" + command_topic: "cmnd/SonoffluzAquario/power" + state_topic: "stat/SonoffluzAquario/POWER" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Wc Preto" + command_topic: "cmnd/tasmota_FD991E/power" + state_topic: "stat/tasmota_FD991E/POWER" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Escritorio" + command_topic: "cmnd/LuzEscritorio/power" + state_topic: "stat/LuzEscritorio/POWER" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Jardim Frente Lado" + command_topic: "mqttServer/14031717/light/14031717luzfrentelado/set" + state_topic: "mqttServer/14031717/light/14031717luzfrentelado/state" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Jardim Frente" + command_topic: "mqttServer/14031717/light/14031717luzjardimfrente/set" + state_topic: "mqttServer/14031717/light/14031717luzjardimfrente/state" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Garagem 1" + command_topic: "mqttServer/14029039/light/14029039luzgaragem1/set" + state_topic: "mqttServer/14029039/light/14029039luzgaragem1/set" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Garagem 2" + command_topic: "mqttServer/14029039/light/14029039luzgaragem2/set" + state_topic: "mqttServer/14029039/light/14029039luzgaragem2/state" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Hall Tras" + command_topic: "mqttServer/14049798/light/14049798luzhalltras/set" + state_topic: "mqttServer/14049798/light/14049798luzhalltras/state" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Luz Muro Tras" + command_topic: "mqttServer/14049798/light/14049798luzmurostras/set" + state_topic: "mqttServer/14049798/light/14049798luzmurostras/state" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: philips_ambilight + name: TV Ambilight + host: !secret philipstv_ip + username: !secret philipstv_user + password: !secret philipstv_pass diff --git a/mediaplayers.yaml b/mediaplayers.yaml new file mode 100755 index 0000000..75038da --- /dev/null +++ b/mediaplayers.yaml @@ -0,0 +1,9 @@ +#media player components + - platform: mediaroom + + - platform: philips_android_tv + name: TV + host: !secret philipstv_ip + mac: !secret philipstv_mac + username: !secret philipstv_user + password: !secret philipstv_pass \ No newline at end of file diff --git a/scenes.yaml b/scenes.yaml new file mode 100755 index 0000000..1ba8f4b --- /dev/null +++ b/scenes.yaml @@ -0,0 +1,35 @@ +- id: '1590326767440' + name: Nova Cena + entities: + cover.shelly_shsw_25_10a2cf: + current_position: 50 + friendly_name: Shelly 2.5 (Roller) - 10A2CF + ip_address: 192.168.1.158 + shelly_id: 10A2CF + shelly_type: Shelly 2.5 (Roller) + state: open + supported_features: 15 + cover.shelly_shsw_25_68c63af95aae: + current_position: 100 + friendly_name: Shelly 2.5 (Roller) - 68C63AF95AAE + ip_address: 192.168.1.127 + shelly_id: 68C63AF95AAE + shelly_type: Shelly 2.5 (Roller) + state: open + supported_features: 15 + cover.shelly_shsw_25_68c63af95f99: + current_position: 30 + friendly_name: Shelly 2.5 (Roller) - 68C63AF95F99 + ip_address: 192.168.1.124 + shelly_id: 68C63AF95F99 + shelly_type: Shelly 2.5 (Roller) + state: open + supported_features: 15 + cover.shelly_shsw_25_8caab50583b0: + current_position: 50 + friendly_name: Shelly 2.5 (Roller) - 8CAAB50583B0 + ip_address: 192.168.1.106 + shelly_id: 8CAAB50583B0 + shelly_type: Shelly 2.5 (Roller) + state: open + supported_features: 15 diff --git a/scripts.yaml b/scripts.yaml new file mode 100755 index 0000000..884e643 --- /dev/null +++ b/scripts.yaml @@ -0,0 +1,6 @@ +'1593471301993': + alias: Acionar Regua + sequence: + - data: {} + entity_id: automation.watering_garden_manual_cycle + service: automation.trigger diff --git a/sensor.yaml b/sensor.yaml new file mode 100755 index 0000000..e2db0c8 --- /dev/null +++ b/sensor.yaml @@ -0,0 +1,82 @@ + - platform: cpuspeed + - platform: systemmonitor + resources: + - type: disk_use_percent + arg: /home + - type: memory_free + - type: last_boot + - platform: mqtt + name: "sensor aquario" + state_topic: "tele/SonoffluzAquario/SENSOR" + value_template: "{{ value_json['DS18B20'].Temperature }}" + unit_of_measurement: 'C' + - platform: mqtt + name: "Temperatura Escritorio" + state_topic: "tele/sonoffEscritorio/SENSOR" + value_template: "{{ value_json['DHT11'].Temperature }}" + unit_of_measurement: 'C' + - platform: mqtt + name: "Humidade Escritorio" + state_topic: "tele/sonoffEscritorio/SENSOR" + value_template: "{{ value_json['DHT11'].Humidity }}" + unit_of_measurement: '%' + - platform: mqtt + name: "Aquecimento Piso Amperes" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Current }}" + unit_of_measurement: 'A' + - platform: mqtt + name: "Aquecimento Piso Watts" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Power }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Piso Volts" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Voltage }}" + unit_of_measurement: 'V' + - platform: mqtt + name: "Aquecimento Piso Watts Hoje" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Today }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Piso Watts Ontem" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Yesterday }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Piso Watts Total" + state_topic: "tele/soaquecepiso/SENSOR" + value_template: "{{ value_json['ENERGY'].Total }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Agua Amperes" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Current }}" + unit_of_measurement: 'A' + - platform: mqtt + name: "Aquecimento Agua Watts" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Power }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Agua Volts" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Voltage }}" + unit_of_measurement: 'V' + - platform: mqtt + name: "Aquecimento Agua Watts Hoje" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Today }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Agua Watts Ontem" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Yesterday }}" + unit_of_measurement: 'W' + - platform: mqtt + name: "Aquecimento Agua Watts Total" + state_topic: "tele/soaqueceagua/SENSOR" + value_template: "{{ value_json['ENERGY'].Total }}" + unit_of_measurement: 'W' diff --git a/switch.yaml b/switch.yaml new file mode 100755 index 0000000..899b475 --- /dev/null +++ b/switch.yaml @@ -0,0 +1,59 @@ + - platform: mqtt + name: "Aquecimento piso" + state_topic: "stat/soaquecepiso/POWER" + command_topic: "cmnd/soaquecepiso/power" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Tomada escritorio" + state_topic: "stat/sonoffEscritorio/POWER" + command_topic: "cmnd/sonoffEscritorio/power" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Aquecimento agua" + state_topic: "stat/soaqueceagua/POWER" + command_topic: "cmnd/soaqueceagua/power" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + retain: true + + - platform: mqtt + name: "Valvula jardim 1" + state_topic: "stat/tasmota_8CA4C5/POWER1" + command_topic: "cmnd/tasmota_8CA4C5/POWER1" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + payload_available: "Online" + payload_not_available: "Offline" + retain: true + + - platform: mqtt + name: "Valvula jardim 2" + state_topic: "stat/tasmota_8CA4C5/POWER2" + command_topic: "cmnd/tasmota_8CA4C5/POWER2" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + payload_available: "Online" + payload_not_available: "Offline" + retain: true + + - platform: mqtt + name: "Valvula jardim 3" + state_topic: "stat/tasmota_8CA4C5/POWER3" + command_topic: "cmnd/tasmota_8CA4C5/POWER3" + qos: 1 + payload_on: "ON" + payload_off: "OFF" + payload_available: "Online" + payload_not_available: "Offline" + retain: true