Inital Commit

This commit is contained in:
2022-10-11 15:40:40 +13:00
commit 7089991005
50 changed files with 1313 additions and 0 deletions

18
sensor/coronavirus.yaml Normal file
View File

@@ -0,0 +1,18 @@
- platform: statistics
entity_id: sensor.coronavirus_totals_normalised
sampling_size: 200000
state_characteristic: mean
max_age:
days: 1
name: "Coronavirus Statistics"
- platform: template
sensors:
coronavirus_totals_normalised:
friendly_name: "NZ Coronavirus Totals (Normalised)"
value_template: >
{% set new_state = states('sensor.new_zealand_coronavirus_confirmed') | float %}
{% if new_state >= states('input_number.new_zealand_coronavirus_confirmed_previous_value') | float %}
{{ new_state }}
{% else %}
{{ states('input_number.new_zealand_coronavirus_confirmed_previous_value') | float }}
{% endif %}

6
sensor/google_keep.yaml Normal file
View File

@@ -0,0 +1,6 @@
- platform: google_keep
username: !secret google_keep.username
password: !secret google_keep.password
labels:
- "Home Assistant"
pinned: true

26
sensor/grocy.yaml Normal file
View File

@@ -0,0 +1,26 @@
- platform: rest
name: Dog Motel Cleaning
resource: !secret grocy_api_uri_chore3
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"
- platform: rest
name: Red Bin Out
resource: !secret grocy_api_uri_chore2
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"

View File

@@ -0,0 +1,20 @@
- platform: template
sensors:
sensor_internet_downtraffic:
friendly_name: "Internet Download Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') }}"
- platform: template
sensors:
sensor_internet_uptraffic:
friendly_name: "Internet Upload Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') }}"
- platform: template
sensors:
sensor_internet_totaltraffic:
friendly_name: "Internet Total Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') |float + state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') | float }}"

View File

@@ -0,0 +1,19 @@
- platform: template
sensors:
devices_with_low_battery:
friendly_name: "Devices with low battery"
unit_of_measurement: devices
value_template: >-
{{ states.sensor
| selectattr('attributes.device_class', 'eq', 'battery')
| map(attribute='state')
| reject('in', ['unknown', 'unavailable', 'Ok'])
| map('int', -1) | select('le', 97)
| list | count
}}
icon_template: >-
{% if is_state('sensor.devices_with_low_battery', '0') %}
mdi:check-circle
{% else %}
mdi:battery-alert
{% endif %}

View File

@@ -0,0 +1,6 @@
- platform: template
sensors:
electricity_power_total:
friendly_name: "Electricity Power Total"
unit_of_measurement: "W"
value_template: "{{ states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_0') |float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_1') | float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_2') | float }}"

4
sensor/tautulli.yaml Normal file
View File

@@ -0,0 +1,4 @@
- platform: tautulli
api_key: !secret tautulli_api_key
host: !secret tautulli_api_host
port: !secret tautulli_api_port

6
sensor/tides.yaml Normal file
View File

@@ -0,0 +1,6 @@
- platform: niwa_tides
api_key: !secret niwa_tides_api_key
entity_id: "local_tides"
name: Local Tides
latitude: !secret latitude
longitude: !secret longitude