From 30f4bbe1b4f991cc220b11726d8d2fc081639f2b Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Tue, 28 Mar 2017 15:51:07 +0000 Subject: [PATCH] Closes # 117 - Thanks @VDRainer for the awesome Log Level automation - Change log levels using an input_select! --- automation/System/log_levels.yaml | 13 +++++++++++++ configuration.yaml | 1 + input_select/log_level.yaml | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100755 automation/System/log_levels.yaml create mode 100755 input_select/log_level.yaml diff --git a/automation/System/log_levels.yaml b/automation/System/log_levels.yaml new file mode 100755 index 00000000..4d80fb88 --- /dev/null +++ b/automation/System/log_levels.yaml @@ -0,0 +1,13 @@ +################################### +## Dynamically set the log levels without having to restart HASS or edit configuration.yaml +#- Thanks @VDRainer +################################### + +- alias: Log Level + trigger: + platform: state + entity_id: input_select.log_level + action: + service: logger.set_level + data_template: + homeassistant.components: "{{ trigger.to_state.state }}" diff --git a/configuration.yaml b/configuration.yaml index d4942c5f..51093bd7 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -148,4 +148,5 @@ scene: !include_dir_merge_list scene switch: !include_dir_merge_list switch script: !include_dir_merge_named script input_boolean: !include_dir_merge_named input_boolean +input_select: !include_dir_merge_named input_select shell_command: !include_dir_merge_named shell_command diff --git a/input_select/log_level.yaml b/input_select/log_level.yaml new file mode 100755 index 00000000..e3746cfb --- /dev/null +++ b/input_select/log_level.yaml @@ -0,0 +1,12 @@ +log_level: + name: Log Level + options: + - critical + - fatal + - error + - warning + - warn + - info + - debug + - notset + initial: warn