diff --git a/automations/alert-office-cabinet.yaml b/automations/alert-office-cabinet.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9e2677d2fe88cf3d939324ba4ebc8196c65f053 --- /dev/null +++ b/automations/alert-office-cabinet.yaml @@ -0,0 +1,13 @@ +alias: Slack notification for office cabinet access +trigger: + - platform: state + entity_id: binary_sensor.office_cabinet + to: "off" + - platform: state + entity_id: binary_sensor.office_cabinet_door_motion + to: "on" +action: + service: notify.slack + data: + message: ':bellhop_bell: *Office cabinet accessed*' + target: '#home' diff --git a/automations/apc-notification-not-online.yaml b/automations/apc-notification-not-online.yaml new file mode 100644 index 0000000000000000000000000000000000000000..20c9ddd1e91690284508a3988c01568267069d45 --- /dev/null +++ b/automations/apc-notification-not-online.yaml @@ -0,0 +1,14 @@ +alias: Notify when APC not online +trigger: + platform: state + entity_id: sensor.ups_status + from: "ONLINE" +action: + - service: notify.jabber + data: + message: "Office APC has status \"{{ states( 'sensor.ups_status' ) }}\"" + target: !secret jabber_recipient + - service: notify.slack + data: + message: ":exclamation: :battery: Office APC has status \"{{ states( 'sensor.ups_status' ) }}\"" + target: '#home' diff --git a/automations/apc-notification-online.yaml b/automations/apc-notification-online.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f752f25bec32d63a76f34534c64749420d04278 --- /dev/null +++ b/automations/apc-notification-online.yaml @@ -0,0 +1,14 @@ +alias: Notify when APC online +trigger: + platform: state + entity_id: sensor.ups_status + to: "ONLINE" +action: + - service: notify.jabber + data: + message: 'Office APC is "ONLINE"' + target: !secret jabber_recipient + - service: notify.slack + data: + message: ':exclamation: :electric_plug: Office APC is "ONLINE"' + target: '#home' diff --git a/automations/kitchen-nightlight-on.yaml b/automations/kitchen-nightlight-on-am.yaml similarity index 90% rename from automations/kitchen-nightlight-on.yaml rename to automations/kitchen-nightlight-on-am.yaml index 620b17472e5c479d07f59b1ddd0393eabd1e9739..951099f37fbf26accb005f4dd545141294a151f4 100644 --- a/automations/kitchen-nightlight-on.yaml +++ b/automations/kitchen-nightlight-on-am.yaml @@ -1,4 +1,4 @@ -alias: Turn kitchen nightlight on +alias: Turn kitchen nightlight on AM trigger: - platform: state entity_id: switch.kitchen @@ -16,8 +16,6 @@ condition: - condition: state entity_id: sun.sun state: 'below_horizon' - - condition: time - after: '00:15:00' - condition: time before: '09:00:00' - condition: state diff --git a/automations/kitchen-nightlight-on-pm.yaml b/automations/kitchen-nightlight-on-pm.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ad1e1388d99997a77e1cfd21112e1b55662c806e --- /dev/null +++ b/automations/kitchen-nightlight-on-pm.yaml @@ -0,0 +1,32 @@ +alias: Turn kitchen nightlight on PM +trigger: + - platform: state + entity_id: switch.kitchen + - platform: state + entity_id: light.ceiling_fan_1 + - platform: state + entity_id: light.ceiling_fan_2 + - platform: state + entity_id: binary_sensor.kitchen + - platform: state + entity_id: binary_sensor.lr_motion_sensor_over_utility_closet +condition: + condition: and + conditions: + - condition: state + entity_id: sun.sun + state: 'below_horizon' + - condition: time + after: '21:30:00' + - condition: state + entity_id: light.ceiling_fan_1 + state: 'off' + - condition: state + entity_id: light.ceiling_fan_2 + state: 'off' + - condition: state + entity_id: switch.kitchen + state: 'off' +action: + service: switch.turn_on + entity_id: switch.kitchen_nightlight diff --git a/automations/maybe-an-earthquake.yaml b/automations/maybe-an-earthquake.yaml index e04d6cdd6e05b9e00610a491563242e0d31c8001..803a9993bb6ec75fce3268ccd3d76ae06b6ab94b 100644 --- a/automations/maybe-an-earthquake.yaml +++ b/automations/maybe-an-earthquake.yaml @@ -34,3 +34,11 @@ action: - service: notify.jabber data: message: 'MAYBE AN EARTHQUAKE?!? ALL ACCELEROMETERS ARE ACTIVE.' + target: !secret jabber_recipient + - service: notify.slack + data: + message: 'MAYBE AN EARTHQUAKE?!? ALL ACCELEROMETERS ARE ACTIVE.' + target: + - '#alerts' + - '#general' + - '#home' diff --git a/automations/update-notification.yaml b/automations/update-notification.yaml index 18bbe7e95fabb2e4f431937e7b92bb4f51144aa3..45a2ada6d0e5640602676caf33ff45d34a621065 100644 --- a/automations/update-notification.yaml +++ b/automations/update-notification.yaml @@ -3,6 +3,11 @@ trigger: platform: state entity_id: updater.updater action: - service: notify.jabber - data: - message: 'There is a new release of Home Assistant available.' + - service: notify.jabber + data: + message: 'There is a new release of Home Assistant available.' + target: !secret jabber_recipient + - service: notify.slack + data: + message: ':exclamation: There is a new release of Home Assistant available.' + target: '#home' diff --git a/configuration.yaml b/configuration.yaml index f8eac0c2072befcf8ac0fd248aa6be8fb9562c4e..4491e89a753c3bd0d89ffe819d69a59ef8d48c4a 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -16,7 +16,7 @@ homeassistant: http: api_password: !secret api_password server_port: 8123 - ssl_certificate: /home/pi/ssl/cert + ssl_certificate: /home/pi/ssl/chain ssl_key: /home/pi/ssl/key zone: @@ -34,15 +34,31 @@ frontend: # Set recorder options recorder: - # purge_days: 365 + purge_days: 14 db_url: !secret mysql_recorder +# Also log states to InfluxDB +influxdb: + host: !secret influxdb_host + database: !secret influxdb_db + username: !secret influxdb_user + password: !secret influxdb_password + ssl: true + verify_ssl: true + # Enables support for tracking state changes over time. history: # Discover some devices automatically discovery: +# Logging settings +logger: + default: info # default logging level + logs: + homeassistant.components.device_tracker.asuswrt: error # suppress IPv6-related warnings; see https://github.com/home-assistant/home-assistant/issues/2814 + homeassistant.components.sensor.rest: debug + # View all events in a logbook logbook: @@ -73,6 +89,12 @@ alarm_control_panel: !include alarm-control-panel.yaml wemo: !include wemo.yaml +weblink: !include weblinks.yaml + +panel_iframe: !include panels-iframe.yaml + +apcupsd: + # Display group: !include groups.yaml diff --git a/customizations/sensors.yaml b/customizations/sensors.yaml index 9cb485d3f9de47cea78f6dd2e2c3f43073b2739c..4ce614b3c0d6d4f05770955201ed9b398760b16a 100644 --- a/customizations/sensors.yaml +++ b/customizations/sensors.yaml @@ -131,3 +131,13 @@ sensor.pws_wind_kph: friendly_name: Wind Speed (kph) sensor.pws_wind_mph: friendly_name: Wind Speed (mph) +sensor.time: + friendly_name: Time (PT) +sensor.pihole: + friendly_name: Ads Blocked +sensor.eth1_data_received_mean: + friendly_name: Received eth1 + icon: mdi:server-network +sensor.eth1_data_sent_mean: + friendly_name: Sent eth1 + icon: mdi:server-network diff --git a/groups.yaml b/groups.yaml index 1e523aaeec83d2990f7e8ddbd822b18b462e0168..62682071e0e2fff1a9134430d3ae0d9120253066 100644 --- a/groups.yaml +++ b/groups.yaml @@ -27,15 +27,21 @@ sensor_view: - sensor.speedtest_download - sensor.speedtest_upload - sensor.fastcom_download + - sensor.pihole_queries_today - sun.sun status_view: name: Status view: yes icon: mdi:chip entities: - - group.sensor_pi - group.time_date + - group.sensor_pi + - group.sensor_apc - group.sensor_battery_levels + - sensor.pihole + - sensor.pihole_percent_ads_today + - sensor.pihole_queries_today + - sensor.pihole_domains_blocked weather_view: name: Weather view: yes @@ -156,40 +162,41 @@ presence: - device_tracker.cl_samsung_s5 - device_tracker.cl_iphone_5 - device_tracker.green_keys +time_date: + name: Time & Date + entities: + - sensor.date + - sensor.time + - sensor.time_utc sensor_pi: name: Raspberry Pi entities: - - sensor.cpu - sensor.cpu_use - sensor.disk_use_ - sensor.disk_use_varlog - sensor.ram_use - sensor.ram_free -# - sensor.processor_use - sensor.swap_use + - sensor.swap_free - sensor.last_boot - sensor.since_last_boot - - sensor.received_eth0 - - sensor.sent_eth0 - # - sensor.packets_received_eth0 - # - sensor.packets_sent_eth0 - - sensor.ipv4_address_eth0 - - sensor.ipv6_address_eth0 - - sensor.received_eth1 - - sensor.sent_eth1 - # - sensor.packets_received_eth1 - # - sensor.packets_sent_eth1 - - sensor.ipv4_address_eth1 - - sensor.ipv6_address_eth1 -time_date: - name: Time & Date - entities: - - sensor.time - - sensor.date - - sensor.date_time - - sensor.time_date - - sensor.time_utc - - sensor.beat + - sensor.eth1_data_received_mean # Stats sensor to replace sensor.received_eth1 + - sensor.eth1_data_sent_mean # Stats sensor to replace sensor.sent_eth1 +sensor_apc: + name: APC + entities: + - sensor.ups_status + - sensor.ups_load + - sensor.ups_time_left + - sensor.ups_time_on_battery + - sensor.ups_last_transfer + - sensor.ups_transfer_count + - sensor.ups_battery + - sensor.ups_battery_nominal_voltage + - sensor.ups_input_voltage + - sensor.ups_nominal_input_voltage + - sensor.ups_nominal_output_power + - sensor.ups_output_voltage sensor_battery_levels: name: Sensor Battery Levels entities: @@ -240,3 +247,4 @@ wunderground: - sensor.pws_visibility_mi - sensor.pws_uv - sensor.pws_solarradiation + - weblink.forecast diff --git a/input-sliders.yaml b/input-sliders.yaml index e4aa769108d2b0abd29b820fea3cfcacd39e8206..c90683dbbdf493c92dbeaa8b76098d6b66e3701a 100644 --- a/input-sliders.yaml +++ b/input-sliders.yaml @@ -1,18 +1,18 @@ brightness_da: name: Brightness - initial: 0 + initial: 1 min: 1 max: 255 step: 1 brightness_lr: name: Brightness - initial: 0 + initial: 1 min: 1 max: 255 step: 1 brightness_master_bath: name: Brightness - initial: 0 + initial: 1 min: 1 max: 255 step: 1 diff --git a/notifications.yaml b/notifications.yaml index fa47a75729283a733a6b693fd9bb45c340dad2e3..f655b61c8a2901c1c1af56ae740bb02641384f13 100644 --- a/notifications.yaml +++ b/notifications.yaml @@ -3,4 +3,8 @@ sender: !secret jabber_sender password: !secret jabber_password recipient: !secret jabber_recipient - tls: True + tls: true +- name: slack + platform: slack + api_key: !secret slack_api_key + default_channel: '#home' diff --git a/panels-iframe.yaml b/panels-iframe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1ba8c4488b3d6487fc111183c20041c5699d6ec2 --- /dev/null +++ b/panels-iframe.yaml @@ -0,0 +1,8 @@ +pihole: + title: 'Pi Hole' + icon: 'mdi:apple-safari' + url: !secret pi_hole_admin +monit: + title: 'Monit' + icon: 'mdi:autorenew' + url: !secret monit_admin diff --git a/scenes/master-bath-dash-on.yaml b/scenes/master-bath-dash-on.yaml index bee0050289b710554efa068901d831225bf10dda..096e8db724f1961b6edaf91e00a44b21c9a33eb0 100644 --- a/scenes/master-bath-dash-on.yaml +++ b/scenes/master-bath-dash-on.yaml @@ -8,3 +8,5 @@ entities: color_temp: 450 light.master_bath_3: state: off + automation.brightness_master_bath_sync: + state: off diff --git a/secrets.yaml b/secrets.yaml index 873ee73d1f4f53fcd5d1bb82b3010445d5707136..00397fdd6933862d085c3ae32dced0a3d1faf230 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -11,6 +11,15 @@ gravatar_chris: gravatar_chris_2: wunderground_key: wunderground_pws_id: +wunderground_forecast_url: logentries_token: mysql_recorder: -wemo_ip: +wemo_kitchen_ip: +slack_api_key: +influxdb_host: +influxdb_user: +influxdb_password: +influxdb_db: +pi_hole_host: +pi_hole_admin: +monit_admin: diff --git a/sensors/apcupsd.yaml b/sensors/apcupsd.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3d8a487f7822644296c093114e0b520b7e124eb0 --- /dev/null +++ b/sensors/apcupsd.yaml @@ -0,0 +1,13 @@ +platform: apcupsd +resources: + - bcharge + - linev + - loadpct + - nominv + - nombattv + - nompower + - numxfers + - status + - timeleft + - tonbatt + - lastxfer diff --git a/sensors/fastcom.yaml b/sensors/fastcom.yaml index 9febf5a965fcf03e595b58b3730b810ca34de58a..8ee5e2c0b05b2c98bcb7404e43a0303a6958f70a 100644 --- a/sensors/fastcom.yaml +++ b/sensors/fastcom.yaml @@ -1,6 +1,6 @@ platform: fastdotcom minute: - - 0 - - 15 - - 30 - - 45 + - 4 + - 19 + - 34 + - 49 diff --git a/sensors/pihole.yaml b/sensors/pihole.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f72a457f183d07fceda39d9655623f05884ae8c1 --- /dev/null +++ b/sensors/pihole.yaml @@ -0,0 +1,4 @@ +platform: pi_hole +host: !secret pi_hole_host +ssl: true +verify: true diff --git a/sensors/speedtest.yaml b/sensors/speedtest.yaml index f2f21ba5dc9f44f0337b994be98870503ca5395c..ad399eb86d2d7cbf99cf2c8c1b84fd63e19a183a 100644 --- a/sensors/speedtest.yaml +++ b/sensors/speedtest.yaml @@ -1,9 +1,9 @@ platform: speedtest minute: - - 0 - - 15 - - 30 - - 45 + - 2 + - 17 + - 32 + - 47 monitored_conditions: - ping - download diff --git a/sensors/statistics-eth1-received.yaml b/sensors/statistics-eth1-received.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2e242dbe7aedd8fcd17bd61f2cf704f9617d250a --- /dev/null +++ b/sensors/statistics-eth1-received.yaml @@ -0,0 +1,3 @@ +platform: statistics +name: eth1 Data Received +entity_id: sensor.received_eth1 diff --git a/sensors/statistics-eth1-sent.yaml b/sensors/statistics-eth1-sent.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a0e2e78bc2b79387299f085b7c9b560c60bd546 --- /dev/null +++ b/sensors/statistics-eth1-sent.yaml @@ -0,0 +1,3 @@ +platform: statistics +name: eth1 Data Sent +entity_id: sensor.sent_eth1 diff --git a/sensors/systemmonitor.yaml b/sensors/systemmonitor.yaml index 531b29bc6778de34217994d6cbaf3fdcc2112abb..9c449fd42893651616183a9c30de04625c32e399 100644 --- a/sensors/systemmonitor.yaml +++ b/sensors/systemmonitor.yaml @@ -5,9 +5,12 @@ resources: - type: disk_use_percent arg: /var/log - type: memory_use_percent + - type: memory_use - type: memory_free - type: processor_use - type: swap_use_percent + - type: swap_use + - type: swap_free - type: last_boot - type: since_last_boot - type: network_in diff --git a/sensors/template.yaml b/sensors/template.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7bba1524a2dd8f9051c7fb31eb98d3a0357493a1 --- /dev/null +++ b/sensors/template.yaml @@ -0,0 +1,15 @@ +platform: template +sensors: + pihole_queries_today: + value_template: '{{ states.sensor.pihole.attributes.queries_today | round(0) }}' + friendly_name: DNS Queries Today + entity_id: sensor.pihole + pihole_domains_blocked: + value_template: '{{ states.sensor.pihole.attributes.domains_blocked | round(0) }}' + friendly_name: Domains Blocked + entity_id: sensor.pihole + pihole_percent_ads_today: + value_template: '{{ states.sensor.pihole.attributes.percentage_today | round(1) }}' + friendly_name: Percent Ads Today + unit_of_measurement: '%' + entity_id: sensor.pihole diff --git a/weblinks.yaml b/weblinks.yaml new file mode 100644 index 0000000000000000000000000000000000000000..99870e2f7742d68591aa118013e288dcdfba8cf8 --- /dev/null +++ b/weblinks.yaml @@ -0,0 +1,4 @@ +entities: + - name: Forecast + url: !secret wunderground_forecast_url + icon: mdi:web diff --git a/wemo.yaml b/wemo.yaml index ec5bd90d98cb90b9191217d95f17951b79522a48..2adb38e7d2834a989afbf54a6d9fa86df974c310 100644 --- a/wemo.yaml +++ b/wemo.yaml @@ -1,2 +1,2 @@ static: - - !secret wemo_ip + - !secret wemo_kitchen_ip