Some Powerwall logic #547, #779

This commit is contained in:
ccostan 2020-06-30 14:28:05 -04:00
parent f50f3a126d
commit da330c6be4
4 changed files with 72 additions and 10 deletions

View File

@ -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

View File

@ -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'

View File

@ -54,8 +54,8 @@ class SearchCard extends ct.LitElement {
@value-changed="${this._valueChanged}"
no-label-float
label="Type to search...">
<iron-icon icon="mdi:magnify"
slot="prefix"></iron-icon>
<ha-icon icon="mdi:magnify" id="searchIcon"
slot="prefix"></ha-icon>
<paper-icon-button slot="suffix"
@click="${this._clearInput}"
icon="mdi:close"
@ -177,6 +177,9 @@ class SearchCard extends ct.LitElement {
margin-left: auto;
margin-right: auto;
}
#searchIcon {
padding: 10px;
}
`;
}
}