EVcharge Process WIP testing
This commit is contained in:
@@ -116,14 +116,16 @@
|
|||||||
input:
|
input:
|
||||||
light_target:
|
light_target:
|
||||||
entity_id: light.test_lamp1
|
entity_id: light.test_lamp1
|
||||||
- id: '1738428672069'
|
- id: '1738952270274'
|
||||||
alias: Test-EVcharge-process
|
alias: Test-EVcharge-process
|
||||||
description: ''
|
description: ''
|
||||||
use_blueprint:
|
use_blueprint:
|
||||||
path: homeassistant/evcharge-process.yaml
|
path: homeassistant/evcharge-process.yaml
|
||||||
input:
|
input:
|
||||||
evcharge_entity1: switch.evcharge_front
|
evcharge_entity1: switch.evcharge_front
|
||||||
|
evcharge_entity1_power: sensor.evcharge_front_power
|
||||||
evcharge_entity2: switch.evcharge_back
|
evcharge_entity2: switch.evcharge_back
|
||||||
|
evcharge_entity2_power: sensor.evcharge_back_power
|
||||||
use_entity1: input_boolean.evcharge_front_request
|
use_entity1: input_boolean.evcharge_front_request
|
||||||
use_entity2: input_boolean.evcharge_back_request
|
use_entity2: input_boolean.evcharge_back_request
|
||||||
start_button: input_button.evcharge_start
|
start_button: input_button.evcharge_start
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ blueprint:
|
|||||||
entity:
|
entity:
|
||||||
filter:
|
filter:
|
||||||
- domain: switch
|
- domain: switch
|
||||||
|
evcharge_entity1_power:
|
||||||
|
name: Charge via 'Controlled Plug1'
|
||||||
|
description: Identifies the Switch1 power entity (eg EVcharge-front-power)
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
- device_class: power
|
||||||
|
|
||||||
evcharge_entity2:
|
evcharge_entity2:
|
||||||
name: Charge via 'Controlled Plug2'
|
name: Charge via 'Controlled Plug2'
|
||||||
@@ -19,6 +26,14 @@ blueprint:
|
|||||||
entity:
|
entity:
|
||||||
filter:
|
filter:
|
||||||
- domain: switch
|
- domain: switch
|
||||||
|
evcharge_entity2_power:
|
||||||
|
name: Charge via 'Controlled Plug2'
|
||||||
|
description: Identifies the Switch1 power entity (eg EVcharge-back-power)
|
||||||
|
selector:
|
||||||
|
entity:
|
||||||
|
filter:
|
||||||
|
- device_class: power
|
||||||
|
|
||||||
use_entity1:
|
use_entity1:
|
||||||
name: Enable charge via 'Controlled Plug1'
|
name: Enable charge via 'Controlled Plug1'
|
||||||
description: Identifies the input flag for charging on 'Controlled Plug1' (eg EVcharge_front_request)
|
description: Identifies the input flag for charging on 'Controlled Plug1' (eg EVcharge_front_request)
|
||||||
@@ -59,8 +74,35 @@ 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
|
||||||
|
evcharge_entity1_power_var: !input evcharge_entity1_power
|
||||||
|
evcharge_entity2_power_var: !input evcharge_entity2
|
||||||
use_entity1_var: !input use_entity1
|
use_entity1_var: !input use_entity1
|
||||||
use_entity2_var: !input use_entity2
|
use_entity2_var: !input use_entity2
|
||||||
|
|
||||||
|
# tried to get entity for sensot.evcharge_front_power with jinja macro, macro working but using in automation is not
|
||||||
|
# terefore added more inputs and entity and entity powe must be assigned correctly otherwise the automation won't work
|
||||||
|
# jinja macro in config/custo_template/template_library.jinja
|
||||||
|
#
|
||||||
|
# Hereafter the macro for reference only:
|
||||||
|
#
|
||||||
|
# {% macro getpower_id(evcharge_id) %}
|
||||||
|
# {% set attrib_list = device_entities( device_id (evcharge_id ) ) %}
|
||||||
|
# {% for attrib in attrib_list %}
|
||||||
|
# {% if ( attrib | regex_search('power$')) %}
|
||||||
|
# {{ attrib }}
|
||||||
|
# {% endif %}
|
||||||
|
# {% endfor %}
|
||||||
|
# {% endmacro %}
|
||||||
|
|
||||||
|
# Hereafter the attemped usage as variable initialization
|
||||||
|
# evcharge_entity1_power_var: >-
|
||||||
|
# {% from 'template_library.jinja' import getpower_id %}
|
||||||
|
# {% getpower_id(evcharge_entity1_var) %}
|
||||||
|
# evcharge_entity2_power_var: >-
|
||||||
|
# {% from 'template_library.jinja' import getpower_id %}
|
||||||
|
# {% getpower_id(evcharge_entity2_var) %}
|
||||||
|
|
||||||
|
# here list of mobile APP to be notified
|
||||||
recipient_list:
|
recipient_list:
|
||||||
- notify.mobile_app_ttrabatt_iphone15
|
- notify.mobile_app_ttrabatt_iphone15
|
||||||
#- notify.mobile_app_emanuele_s24
|
#- notify.mobile_app_emanuele_s24
|
||||||
@@ -121,7 +163,7 @@ actions:
|
|||||||
- delay: 10
|
- delay: 10
|
||||||
|
|
||||||
- repeat:
|
- repeat:
|
||||||
# until: "{{ ( states( evcharge_entity1_var, 'power') | int ) < ( states('input_number.evcharge_no_charge_threshold') | int ) }}"
|
# until: "{{ ( states(evcharge_entity1_power_var) | int ) < ( states('input_number.evcharge_no_charge_threshold') | int ) }}"
|
||||||
until: "{{ ( states('input_number.test_evcharge_front') | int) < (states('input_number.evcharge_no_charge_threshold') | int) }}"
|
until: "{{ ( states('input_number.test_evcharge_front') | int) < (states('input_number.evcharge_no_charge_threshold') | int) }}"
|
||||||
sequence:
|
sequence:
|
||||||
- delay: 60
|
- delay: 60
|
||||||
@@ -175,7 +217,7 @@ actions:
|
|||||||
- delay: 10
|
- delay: 10
|
||||||
|
|
||||||
- repeat:
|
- repeat:
|
||||||
# until: "{{ state_attr( evcharge_entity2_var, 'power') < states('input_number.evcharge_no_charge_threshold') }}"
|
# until: "{{ ( states(evcharge_entity2_power_var) | int ) < ( states('input_number.evcharge_no_charge_threshold') | int) }}"
|
||||||
until: "{{ ( states('input_number.test_evcharge_back') | int) < ( states('input_number.evcharge_no_charge_threshold') | int) }}"
|
until: "{{ ( states('input_number.test_evcharge_back') | int) < ( states('input_number.evcharge_no_charge_threshold') | int) }}"
|
||||||
sequence:
|
sequence:
|
||||||
- delay: 60
|
- delay: 60
|
||||||
|
|||||||
9
custom_templates/template_library.jinja
Normal file
9
custom_templates/template_library.jinja
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{% macro getpower_id(evcharge_id) %}
|
||||||
|
{% set attrib_list = device_entities( device_id (evcharge_id ) ) %}
|
||||||
|
{% for attrib in attrib_list %}
|
||||||
|
{% if ( attrib | regex_search('power$')) %}
|
||||||
|
{{ attrib }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
Reference in New Issue
Block a user