@ -12,7 +12,7 @@
# Notes: Read more https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html | Existing Issue #272
# Notes: Read more https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html | Existing Issue #272
# Tesla Powerwall added via UI Integration
# Tesla Powerwall added via UI Integration
# Notes: Live outage tracking derives its chronometer anchor from binary_sensor.powerwall_grid_status.last_changed.
# Notes: Live outage tracking derives its chronometer anchor from binary_sensor.powerwall_grid_status.last_changed.
# Notes: Camera PoE restore requires grid online and Powerwall charge at least 50%.
# Notes: Docker host and camera PoE restore requires grid online for 10 minutes and Powerwall charge at least 50%.
######################################################################
######################################################################
# Binary Sensors:
# Binary Sensors:
# - binary_sensor.powerwall_charging ............. battery_charging (on=charging)
# - binary_sensor.powerwall_charging ............. battery_charging (on=charging)
@ -300,7 +300,18 @@ automation:
below : 75
below : 75
for:
for:
minutes : 3
minutes : 3
condition:
- condition : template
value_template : "{{ is_state('binary_sensor.powerwall_grid_status', 'off') }}"
- condition : numeric_state
entity_id : sensor.powerwall_charge
above : 0
below : 75
action:
action:
- service : script.send_to_logbook
data:
topic : "POWER"
message : "Powerwall outage load-shed started at {{ states('sensor.powerwall_charge') }}% charge."
- service : button.press
- service : button.press
target:
target:
entity_id:
entity_id:
@ -374,44 +385,59 @@ automation:
data:
data:
state : heat_pump
state : heat_pump
- alias : "Restore PoE ports when grid returns"
- alias : "Restore Docker hosts and camera PoE when grid returns"
id : 1ae8b5c5-8627-4a44-8c8a-5bf8ca5e1bf5
id : 1ae8b5c5-8627-4a44-8c8a-5bf8ca5e1bf5
description : " T urn camera PoE ports back on after grid has returned and battery is at least 50%"
description : " Start Docker hosts and t urn camera PoE ports back on after grid has returned and battery is at least 50%"
mode : single
mode : single
trigger:
trigger:
- platform : state
- platform : template
entity_id : binary_sensor.powerwall_grid_status
value_template : "{{ is_state('binary_sensor.powerwall_grid_status', 'on') }}"
from : 'off'
to : 'on'
for:
for:
minutes : 6 0
minutes : 10
- platform : numeric_state
- platform : numeric_state
entity_id : sensor.powerwall_charge
entity_id : sensor.powerwall_charge
above : 49.9
above : 49.9
condition:
condition:
- condition : or
conditions:
- condition : state
entity_id : switch.poe_garage_port_3_poe
state : 'off'
- condition : state
entity_id : switch.poe_garage_port_4_poe
state : 'off'
- condition : state
entity_id : switch.poe_garage_port_5_poe
state : 'off'
- condition : state
entity_id : switch.poe_garage_port_6_poe
state : 'off'
- condition : state
- condition : state
entity_id : binary_sensor.powerwall_grid_status
entity_id : binary_sensor.powerwall_grid_status
state : 'on'
state : 'on'
for:
minutes : 10
- condition : numeric_state
- condition : numeric_state
entity_id : sensor.powerwall_charge
entity_id : sensor.powerwall_charge
above : 49.9
above : 49.9
- condition : template
value_template : >-
{{ not is_state('binary_sensor.qemu_docker2_101_status', 'on')
or not is_state('binary_sensor.qemu_docker69_169_status', 'on')
or not is_state('switch.poe_garage_port_3_poe', 'on')
or not is_state('switch.poe_garage_port_4_poe', 'on')
or not is_state('switch.poe_garage_port_5_poe', 'on')
or not is_state('switch.poe_garage_port_6_poe', 'on') }}
action:
action:
- service : script.send_to_logbook
data:
topic : "POWER"
message : "Grid has been online for 10 minutes at {{ states('sensor.powerwall_charge') }}% charge. Restoring Docker hosts and camera PoE."
- if:
- condition : template
value_template : "{{ not is_state('binary_sensor.qemu_docker2_101_status', 'on') }}"
then:
- service : button.press
continue_on_error : true
target:
entity_id : button.qemu_docker2_101_start
- if:
- condition : template
value_template : "{{ not is_state('binary_sensor.qemu_docker69_169_status', 'on') }}"
then:
- service : button.press
continue_on_error : true
target:
entity_id : button.qemu_docker69_169_start
- service : switch.turn_on
- service : switch.turn_on
continue_on_error : true
target:
target:
entity_id:
entity_id:
- switch.poe_garage_port_3_poe
- switch.poe_garage_port_3_poe
@ -420,8 +446,8 @@ automation:
- switch.poe_garage_port_6_poe
- switch.poe_garage_port_6_poe
- service : script.notify_engine
- service : script.notify_engine
data:
data:
title : "Grid restored - PoE ports re-enabl ed"
title : "Grid restored - environment recovery start ed"
value1 : "Grid is online and Powerwall charge is at least 50%. C amera PoE ports 3-6 were turned back on automatically."
value1 : "Grid is online and Powerwall charge is at least 50%. Docker hosts 101/169 were started if needed, and c amera PoE ports 3-6 were turned back on automatically."
who : 'family'
who : 'family'
group : 'information'
group : 'information'