Skip to content

Commit

Permalink
Changed plug entity ID for the fridge freezer.
Browse files Browse the repository at this point in the history
Automated the plug a bit to cater for Ecoflow not respecting the battery reserve setting.
  • Loading branch information
dannytsang committed May 1, 2024
1 parent 9b0aa47 commit f3e56be
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 77 deletions.
247 changes: 180 additions & 67 deletions packages/integrations/energy/ecoflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,26 +126,6 @@ automation:
- parallel:
- service: script.ecoflow_check_charging_mode
data: {}
- alias: Check if fridge freezer plug has been switched off
if:
- condition: state
entity_id: switch.fridge_freezer
state: "off"
then:
- service: script.send_direct_notification
data:
message: >-
Fridge freezer plug has been switched off!
Electricity unit rate is the same or below export rate
({{ states('sensor.electricity_current_rate') ~'<=' ~
states('sensor.electricity_export_current_rate') }}).
title: EcoFlow
people:
entity_id:
- person.danny
- person.terina
mode: single
# Battery level
- id: "1695566530591"
Expand All @@ -154,20 +134,50 @@ automation:
trigger:
- platform: numeric_state
entity_id: sensor.kitchen_ecoflow_battery_level
below: "6"
below: "11"
condition:
- condition: state
entity_id: switch.fridge_freezer
entity_id: switch.ecoflow_kitchen_plug
state: "off"
action:
- service: script.send_direct_notification
data:
message: Fridge Freezer switch is off.
title: EcoFlow
people:
entity_id:
- person.danny
- person.terina
- parallel:
- service: script.send_direct_notification
data:
message: Fridge Freezer switch is off.
title: EcoFlow
people:
entity_id:
- person.danny
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
mode: single
# Ecoflow
- id: "1714563193661"
alias: "EcoFlow: Battery Ultra Low And Plug Is Off"
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.kitchen_ecoflow_battery_level
below: 6
condition:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "off"
action:
- parallel:
- service: script.send_direct_notification
metadata: {}
data:
message: Ecoflow battery is ultra low and unable to turn the plug on.
title: ":cook: Kitchen"
people:
entity_id:
- person.danny
- person.terina
mode: single

