From 861f67d759e74fa98dd4d00fb440fa25da7a79a7 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Wed, 6 Apr 2022 15:05:15 -0400 Subject: [PATCH] Splitting up sensors because there are starting to be a lot of them --- configuration.yaml | 2 +- sensors/entertainment.yaml | 18 +++++++++ sensor.yaml => sensors/house_stats.yaml | 53 +------------------------ sensors/tasks.yaml | 22 ++++++++++ sensors/time.yaml | 11 +++++ 5 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 sensors/entertainment.yaml rename sensor.yaml => sensors/house_stats.yaml (55%) create mode 100644 sensors/tasks.yaml create mode 100644 sensors/time.yaml diff --git a/configuration.yaml b/configuration.yaml index 8beeb6a..c1d0c75 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -16,7 +16,7 @@ scene: camera: !include cameras.yaml input_boolean: !include input_boolean.yaml binary_sensor: !include binary_sensor.yaml -sensor: !include sensor.yaml +sensor: !include_dir_merge_list sensors switch: !include switches.yaml input_select: !include input_select.yaml input_text: !include input_text.yaml diff --git a/sensors/entertainment.yaml b/sensors/entertainment.yaml new file mode 100644 index 0000000..dd9c8e0 --- /dev/null +++ b/sensors/entertainment.yaml @@ -0,0 +1,18 @@ +- platform: twitch_helix + client_id: !secret twitch_client_id + client_secret: !secret twitch_client_secret + own_channel: ironnerd24 + thumbnail_dimensions: 320x180 + entity_prefix: Twitch_ + channels: + - ironnerd24 + - Xia_P988 + - ManaSen + - STPeach + - BroteinGaming404 + - NotoriosPenguin +- platform: plex_recently_added + name: Recently Added on Plex + token: !secret plex_token + host: 192.168.1.4 + port: 32400 \ No newline at end of file diff --git a/sensor.yaml b/sensors/house_stats.yaml similarity index 55% rename from sensor.yaml rename to sensors/house_stats.yaml index f17555c..647c9cc 100644 --- a/sensor.yaml +++ b/sensors/house_stats.yaml @@ -1,48 +1,3 @@ -- platform: twitch_helix - client_id: !secret twitch_client_id - client_secret: !secret twitch_client_secret - own_channel: ironnerd24 - thumbnail_dimensions: 320x180 - entity_prefix: Twitch_ - channels: - - ironnerd24 - - Xia_P988 - - ManaSen - - STPeach - - BroteinGaming404 - - NotoriosPenguin -- platform: rest - name: Household Tasks - method: GET - resource: 'https://api.todoist.com/sync/v8/projects/get_data' - params: - token: !secret todoist_api_token - project_id: 2285967928 - value_template: '{{value_json[''project''][''id'']}}' - json_attributes: - - items - scan_interval: 30 -- platform: rest - name: Kallen Tasks - method: GET - resource: 'https://api.todoist.com/sync/v8/projects/get_data' - params: - token: !secret todoist_api_token - project_id: 2285969005 - value_template: '{{value_json[''project''][''id'']}}' - json_attributes: - - items - scan_interval: 30 -- platform: season - type: astronomical - name: Current Season -- platform: uptime - name: Last Boot -- platform: plex_recently_added - name: Recently Added on Plex - token: !secret plex_token - host: 192.168.1.4 - port: 32400 - platform: template sensors: sensor_count: @@ -85,9 +40,5 @@ friendly_name: 'Number of NA Entities' value_template: >- {{ states | selectattr('state', 'eq', 'unavailable') | map(attribute='entity_id') | list | count }} - today_is: - friendly_name: 'Today is' - value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}" - month_is: - friendly_name: 'Month is' - value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}" \ No newline at end of file +- platform: uptime + name: Last Boot diff --git a/sensors/tasks.yaml b/sensors/tasks.yaml new file mode 100644 index 0000000..4e5adcf --- /dev/null +++ b/sensors/tasks.yaml @@ -0,0 +1,22 @@ +- platform: rest + name: Household Tasks + method: GET + resource: 'https://api.todoist.com/sync/v8/projects/get_data' + params: + token: !secret todoist_api_token + project_id: 2285967928 + value_template: '{{value_json[''project''][''id'']}}' + json_attributes: + - items + scan_interval: 30 +- platform: rest + name: Kallen Tasks + method: GET + resource: 'https://api.todoist.com/sync/v8/projects/get_data' + params: + token: !secret todoist_api_token + project_id: 2285969005 + value_template: '{{value_json[''project''][''id'']}}' + json_attributes: + - items + scan_interval: 30 diff --git a/sensors/time.yaml b/sensors/time.yaml new file mode 100644 index 0000000..36a4793 --- /dev/null +++ b/sensors/time.yaml @@ -0,0 +1,11 @@ +- platform: season + type: astronomical + name: Current Season +- platform: template + sensors: + today_is: + friendly_name: 'Today is' + value_template: "{{ ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'][now().weekday()] }}" + month_is: + friendly_name: 'Month is' + value_template: "{{ ['January','February','March','April','May','June','August','September','October','November','December'][now().month-1] }}" \ No newline at end of file