From da330c6be49963bd1cbd24eeebb149101ac4555d Mon Sep 17 00:00:00 2001 From: ccostan Date: Tue, 30 Jun 2020 14:28:05 -0400 Subject: [PATCH] Some Powerwall logic #547, #779 --- .../Timed_Triggers/sunset_turn_on.yaml | 5 ++ config/packages/powerwall.yaml | 70 ++++++++++++++++-- .../www/community/search-card/search-card.js | 7 +- .../community/search-card/search-card.js.gz | Bin 1801 -> 1815 bytes 4 files changed, 72 insertions(+), 10 deletions(-) diff --git a/config/automation/Timed_Triggers/sunset_turn_on.yaml b/config/automation/Timed_Triggers/sunset_turn_on.yaml index bca5bf16..73b784e1 100755 --- a/config/automation/Timed_Triggers/sunset_turn_on.yaml +++ b/config/automation/Timed_Triggers/sunset_turn_on.yaml @@ -9,6 +9,11 @@ - platform: sun event: sunset offset: "-00:20:00" + + condition: + - condition: template + value_template: "{{ states('sensor.grid_status') == 'True' }}" + action: - delay: '00:{{ (range(1, 20)|random|int) }}:00' - service: script.tweet_engine_image diff --git a/config/packages/powerwall.yaml b/config/packages/powerwall.yaml index d3f88ae2..178f150a 100755 --- a/config/packages/powerwall.yaml +++ b/config/packages/powerwall.yaml @@ -2,6 +2,7 @@ ### @Tesla Powerwall - https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html # # @CCOSTAN # Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +# Read more about this on https://www.vcloudinfo.com ###################################################################################################### sensor: @@ -64,11 +65,9 @@ sensor: # automation: - alias: Notify if Grid is down - trigger: - platform: state entity_id: sensor.grid_status - condition: condition: or conditions: @@ -76,7 +75,6 @@ automation: value_template: "{{ states('sensor.grid_status') == 'True' }}" - condition: template value_template: "{{ states('sensor.grid_status') == 'False' }}" - action: - service: script.notify_engine data_template: @@ -87,27 +85,83 @@ automation: # https://github.com/CCOSTAN/Home-AssistantConfig/issues/779 - alias: Shut Things down if running on PowerWall - trigger: - platform: state entity_id: sensor.grid_status from: 'True' to: 'False' - for: "00:01:00" - + for: + minutes: 1 condition: - condition: template value_template: "{{ states('sensor.grid_status') == 'False' }}" - action: - service: homeassistant.turn_off entity_id: - group.interior_lights - group.exterior_lights - - service: script.notify_engine data_template: title: "Electrical Grid Status {{ (trigger.to_state.state)|replace('True', 'up')|replace('False', 'down') }}." value1: "Taking actions to turning off the House Lights to preserve Battery Power." who: 'family' apns_id: 'information' + +# https://github.com/CCOSTAN/Home-AssistantConfig/issues/547 + - alias: Turn off the Nest Thermostats during a Power Outage + + trigger: + - platform: state + entity_id: sensor.grid_status + from: 'True' + to: 'False' + for: + minutes: 5 + + condition: + - condition: template + value_template: "{{ states('sensor.grid_status') == 'False' }}" + + action: + - service: climate.turn_off + data: + entity_id: + - climate.downstairs + - climate.upstairs + + - service: script.notify_engine + data_template: + title: "Electrical Grid Status {{ (trigger.to_state.state)|replace('True', 'up')|replace('False', 'down') }}." + value1: "Taking actions to turning off the AC units to preserve Battery Power." + who: 'family' + apns_id: 'information' + + - alias: Turn back on the Nest Thermostats after a Power Outage + + trigger: + - platform: state + entity_id: sensor.grid_status + from: 'False' + to: 'True' + for: + minutes: 5 + + condition: + - condition: template + value_template: "{{ states('sensor.grid_status') == 'True' }}" + - condition: or + conditions: + - condition: state + entity_id: climate.downstairs + state: 'off' + - condition: state + entity_id: climate.upstairs + state: 'off' + + action: + - service: climate.set_hvac_mode + data: + entity_id: + - climate.downstairs + - climate.upstairs + hvac_mode: 'auto' diff --git a/config/www/community/search-card/search-card.js b/config/www/community/search-card/search-card.js index 4a3b7dc9..3cf93a0c 100644 --- a/config/www/community/search-card/search-card.js +++ b/config/www/community/search-card/search-card.js @@ -54,8 +54,8 @@ class SearchCard extends ct.LitElement { @value-changed="${this._valueChanged}" no-label-float label="Type to search..."> - + 6ZfceC41%Xib+?O&fBKy}_hfP~;D!6JwVA0qc(&r9$+C1U9R*nRf=AOGs6{x* zw=|G2f5OuDaTqSO#irmg!~zes!w6{^P(NH1Zn;=U`J%I^LoUO5mxlKwi*Z08WKWQt z=vDFRTq3k$Ir3ymDa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