script:
Expand Down Expand Up @@ -338,21 +348,38 @@ script:
value_template: >-
{{ target_charge_rate|int(0) > 0 and target_charge_rate != states('number.ecoflow_kitchen_ac_charging_power')|int(0) }}
sequence:
- parallel:
- if:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "off"
then:
- parallel:
- service: script.send_to_home_log
data:
message: >-
Solar production is above household consumption. Turning plug on and setting backup to 100% with
charge rate {{ target_charge_rate }}w.
title: EcoFlow
log_level: "Debug"
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
else:
- service: script.send_to_home_log
data:
message: >-
Solar production is above household consumption. Setting backup to 100% with
charge rate {{ target_charge_rate }}w.
title: EcoFlow
log_level: "Debug"
- sequence:
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: "{{ target_charge_rate }}"
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: "{{ target_charge_rate }}"
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
default:
- service: script.send_to_home_log
data:
Expand All @@ -375,19 +402,40 @@ script:
entity_id: sensor.growatt_sph_inverter_mode
state: Grid first
sequence:
- parallel:
- alias: Check if fridge freezer plug has been switched off
if:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "on"
- condition: numeric_state
entity_id: sensor.kitchen_ecoflow_battery_level
above: "5"
then:
- parallel:
- service: script.send_to_home_log
data:
message: >-
Inverter in export mode. Disable charging.
title: EcoFlow
log_level: "Debug"
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
else:
- service: script.send_to_home_log
data:
message: >-
Inverter in export mode. Disable charging.
title: EcoFlow
log_level: "Debug"
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: "{{ states('input_number.ecoflow_kitchen_low_battery_reserve') }}"
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 200
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: "{{ states('input_number.ecoflow_kitchen_low_battery_reserve') }}"
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 200
- alias: Electricity rate below 0p/kw
conditions:
- condition: state
Expand All @@ -400,20 +448,41 @@ script:
entity_id: sensor.electricity_current_rate
below: "0"
sequence:
- parallel:
- alias: Check if fridge freezer plug has been switched off
if:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "off"
then:
- parallel:
- service: script.send_to_home_log
data:
message: >-
Electrictity rate is below 0p/kw ({{ states('sensor.electricity_current_rate', with_unit=True)}}).
Setting backup reserve to 100% and maximum charge rate (1200w).
Turning Fridge Freezer plug.
title: EcoFlow
log_level: "Debug"
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
else:
- service: script.send_to_home_log
data:
message: >-
Electrictity rate is below 0p/kw ({{ states('sensor.electricity_current_rate', with_unit=True)}}).
Setting backup reserve to 100% and maximum charge rate (1200w).
title: EcoFlow
log_level: "Debug"
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 1200
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 1200
- alias: Electricity rate 0p/kw
conditions:
- condition: state
Expand All @@ -426,20 +495,41 @@ script:
entity_id: sensor.electricity_current_rate
state: "0.0"
sequence:
- parallel:
- alias: Check if fridge freezer plug has been switched off
if:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "off"
then:
- parallel:
- service: script.send_to_home_log
data:
message: >-
Electrictity rate is 0p/kw ({{ states('sensor.electricity_current_rate', with_unit=True)}}).
Setting backup reserve to 100% and maximum charge rate (1200w).
Turning Fridge Freezer plug.
title: EcoFlow
log_level: "Debug"
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
else:
- service: script.send_to_home_log
data:
message: >-
Electrictity rate is 0p/kw ({{ states('sensor.electricity_current_rate', with_unit=True)}}).
Setting backup reserve to 100% and maximum charge rate (1200w).
title: EcoFlow
log_level: "Debug"
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 1200
- service: script.ecoflow_set_backup_reserve
data:
reserve_amount: 100
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 1200
- alias: No Excess Solar
conditions:
- or:
Expand Down Expand Up @@ -522,14 +612,37 @@ script:
entity_id: number.ecoflow_kitchen_backup_reserve_level
below: 100
then:
- service: script.send_to_home_log
data:
message: >-
Electricity unit rate is the same or below export rate
({{ states('sensor.electricity_current_rate') ~'<=' ~
states('sensor.electricity_export_current_rate') }}). Charging kitchen Ecoflow.
title: EcoFlow
log_level: "Debug"
- alias: Check if fridge freezer plug has been switched off
if:
- condition: state
entity_id: switch.ecoflow_kitchen_plug
state: "off"
then:
- parallel:
- service: script.send_to_home_log
data:
message: >-
Electricity unit rate is the same or below export rate
({{ states('sensor.electricity_current_rate') ~'<=' ~
states('sensor.electricity_export_current_rate') }}). Charging kitchen Ecoflow.
Turning Fridge Freezer plug on.
title: EcoFlow
log_level: "Debug"
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.ecoflow_kitchen_plug
else:
- service: script.send_to_home_log
data:
message: >-
Electricity unit rate is the same or below export rate
({{ states('sensor.electricity_current_rate') ~'<=' ~
states('sensor.electricity_export_current_rate') }}). Charging kitchen Ecoflow.
title: EcoFlow
log_level: "Debug"
- service: script.ecoflow_set_charge_rate
data:
target_charge_rate: 1200
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/messaging/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ automation:
message: Turning on fridge freezer event received.
- service: switch.turn_on
target:
entity_id: switch.fridge_freezer
entity_id: switch.ecoflow_kitchen_plug
- conditions:
- condition: template
value_template: "{{ trigger.event.data.action == 'switch_on_freezer' }}"
Expand Down
14 changes: 5 additions & 9 deletions packages/rooms/kitchen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,11 @@ automation:
trigger:
- platform: state
entity_id:
- switch.fridge_freezer
to: "off"
- switch.ecoflow_kitchen_plug
to: "unavailable"
for:
hours: 0
minutes: 1
minutes: 2
seconds: 0
condition: []
action:
Expand All @@ -807,16 +807,12 @@ automation:
message: Fridge Freezer plug is turned off.
title: ":cook: Kitchen"
log_level: "Debug"
- service: script.send_actionable_notification_with_2_buttons
- service: script.send_direct_notification
data:
message: Fridge Freezer plug is turned off. Turn on?
message: Fridge Freezer plug is turned unavailable.
title: ":cook: Kitchen"
people:
- person.danny
action1_title: "Yes"
action1_name: switch_on_fridge_freezer
action2_title: "No"
action2_name: ignore
mode: single
- id: "1688681085048"
alias: "Kitchen: Low Water Softener Salt"
Expand Down

0 comments on commit f3e56be

Please sign in to comment.