From b447aaff9a32c67e2543dde32f7151fbc54b6793 Mon Sep 17 00:00:00 2001 From: ccostan Date: Mon, 26 Jul 2021 16:16:49 -0400 Subject: [PATCH] Closes # 1085 - With Trigger IDs. --- config/automation/Timed_Triggers/wake_up.yaml | 1 + config/automation/good_night.yaml | 30 ++++++++++++++++++ config/packages/epson_printer.yaml | 5 --- config/packages/holiday.yaml | 8 ++--- config/packages/processmonitor.yaml | 6 ---- .../www/community/search-card/search-card.js | 23 ++++++++++++-- .../community/search-card/search-card.js.gz | Bin 1850 -> 1984 bytes 7 files changed, 53 insertions(+), 20 deletions(-) diff --git a/config/automation/Timed_Triggers/wake_up.yaml b/config/automation/Timed_Triggers/wake_up.yaml index 1cf86142..6b46c49d 100755 --- a/config/automation/Timed_Triggers/wake_up.yaml +++ b/config/automation/Timed_Triggers/wake_up.yaml @@ -8,6 +8,7 @@ - platform: state entity_id: group.bed to: 'off' + for: "00:05:00" condition: - condition: state diff --git a/config/automation/good_night.yaml b/config/automation/good_night.yaml index e291881e..b4cac900 100755 --- a/config/automation/good_night.yaml +++ b/config/automation/good_night.yaml @@ -51,3 +51,33 @@ - service: homeassistant.turn_off entity_id: group.landscaping + +- alias: 'Bed Presence AMP Trigger' + id: 26846f7b-bc76-43d2-99be-af552d2300f + trigger: + - platform: state + entity_id: + - binary_sensor.sleepnumber_carlo_carlo_is_in_bed + - binary_sensor.sleepnumber_carlo_stacey_is_in_bed + to: 'on' + id: "in_bed" + - platform: state + entity_id: + - binary_sensor.sleepnumber_carlo_carlo_is_in_bed + - binary_sensor.sleepnumber_carlo_stacey_is_in_bed + to: 'off' + id: "out_of_bed" + + action: + choose: + - alias: "Some One in Bed" + conditions: " {{ trigger.id == 'in_bed'}} " + sequence: + - service: homeassistant.turn_off + target: + entity_id: switch.lr_amp + + default: + - service: homeassistant.turn_on + target: + entity_id: switch.lr_amp diff --git a/config/packages/epson_printer.yaml b/config/packages/epson_printer.yaml index 5c344c05..62958767 100755 --- a/config/packages/epson_printer.yaml +++ b/config/packages/epson_printer.yaml @@ -26,11 +26,6 @@ automation: weekday: - wed action: - - service: persistent_notification.create - data: - title: Low Ink - message: "{{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }} " - notification_id: low-battery-alert - service: script.notify_engine data: value1: "{{ trigger.to_state.attributes.friendly_name }} is at {{ trigger.to_state.state }} " diff --git a/config/packages/holiday.yaml b/config/packages/holiday.yaml index 5fa73878..09ad512e 100755 --- a/config/packages/holiday.yaml +++ b/config/packages/holiday.yaml @@ -16,11 +16,11 @@ homeassistant: customize: sensor.holiday: - + icon: mdi:beach friendly_name: US Holiday sensor.flag: - + icon: mdi:flag friendly_name: Flag Day @@ -153,10 +153,6 @@ automation: - condition: template value_template: "{{ states.sensor.holiday.state | trim != '' }}" action: - - service: persistent_notification.create - data: - message: 'Today is {{ states.sensor.holiday.state }}.' - title: '{{ states.sensor.holiday.state }}' - delay: '0{{ (range(4, 8)|random|int) }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}' - service: script.tweet_engine_image diff --git a/config/packages/processmonitor.yaml b/config/packages/processmonitor.yaml index 4e1f2bea..9efee847 100755 --- a/config/packages/processmonitor.yaml +++ b/config/packages/processmonitor.yaml @@ -50,9 +50,3 @@ automation: value1: 'Hard Drive Monitor:' value2: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_percent.state }}%!" who: 'carlo' - - - service: persistent_notification.create - data: - title: "Hard Drive Monitor:" - message: "Your harddrive is running out of Space! /dev/root:{{ states.sensor.disk_use_percent.state }}%!" - notification_id: "Critical Alert" diff --git a/config/www/community/search-card/search-card.js b/config/www/community/search-card/search-card.js index a556d276..7ee1c8f1 100644 --- a/config/www/community/search-card/search-card.js +++ b/config/www/community/search-card/search-card.js @@ -39,6 +39,9 @@ class SearchCard extends ct.LitElement { this.search_text = this.config.search_text || "Type to search..."; this.actions = BUILTIN_ACTIONS.concat(this.config.actions || []); + + this.included_domains = this.config.included_domains; + this.excluded_domains = this.config.excluded_domains || []; } getCardSize() { @@ -122,16 +125,22 @@ class SearchCard extends ct.LitElement { var searchRegex = new RegExp(searchText, 'i'); for (var entity_id in this.hass.states) { if ( - (entity_id.search(searchRegex) >= 0) || ( - "friendly_name" in this.hass.states[entity_id].attributes && - this.hass.states[entity_id].attributes.friendly_name.search(searchRegex) >= 0 + entity_id.search(searchRegex) >= 0 || + this.hass.states[entity_id].attributes.friendly_name?.search(searchRegex) >= 0 + ) + && + ( + this.included_domains + ? this.included_domains.includes(entity_id.split(".")[0]) + : !this.excluded_domains.includes(entity_id.split(".")[0]) ) ) { this.results.push(entity_id); } } } catch (err) { + console.warn(err); } this.active_actions = this._getActivatedActions(searchText); @@ -196,3 +205,11 @@ setTimeout(() => { setConfig() { throw new Error("Can't find card-tools. See https://github.com/thomasloven/lovelace-card-tools");} }); }, 2000); + +window.customCards = window.customCards || []; +window.customCards.push({ + type: "search-card", + name: "Search Card", + preview: true, + description: "Card to search entities" +}); diff --git a/config/www/community/search-card/search-card.js.gz b/config/www/community/search-card/search-card.js.gz index 119c4bab8cd67a2cda4bc82e955e96f27c76a614..497e134a101238993a845640836b08d98d25017e 100644 GIT binary patch literal 1984 zcmV;x2S4~9iwFo3_x@l4|8r$wa${&MV_|Y+E^2cComg9w(>4@-&#w@MV!I^X&}ko< zkfji|!_H7TvztDpY0%nAtiiTCmU7uH{_j1y*pi)Hmcj#BOXse0`J{Nq1Ofg}X~axCJM@Cow&34$DN3nC`bkKvaf`tk2bu&M&t@Etz$ zhl;+yIRWA~NrD7JiwYM!r<_w(7y=49fgn%lq^#JsBAkyBb|^B26GOsDwWqNZBOLw+ zC&}7q>=LdMEbzn_jF6!L_Pdw0uNG@bUk_HT%gU`cMRG;T495gq4g@)hVdJlfB|;lk zp+JU|0?l{|Kd%~^C?myIq_FnlMQF53AwVd9qDspS{5v1L0LB-{ul-iTlCIzcq*Vx2 zMC__UaZLv`*qC9?(KW$UoX+9I5Nwb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