EVcharge Process WIP cont
This commit is contained in:
@@ -59,83 +59,154 @@ conditions: []
|
|||||||
variables:
|
variables:
|
||||||
evcharge_entity1_var: !input evcharge_entity1
|
evcharge_entity1_var: !input evcharge_entity1
|
||||||
evcharge_entity2_var: !input evcharge_entity2
|
evcharge_entity2_var: !input evcharge_entity2
|
||||||
|
use_entity1_var: !input use_entity1
|
||||||
|
use_entity2_var: !input use_entity2
|
||||||
|
recipient_list:
|
||||||
|
- notify.mobile_app_ttrabatt_iphone15
|
||||||
|
#- notify.mobile_app_emanuele_s24
|
||||||
|
|
||||||
actions:
|
actions:
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15
|
- if:
|
||||||
metadata: {}
|
- or:
|
||||||
data:
|
- condition: template
|
||||||
message: >-
|
#value_template: "{{ is_state(evcharge_entity1_var, 'on') }}"
|
||||||
"EVcharge process on {{ evcharge_entity1_var }} has started"
|
# TEST ONLY: value_template: "{{ false }}"
|
||||||
title: EV Charge process
|
value_template: "{{ false }}"
|
||||||
|
- condition: template
|
||||||
|
#value_template: "{{ is_state(evcharge_entity2_var, 'on') }}"
|
||||||
|
# TEST ONLY: value_template: "{{ false }}"
|
||||||
|
value_template: "{{ false }}"
|
||||||
|
then:
|
||||||
|
# charge already active, send message and terminate
|
||||||
|
repeat:
|
||||||
|
for_each: "{{ recipient_list }}"
|
||||||
|
|
||||||
# switch of all plugs
|
sequence:
|
||||||
- action: switch.turn_off
|
- action: "{{ repeat.item }}"
|
||||||
# entity_id: !input evcharge_entity1
|
metadata: {}
|
||||||
entity_id: switch.presa_smart_1
|
data:
|
||||||
- delay: 10
|
message: >-
|
||||||
- action: switch.turn_off
|
"EVcharge process is ALREADY RUNNING"
|
||||||
# entity_id: !input evcharge_entity2
|
title: EV Charge process ERROR
|
||||||
entity_id: switch.presa_smart_2
|
else:
|
||||||
|
|
||||||
# Start plug1 and wait until power measured is below input_number.evcharge_no_charge_threshold for 10 minutes = 600 seconds
|
|
||||||
- action: switch.turn_on
|
|
||||||
# entity_id: !input evcharge_entity1
|
|
||||||
entity_id: switch.presa_smart_1
|
|
||||||
|
|
||||||
# need to wait car to start charging
|
|
||||||
#- delay: 60
|
|
||||||
- delay: 10
|
|
||||||
|
|
||||||
- repeat:
|
|
||||||
# until: "{{ state_attr( evcharge_entity1_var, 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
|
||||||
until: "{{ state_attr('sensor.evcharge_front', 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
|
||||||
sequence:
|
sequence:
|
||||||
- delay: 60
|
- if:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ is_state(use_entity1_var, 'on') }}"
|
||||||
|
then: # EVcharge entity_1 (eg front) charge is requested
|
||||||
|
sequence:
|
||||||
|
- repeat: # send message to all recipient-list members
|
||||||
|
for_each: "{{ recipient_list }}"
|
||||||
|
|
||||||
- action: switch.turn_off
|
sequence:
|
||||||
# entity_id: !input evcharge_entity1
|
- action: "{{ repeat.item }}"
|
||||||
entity_id: switch.presa_smart_1
|
metadata: {}
|
||||||
|
data:
|
||||||
|
message: >-
|
||||||
|
"EVcharge process on {{ evcharge_entity1_var }} has started"
|
||||||
|
title: EV Charge process
|
||||||
|
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15
|
# Wait before starting charge
|
||||||
metadata: {}
|
- delay: 10
|
||||||
data:
|
|
||||||
message: >-
|
|
||||||
"EVcharge process on {{ evcharge_entity1_var }} has ended"
|
|
||||||
title: EV Charge process
|
|
||||||
|
|
||||||
# wait couple of minutes before starting charge on plug2
|
# Start plug1 and wait until power measured is below input_number.evcharge_no_charge_threshold for 10 minutes = 600 seconds
|
||||||
#- delay: 120
|
- action: switch.turn_on
|
||||||
- delay: 10
|
# entity_id: !input evcharge_entity1
|
||||||
|
# TEST ONLY: entity_id: switch.presa_smart_1
|
||||||
|
entity_id: switch.presa_smart_1
|
||||||
|
|
||||||
# then start plug2 and wait until power measured is below input_number.evcharge_no_charge_threshold for 10 minutes = 600 seconds
|
# need to wait car to start charging
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15
|
#- delay: 60
|
||||||
metadata: {}
|
# TEST ONLY: - delay: 10
|
||||||
data:
|
- delay: 10
|
||||||
message: >-
|
|
||||||
"EVcharge process on {{ evcharge_entity2_var }} has started"
|
|
||||||
title: EV Charge process
|
|
||||||
|
|
||||||
- action: switch.turn_on
|
- repeat:
|
||||||
# entity_id: !input evcharge_entity1
|
# until: "{{ ( states( evcharge_entity1_var, 'power') | int ) < ( states('input_number.evcharge_no_charge_threshold') | int ) }}"
|
||||||
entity_id: switch.presa_smart_2
|
until: "{{ ( states('input_number.test_evcharge_front') | int) < (states('input_number.evcharge_no_charge_threshold') | int) }}"
|
||||||
|
sequence:
|
||||||
|
- delay: 60
|
||||||
|
|
||||||
# need to wait car to start charging
|
- action: switch.turn_off
|
||||||
#- delay: 60
|
# entity_id: !input evcharge_entity1
|
||||||
- delay: 10
|
# TEST ONLY: entity_id: switch.presa_smart_1
|
||||||
|
entity_id: switch.presa_smart_1
|
||||||
|
|
||||||
- repeat:
|
- repeat:
|
||||||
# until: "{{ state_attr( evcharge_entity2_var, 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
for_each: "{{ recipient_list }}"
|
||||||
until: "{{ state_attr('sensor.evcharge_back', 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
|
||||||
sequence:
|
|
||||||
- delay: 60
|
|
||||||
|
|
||||||
- action: switch.turn_off
|
sequence:
|
||||||
# entity_id: !input evcharge_entity2
|
- action: "{{ repeat.item }}"
|
||||||
entity_id: switch.presa_smart_2
|
metadata: {}
|
||||||
|
data:
|
||||||
|
message: >-
|
||||||
|
"EVcharge process on {{ evcharge_entity1_var }} has ended"
|
||||||
|
title: EV Charge process
|
||||||
|
|
||||||
- action: notify.mobile_app_ttrabatt_iphone15
|
# wait couple of minutes before starting charge on plug2
|
||||||
metadata: {}
|
#- delay: 120
|
||||||
data:
|
# TEST ONLY: - delay: 10
|
||||||
message: >-
|
- delay: 10
|
||||||
"EVcharge process on {{ evcharge_entity2_var }} has ended"
|
- if:
|
||||||
title: EV Charge process
|
- condition: template
|
||||||
|
value_template: "{{ is_state(use_entity2_var, 'on') }}"
|
||||||
|
then:
|
||||||
|
sequence:
|
||||||
|
# then start plug2 and wait until power measured is below input_number.evcharge_no_charge_threshold for 10 minutes = 600 seconds
|
||||||
|
- repeat: # send message to all recipient-list members
|
||||||
|
for_each: "{{ recipient_list }}"
|
||||||
|
|
||||||
|
sequence:
|
||||||
|
- action: "{{ repeat.item }}"
|
||||||
|
metadata: {}
|
||||||
|
data:
|
||||||
|
message: >-
|
||||||
|
"EVcharge process on {{ evcharge_entity2_var }} has started"
|
||||||
|
title: EV Charge process
|
||||||
|
|
||||||
|
# turn_on evcharge_entity1
|
||||||
|
- action: switch.turn_on
|
||||||
|
# entity_id: !input evcharge_entity1
|
||||||
|
# TEST ONLY: entity_id: switch.presa_smart_2
|
||||||
|
entity_id: switch.presa_smart_2
|
||||||
|
|
||||||
|
# need to wait car to start charging
|
||||||
|
#- delay: 120
|
||||||
|
# TEST ONLY: - delay: 10
|
||||||
|
- delay: 10
|
||||||
|
|
||||||
|
- repeat:
|
||||||
|
# until: "{{ state_attr( evcharge_entity2_var, 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
||||||
|
until: "{{ ( states('input_number.test_evcharge_back') | int) < ( states('input_number.evcharge_no_charge_threshold') | int) }}"
|
||||||
|
sequence:
|
||||||
|
- delay: 60
|
||||||
|
|
||||||
|
- action: switch.turn_off
|
||||||
|
# entity_id: !input evcharge_entity2
|
||||||
|
# TEST ONLY: entity_id: switch.presa_smart_2
|
||||||
|
entity_id: switch.presa_smart_2
|
||||||
|
|
||||||
|
- repeat: # send message to all recipient-list member
|
||||||
|
for_each: "{{ recipient_list }}"
|
||||||
|
|
||||||
|
sequence:
|
||||||
|
- action: "{{ repeat.item }}"
|
||||||
|
metadata: {}
|
||||||
|
data:
|
||||||
|
message: >-
|
||||||
|
"EVcharge process on {{ evcharge_entity2_var }} has ended"
|
||||||
|
title: EV Charge process
|
||||||
|
|
||||||
|
- if:
|
||||||
|
- and:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ is_state(use_entity1_var, 'off') }}"
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ is_state(use_entity2_var, 'off') }}"
|
||||||
|
then:
|
||||||
|
sequence:
|
||||||
|
- action: notify.mobile_app_ttrabatt_iphone15
|
||||||
|
metadata: {}
|
||||||
|
data:
|
||||||
|
message: >-
|
||||||
|
"EVcharge process activation ERROR, select what to charge"
|
||||||
|
title: EV Charge process ERROR
|
||||||
|
|||||||
Reference in New Issue
Block a user