mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-16 18:44:58 +00:00
You can find the entire repo here.
This commit is contained in:
11
config/sensor/MQTT.yaml
Executable file
11
config/sensor/MQTT.yaml
Executable file
@@ -0,0 +1,11 @@
|
||||
###################################################
|
||||
## Various MQTT sensors
|
||||
###################################################
|
||||
|
||||
- platform: mqtt
|
||||
state_topic: "ifttt/rachio/watering_time"
|
||||
name: "Rachio_watering_time"
|
||||
|
||||
- platform: mqtt
|
||||
state_topic: "dash/medicine/medicine_time"
|
||||
name: "Medicine time"
|
4
config/sensor/date_time.yaml
Executable file
4
config/sensor/date_time.yaml
Executable file
@@ -0,0 +1,4 @@
|
||||
- platform: time_date
|
||||
display_options:
|
||||
- 'time'
|
||||
- 'date'
|
41
config/sensor/hass_stats.yaml
Executable file
41
config/sensor/hass_stats.yaml
Executable file
@@ -0,0 +1,41 @@
|
||||
###################################################
|
||||
## * Special HASS related sensors - Thanks @torn8o
|
||||
###################################################
|
||||
|
||||
- platform: version
|
||||
name: HA Installed Version
|
||||
scan_interval: 86400
|
||||
|
||||
- platform: command_line
|
||||
name: "HA Uptime"
|
||||
command: echo "$(($(date +%s) - $(date -d "$(head -n1 /config/home-assistant.log | cut -d' ' -f-2)" +%s)))"
|
||||
scan_interval: 720
|
||||
value_template: >-
|
||||
{% set uptime = value | int %}
|
||||
{% set seconds = uptime % 60 %}
|
||||
{% set minutes = ((uptime % 3600) / 60) | int %}
|
||||
{% set hours = ((uptime % 86400) / 3600) | int %}
|
||||
{% set days = (uptime / 86400) | int %}
|
||||
{%- if days > 0 -%}
|
||||
{%- if days == 1 -%}
|
||||
1 day
|
||||
{%- else -%}
|
||||
{{ days }} days
|
||||
{%- endif -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if hours > 0 -%}
|
||||
{%- if hours == 1 -%}
|
||||
1 hour
|
||||
{%- else -%}
|
||||
{{ hours }} hours
|
||||
{%- endif -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if minutes > 0 -%}
|
||||
{%- if minutes == 1 -%}
|
||||
1 minute
|
||||
{%- else -%}
|
||||
{{ minutes }} minutes
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
25
config/sensor/nest.yaml
Executable file
25
config/sensor/nest.yaml
Executable file
@@ -0,0 +1,25 @@
|
||||
###################################################
|
||||
## * [Nest Thermostats](http://amzn.to/2eAhB1k)
|
||||
# @CCOSTAN
|
||||
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||
###################################################
|
||||
|
||||
- platform: nest
|
||||
monitored_conditions:
|
||||
# - 'temperature'
|
||||
# - 'target'
|
||||
- 'humidity'
|
||||
# - 'operation_mode'
|
||||
# - 'last_connection'
|
||||
# - 'co_status'
|
||||
# - 'smoke_status'
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
upstairs_away_mode:
|
||||
value_template: "{{ is_state_attr('climate.upstairs', 'away_mode', 'on') }}"
|
||||
|
||||
- platform: template
|
||||
sensors:
|
||||
downstairs_away_mode:
|
||||
value_template: "{{ is_state_attr('climate.downstairs', 'away_mode', 'on') }}"
|
10
config/sensor/speedtest.yaml
Executable file
10
config/sensor/speedtest.yaml
Executable file
@@ -0,0 +1,10 @@
|
||||
- platform: speedtest
|
||||
minute: 30
|
||||
hour:
|
||||
- 0
|
||||
- 6
|
||||
- 12
|
||||
- 18
|
||||
monitored_conditions:
|
||||
- download
|
||||
- upload
|
58
config/sensor/systemmonitor.yaml
Executable file
58
config/sensor/systemmonitor.yaml
Executable file
@@ -0,0 +1,58 @@
|
||||
- platform: template
|
||||
sensors:
|
||||
since_last_boot_templated:
|
||||
value_template: >-
|
||||
{%- set slb = states.sensor.since_last_boot.state.split(' ') -%}
|
||||
{%- set count = slb | length -%}
|
||||
{%- set hms = slb[count - 1] -%}
|
||||
{%- set hms_trimmed = hms.split('.')[0] -%}
|
||||
{%- set hms_split = hms_trimmed.split(':') -%}
|
||||
{%- set hours = hms_split[0] | int -%}
|
||||
{%- set minutes = hms_split[1] | int -%}
|
||||
{%- set seconds = hms_split[2] | int -%}
|
||||
|
||||
{%- if count == 3 -%}
|
||||
{{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }}
|
||||
{%- endif -%}
|
||||
{%- if hours > 0 -%}
|
||||
{%- if hours == 1 -%}
|
||||
1 hour
|
||||
{%- else -%}
|
||||
{{ hours }} hours
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if minutes > 0 -%}
|
||||
{%- if hours > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if minutes == 1 -%}
|
||||
1 minute
|
||||
{%- else -%}
|
||||
{{ minutes }} minutes
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- if seconds > 0 -%}
|
||||
{%- if hours > 0 or minutes > 0 -%}
|
||||
{{ ', ' }}
|
||||
{%- endif -%}
|
||||
{%- if seconds == 1 -%}
|
||||
1 second
|
||||
{%- else -%}
|
||||
{{ seconds }} seconds
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
|
||||
- platform: rest
|
||||
scan_interval: 86400
|
||||
resource: http://ip.jsontest.com
|
||||
name: External IP
|
||||
value_template: '{{ value_json.ip }}'
|
||||
|
||||
#############################################################################################################
|
||||
### This part of the automation is hidden due to the IP address exposed ##
|
||||
# - platform: template
|
||||
# sensors:
|
||||
# ipchange:
|
||||
# entity_id: sensor.external_ip
|
||||
# value_template: "{%- if is_state('sensor.external_ip', 'xxx.xxx.xxx.xxx') -%} False {%- elif is_state('sensor.external_ip', 'unknown' ) -%} False {%- else -%} True {%- endif %}"
|
||||
#############################################################################################################
|
19
config/sensor/weather.yaml
Executable file
19
config/sensor/weather.yaml
Executable file
@@ -0,0 +1,19 @@
|
||||
- platform: darksky
|
||||
api_key: !secret forecast_key
|
||||
monitored_conditions:
|
||||
# - summary
|
||||
# - precip_type
|
||||
- precip_intensity
|
||||
- precip_intensity_max
|
||||
- temperature
|
||||
# - dew_point
|
||||
- wind_speed
|
||||
# - wind_bearing
|
||||
- cloud_cover
|
||||
- humidity
|
||||
# - nearest_storm_distance
|
||||
- minutely_summary
|
||||
# - pressure
|
||||
# - visibility
|
||||
# - ozone
|
||||
- uv_index
|
Reference in New Issue
Block a user