diff --git a/automations.yaml b/automations.yaml index 4744dc0..8d67559 100644 --- a/automations.yaml +++ b/automations.yaml @@ -160,6 +160,26 @@ domain: mobile_app type: notify message: Qualcuno ha suonato al Cancelletto usa Home Assistant + - device_id: f0ad21f704179a15735313abaa4bd548 + domain: mobile_app + type: notify + message: Qualcuno ha suonato al Cancelletto usa Home Assistant + enabled: false + - device_id: 46e6c7b252a23f498de8602ca380d0a9 + domain: mobile_app + type: notify + message: Qualcuno ha suonato al Cancelletto usa Home Assistant + enabled: true + - device_id: 163daed9ae6074cfa3a10b866ab5d2e0 + domain: mobile_app + type: notify + message: Qualcuno ha suonato al Cancelletto usa Home Assistant + enabled: false + - device_id: 8836f21983cdb6b245d3be58d7acd7d7 + domain: mobile_app + type: notify + message: Qualcuno ha suonato al Cancelletto usa Home Assistant + enabled: false mode: single - id: '1756127648616' alias: Luce Automatica Scala Taverna @@ -230,3 +250,41 @@ charged_entity1: input_number.evcharge_front_charged charged_entity2: input_number.evcharge_back_charged stop_button: input_button.evcharge_pro_stop +- id: '1758560143754' + alias: Cancelletto-on + description: '' + triggers: + - type: turned_on + device_id: 3c1785ee92ef67b2536571f4e318db84 + entity_id: 34480c273e9378e8582a881acd4a7871 + domain: binary_sensor + trigger: device + conditions: [] + actions: + - action: input_boolean.turn_on + metadata: {} + data: {} + target: + entity_id: input_boolean.cancelletto_video_duration + mode: single +- id: '1758560334981' + alias: Cancelletto-off + description: '' + triggers: + - type: turned_off + device_id: 3c1785ee92ef67b2536571f4e318db84 + entity_id: 34480c273e9378e8582a881acd4a7871 + domain: binary_sensor + trigger: device + for: + hours: 0 + minutes: 1 + seconds: 0 + conditions: [] + actions: + - action: input_boolean.turn_off + metadata: {} + data: {} + target: + entity_id: input_boolean.cancelletto_video_duration + mode: single diff --git a/blueprints/automation/homeassistant/evcharge_process_pro.yaml b/blueprints/automation/homeassistant/evcharge_process_pro.yaml index 1c25106..4deba38 100644 --- a/blueprints/automation/homeassistant/evcharge_process_pro.yaml +++ b/blueprints/automation/homeassistant/evcharge_process_pro.yaml @@ -96,6 +96,8 @@ variables: use_entity1_var: !input use_entity1 use_entity2_var: !input use_entity2 + charged_entity1_var: !input charged_entity1 + charged_entity2_var: !input charged_entity2 # here list of mobile APP to be notified recipient_list_notification: @@ -164,6 +166,12 @@ actions: - variables: energy1_before: "{{ states(evcharge_entity1_energy_var) | float | round(2) }}" + - action: input_number.set_value + target: + entity_id: "{{ charged_entity1_var }}" + data: + value: 0.00 + # 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 @@ -187,12 +195,13 @@ actions: energy1_while: "{{ states(evcharge_entity1_energy_var) }}" evcharge_entity1_energy_charged: "{{ ((energy1_while | float| round(2)) - energy1_before )| float | round(2) }}" - - action: homeassistant.update_entity + - action: input_number.set_value + target: + entity_id: "{{ charged_entity1_var }}" data: - entity_id: "input_number.evcharge_front_charged" - state: "{{ evcharge_entity1_energy_charged }}" + value: "{{ evcharge_entity1_energy_charged }}" - - delay: 120 + - delay: 30 # - delay: 10 # TEST ONLY # take energy counter after charging @@ -226,8 +235,8 @@ actions: "EVcharge process on {{ evcharge_entity1_var }} has ended: {{ ( energy1_after - energy1_before ) | round(2) }} kW/h charged" # wait couple of minutes before starting charge on plug2 - # - delay: 120 - - delay: 10 # TEST ONLY + - delay: 120 + # - delay: 10 # TEST ONLY - if: - condition: template value_template: "{{ is_state(use_entity2_var, 'on') }}" @@ -254,6 +263,12 @@ actions: - variables: energy2_before: "{{ states(evcharge_entity2_energy_var) | float | round(2) }}" + - action: input_number.set_value + target: + entity_id: "{{ charged_entity2_var }}" + data: + value: 0.00 + # turn_on evcharge_entity2 - action: switch.turn_on entity_id: !input evcharge_entity2 @@ -274,14 +289,15 @@ actions: sequence: - variables: energy2_while: "{{ states(evcharge_entity2_energy_var) }}" - evcharge_entity1_energy_charged: "{{ ((energy2_while | float| round(2)) - energy2_before )| float | round(2) }}" + evcharge_entity2_energy_charged: "{{ ((energy2_while | float| round(2)) - energy2_before )| float | round(2) }}" - - action: homeassistant.update_entity + - action: input_number.set_value + target: + entity_id: "{{ charged_entity2_var }}" data: - entity_id: "input_number.evcharge_back_charged" - state: "{{ evcharge_entity2_energy_charged }}" + value: "{{ evcharge_entity2_energy_charged }}" - - delay: 120 + - delay: 30 # - delay: 10 # TEST ONLY # take energy counter after charging