various tidyups
This commit is contained in:
@@ -0,0 +1,939 @@
|
||||
################################################################################
|
||||
# PACKAGE: Energy Cost Monitoring
|
||||
################################################################################
|
||||
#
|
||||
# Version: 1.3.0
|
||||
# Date: 2026-08-23
|
||||
#
|
||||
# Purpose:
|
||||
# Track GST-inclusive electricity costs for the three-phase grid supply and
|
||||
# every appliance configured on the Energy dashboard.
|
||||
#
|
||||
# Notes:
|
||||
# - Charged period: 00:00 to 21:00.
|
||||
# - Free period: 21:00 to 00:00.
|
||||
# - Bill rates are GST-exclusive; calculated costs include 15% GST.
|
||||
# - Fixed daily charges are kept separate from appliance costs.
|
||||
# - Integral sensors use the left method so tariff changes are applied at the
|
||||
# boundary without averaging the old and new rates.
|
||||
#
|
||||
# Version history:
|
||||
# 1.3.0 (2026-08-24): Add Drinks Fridge and Vertical Freezer energy and
|
||||
# cost monitoring.
|
||||
# 1.2.0 (2026-08-23): Add Downstairs Lounge North GPO (X48PM) energy and
|
||||
# cost monitoring.
|
||||
# 1.1.1 (2026-08-22): Use the Zigbee X31PP plug for Main Fridge power costs.
|
||||
# 1.1.0 (2026-08-17): Add sorted daily, weekly, and monthly appliance ranking
|
||||
# meters and dynamic chart scales.
|
||||
# 1.0.0 (2026-08-17): Initial tariff, grid, appliance, and fixed-cost tracking.
|
||||
#
|
||||
#:########################################################################################:#
|
||||
# TARIFF HELPERS
|
||||
#:########################################################################################:#
|
||||
|
||||
input_number:
|
||||
electricity_paid_rate_ex_gst:
|
||||
name: Electricity Paid Rate Ex GST
|
||||
icon: mdi:cash
|
||||
initial: 0.289
|
||||
min: 0
|
||||
max: 2
|
||||
step: 0.001
|
||||
mode: box
|
||||
unit_of_measurement: "NZD/kWh"
|
||||
|
||||
electricity_daily_charge_ex_gst:
|
||||
name: Electricity Daily Charge Ex GST
|
||||
icon: mdi:calendar-cash
|
||||
initial: 3.036
|
||||
min: 0
|
||||
max: 20
|
||||
step: 0.001
|
||||
mode: box
|
||||
unit_of_measurement: "NZD/day"
|
||||
|
||||
#:########################################################################################:#
|
||||
# TARIFF AND COST-RATE SENSORS
|
||||
#:########################################################################################:#
|
||||
|
||||
template:
|
||||
- sensor:
|
||||
- name: Electricity Paid Rate
|
||||
default_entity_id: sensor.electricity_paid_rate
|
||||
unique_id: electricity_paid_rate
|
||||
icon: mdi:cash
|
||||
unit_of_measurement: "NZD/kWh"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('input_number.electricity_paid_rate_ex_gst')
|
||||
| float(0.289)
|
||||
* 1.15
|
||||
) | round(5)
|
||||
}}
|
||||
attributes:
|
||||
gst_rate: 0.15
|
||||
rate_ex_gst: >-
|
||||
{{
|
||||
states('input_number.electricity_paid_rate_ex_gst')
|
||||
| float(0.289)
|
||||
}}
|
||||
|
||||
- name: Electricity Current Price
|
||||
default_entity_id: sensor.electricity_current_price
|
||||
unique_id: electricity_current_price
|
||||
icon: mdi:currency-usd
|
||||
unit_of_measurement: "NZD/kWh"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{% set minute = now().hour * 60 + now().minute %}
|
||||
{{
|
||||
0
|
||||
if minute >= 21 * 60
|
||||
else states('sensor.electricity_paid_rate') | float(0.33235)
|
||||
}}
|
||||
attributes:
|
||||
tariff: >-
|
||||
{{ "free" if now().hour >= 21 else "charged" }}
|
||||
charged_period: "00:00-21:00"
|
||||
free_period: "21:00-00:00"
|
||||
gst_included: true
|
||||
|
||||
- name: Electricity Daily Charge
|
||||
default_entity_id: sensor.electricity_daily_charge
|
||||
unique_id: electricity_daily_charge
|
||||
icon: mdi:calendar-cash
|
||||
unit_of_measurement: "NZD/day"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('input_number.electricity_daily_charge_ex_gst')
|
||||
| float(3.036)
|
||||
* 1.15
|
||||
) | round(5)
|
||||
}}
|
||||
attributes:
|
||||
gst_rate: 0.15
|
||||
charge_ex_gst: >-
|
||||
{{
|
||||
states('input_number.electricity_daily_charge_ex_gst')
|
||||
| float(3.036)
|
||||
}}
|
||||
|
||||
- name: Electricity Grid Cost Rate
|
||||
default_entity_id: sensor.electricity_grid_cost_rate
|
||||
unique_id: electricity_grid_cost_rate
|
||||
icon: mdi:transmission-tower
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: >-
|
||||
{{
|
||||
has_value('sensor.main_house_3_phase_power_monitor_main_power_red_active_power')
|
||||
and has_value('sensor.main_house_3_phase_power_monitor_main_power_yellow_active_power')
|
||||
and has_value('sensor.main_house_3_phase_power_monitor_main_power_blue_active_power')
|
||||
}}
|
||||
state: >-
|
||||
{% set red = states('sensor.main_house_3_phase_power_monitor_main_power_red_active_power') | float(0) %}
|
||||
{% set yellow = states('sensor.main_house_3_phase_power_monitor_main_power_yellow_active_power') | float(0) %}
|
||||
{% set blue = states('sensor.main_house_3_phase_power_monitor_main_power_blue_active_power') | float(0) %}
|
||||
{% set price = states('sensor.electricity_current_price') | float(0) %}
|
||||
{{ ([red + yellow + blue, 0] | max / 1000 * price) | round(6) }}
|
||||
|
||||
- name: Energy Cost 16A EV Wallcharger Rate
|
||||
default_entity_id: sensor.energy_cost_16a_ev_wallcharger_rate
|
||||
unique_id: energy_cost_16a_ev_wallcharger_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.garage_db_control_16a_wallcharger_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.garage_db_control_16a_wallcharger_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost 32A EV Charger Rate
|
||||
default_entity_id: sensor.energy_cost_32a_ev_charger_rate
|
||||
unique_id: energy_cost_32a_ev_charger_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.main_house_3_phase_power_monitor_32a_wallcharger_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.main_house_3_phase_power_monitor_32a_wallcharger_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Underhouse Dehumidifier Rate
|
||||
default_entity_id: sensor.energy_cost_underhouse_dehumidifier_rate
|
||||
unique_id: energy_cost_underhouse_dehumidifier_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.underhouse_dehumidifier_power_plug_x10pp_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.underhouse_dehumidifier_power_plug_x10pp_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Pool Pump Rate
|
||||
default_entity_id: sensor.energy_cost_pool_pump_rate
|
||||
unique_id: energy_cost_pool_pump_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_poolpumppower_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_poolpumppower_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Data Cupboard Left Rate
|
||||
default_entity_id: sensor.energy_cost_data_cupboard_left_rate
|
||||
unique_id: energy_cost_data_cupboard_left_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_datacupboardpowermon_left_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_datacupboardpowermon_left_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Data Cupboard Right Rate
|
||||
default_entity_id: sensor.energy_cost_data_cupboard_right_rate
|
||||
unique_id: energy_cost_data_cupboard_right_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_datacupboardpowermon_right_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_datacupboardpowermon_right_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Laundry Dryer Rate
|
||||
default_entity_id: sensor.energy_cost_laundry_dryer_rate
|
||||
unique_id: energy_cost_laundry_dryer_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_laundrydrypow_load_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_laundrydrypow_load_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Laundry Washing Machine Rate
|
||||
default_entity_id: sensor.energy_cost_laundry_washing_machine_rate
|
||||
unique_id: energy_cost_laundry_washing_machine_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_laundrywashpow_load_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_laundrywashpow_load_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Main Dishwasher Rate
|
||||
default_entity_id: sensor.energy_cost_main_dishwasher_rate
|
||||
unique_id: energy_cost_main_dishwasher_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_maindishwasherpower_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_maindishwasherpower_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost 3D Printer Rate
|
||||
default_entity_id: sensor.energy_cost_3d_printer_rate
|
||||
unique_id: energy_cost_3d_printer_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_3dprinterpow_load_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_3dprinterpow_load_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Downstairs Dishwasher Rate
|
||||
default_entity_id: sensor.energy_cost_downstairs_dishwasher_rate
|
||||
unique_id: energy_cost_downstairs_dishwasher_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.esp_downstdishwasher_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.esp_downstdishwasher_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Main Fridge Rate
|
||||
default_entity_id: sensor.energy_cost_main_fridge_rate
|
||||
unique_id: energy_cost_main_fridge_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.upstairs_fridge_power_x31pp_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.upstairs_fridge_power_x31pp_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Downstairs Fridge Rate
|
||||
default_entity_id: sensor.energy_cost_downstairs_fridge_rate
|
||||
unique_id: energy_cost_downstairs_fridge_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.downstairs_fridge_power_x41pp_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.downstairs_fridge_power_x41pp_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Drinks Fridge Rate
|
||||
default_entity_id: sensor.energy_cost_drinks_fridge_rate
|
||||
unique_id: energy_cost_drinks_fridge_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.drinks_fridge_power_x59pm_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.drinks_fridge_power_x59pm_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Vertical Freezer Rate
|
||||
default_entity_id: sensor.energy_cost_vertical_freezer_rate
|
||||
unique_id: energy_cost_vertical_freezer_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.vertical_freezer_power_x60pm_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.vertical_freezer_power_x60pm_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Arcade Cabinet 1 Rate
|
||||
default_entity_id: sensor.energy_cost_arcade_cabinet_1_rate
|
||||
unique_id: energy_cost_arcade_cabinet_1_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.downstairs_flat_arcade_cabinet_1_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.downstairs_flat_arcade_cabinet_1_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Energy Cost Downstairs Lounge North GPO Rate
|
||||
default_entity_id: sensor.energy_cost_downstairs_lounge_north_gpo_rate
|
||||
unique_id: energy_cost_downstairs_lounge_north_gpo_rate
|
||||
unit_of_measurement: "NZD/h"
|
||||
state_class: measurement
|
||||
availability: "{{ has_value('sensor.downstairs_lounge_north_gpo_x48pm_power') }}"
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.downstairs_lounge_north_gpo_x48pm_power') | float(0)
|
||||
/ 1000
|
||||
* states('sensor.electricity_current_price') | float(0)
|
||||
) | round(6)
|
||||
}}
|
||||
|
||||
- name: Electricity Total Cost
|
||||
default_entity_id: sensor.electricity_total_cost
|
||||
unique_id: electricity_total_cost
|
||||
icon: mdi:cash-multiple
|
||||
device_class: monetary
|
||||
unit_of_measurement: "NZD"
|
||||
state_class: total_increasing
|
||||
availability: >-
|
||||
{{
|
||||
has_value('sensor.electricity_grid_usage_cost')
|
||||
and has_value('sensor.electricity_fixed_charges_total')
|
||||
}}
|
||||
state: >-
|
||||
{{
|
||||
(
|
||||
states('sensor.electricity_grid_usage_cost') | float(0)
|
||||
+ states('sensor.electricity_fixed_charges_total') | float(0)
|
||||
) | round(5)
|
||||
}}
|
||||
attributes:
|
||||
usage_cost: "{{ states('sensor.electricity_grid_usage_cost') | float(0) }}"
|
||||
fixed_cost: "{{ states('sensor.electricity_fixed_charges_total') | float(0) }}"
|
||||
gst_included: true
|
||||
|
||||
- name: Energy Cost Daily Ranking Max
|
||||
default_entity_id: sensor.energy_cost_daily_ranking_max
|
||||
unique_id: energy_cost_daily_ranking_max
|
||||
unit_of_measurement: "NZD"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{% set values = [
|
||||
states('sensor.16a_ev_wallcharger') | float(0),
|
||||
states('sensor.32a_ev_charger') | float(0),
|
||||
states('sensor.underhouse_dehumidifier') | float(0),
|
||||
states('sensor.pool_pump') | float(0),
|
||||
states('sensor.data_cupboard_left') | float(0),
|
||||
states('sensor.data_cupboard_right') | float(0),
|
||||
states('sensor.laundry_dryer') | float(0),
|
||||
states('sensor.washing_machine') | float(0),
|
||||
states('sensor.main_dishwasher') | float(0),
|
||||
states('sensor.3d_printer') | float(0),
|
||||
states('sensor.downstairs_dishwasher') | float(0),
|
||||
states('sensor.main_fridge') | float(0),
|
||||
states('sensor.downstairs_fridge') | float(0),
|
||||
states('sensor.drinks_fridge') | float(0),
|
||||
states('sensor.vertical_freezer') | float(0),
|
||||
states('sensor.arcade_cabinet_1') | float(0),
|
||||
states('sensor.downstairs_lounge_north_gpo_x48pm') | float(0)
|
||||
] %}
|
||||
{{ ([values | max * 1.1, 0.01] | max) | round(5) }}
|
||||
|
||||
- name: Energy Cost Weekly Ranking Max
|
||||
default_entity_id: sensor.energy_cost_weekly_ranking_max
|
||||
unique_id: energy_cost_weekly_ranking_max
|
||||
unit_of_measurement: "NZD"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{% set values = [
|
||||
states('sensor.16a_ev_wallcharger_2') | float(0),
|
||||
states('sensor.32a_ev_charger_2') | float(0),
|
||||
states('sensor.underhouse_dehumidifier_2') | float(0),
|
||||
states('sensor.pool_pump_2') | float(0),
|
||||
states('sensor.data_cupboard_left_2') | float(0),
|
||||
states('sensor.data_cupboard_right_2') | float(0),
|
||||
states('sensor.laundry_dryer_2') | float(0),
|
||||
states('sensor.washing_machine_2') | float(0),
|
||||
states('sensor.main_dishwasher_2') | float(0),
|
||||
states('sensor.3d_printer_2') | float(0),
|
||||
states('sensor.downstairs_dishwasher_2') | float(0),
|
||||
states('sensor.main_fridge_2') | float(0),
|
||||
states('sensor.downstairs_fridge_2') | float(0),
|
||||
states('sensor.drinks_fridge_2') | float(0),
|
||||
states('sensor.vertical_freezer_2') | float(0),
|
||||
states('sensor.arcade_cabinet_1_2') | float(0),
|
||||
states('sensor.downstairs_lounge_north_gpo_x48pm_2') | float(0)
|
||||
] %}
|
||||
{{ ([values | max * 1.1, 0.01] | max) | round(5) }}
|
||||
|
||||
- name: Energy Cost Monthly Ranking Max
|
||||
default_entity_id: sensor.energy_cost_monthly_ranking_max
|
||||
unique_id: energy_cost_monthly_ranking_max
|
||||
unit_of_measurement: "NZD"
|
||||
state_class: measurement
|
||||
state: >-
|
||||
{% set values = [
|
||||
states('sensor.16a_ev_wallcharger_3') | float(0),
|
||||
states('sensor.32a_ev_charger_3') | float(0),
|
||||
states('sensor.underhouse_dehumidifier_3') | float(0),
|
||||
states('sensor.pool_pump_3') | float(0),
|
||||
states('sensor.data_cupboard_left_3') | float(0),
|
||||
states('sensor.data_cupboard_right_3') | float(0),
|
||||
states('sensor.laundry_dryer_3') | float(0),
|
||||
states('sensor.washing_machine_3') | float(0),
|
||||
states('sensor.main_dishwasher_3') | float(0),
|
||||
states('sensor.3d_printer_3') | float(0),
|
||||
states('sensor.downstairs_dishwasher_3') | float(0),
|
||||
states('sensor.main_fridge_3') | float(0),
|
||||
states('sensor.downstairs_fridge_3') | float(0),
|
||||
states('sensor.drinks_fridge_3') | float(0),
|
||||
states('sensor.vertical_freezer_3') | float(0),
|
||||
states('sensor.arcade_cabinet_1_3') | float(0),
|
||||
states('sensor.downstairs_lounge_north_gpo_x48pm_3') | float(0)
|
||||
] %}
|
||||
{{ ([values | max * 1.1, 0.01] | max) | round(5) }}
|
||||
|
||||
- triggers:
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
- trigger: time
|
||||
at: "00:00:00"
|
||||
- trigger: event
|
||||
event_type: event_template_reloaded
|
||||
sensor:
|
||||
- name: Electricity Fixed Charges Total
|
||||
default_entity_id: sensor.electricity_fixed_charges_total
|
||||
unique_id: electricity_fixed_charges_total
|
||||
icon: mdi:calendar-cash
|
||||
device_class: monetary
|
||||
unit_of_measurement: "NZD"
|
||||
state_class: total_increasing
|
||||
state: >-
|
||||
{% set rate = states('sensor.electricity_daily_charge') | float(3.4914) %}
|
||||
{% set last = this.attributes.get('last_charge_date') %}
|
||||
{% if last %}
|
||||
{% set days = (now().date() - strptime(last, '%Y-%m-%d').date()).days %}
|
||||
{{
|
||||
(
|
||||
this.state | float(0)
|
||||
+ ([days, 0] | max) * rate
|
||||
) | round(5)
|
||||
}}
|
||||
{% else %}
|
||||
{{ rate | round(5) }}
|
||||
{% endif %}
|
||||
attributes:
|
||||
last_charge_date: "{{ now().date() }}"
|
||||
daily_charge: "{{ states('sensor.electricity_daily_charge') | float(3.4914) }}"
|
||||
gst_included: true
|
||||
|
||||
#:########################################################################################:#
|
||||
# CUMULATIVE USAGE COSTS
|
||||
#:########################################################################################:#
|
||||
|
||||
sensor:
|
||||
- platform: integration
|
||||
source: sensor.electricity_grid_cost_rate
|
||||
name: Electricity Grid Usage Cost
|
||||
unique_id: electricity_grid_usage_cost
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_16a_ev_wallcharger_rate
|
||||
name: Energy Cost 16A EV Wallcharger
|
||||
unique_id: energy_cost_16a_ev_wallcharger
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_32a_ev_charger_rate
|
||||
name: Energy Cost 32A EV Charger
|
||||
unique_id: energy_cost_32a_ev_charger
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_underhouse_dehumidifier_rate
|
||||
name: Energy Cost Underhouse Dehumidifier
|
||||
unique_id: energy_cost_underhouse_dehumidifier
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_pool_pump_rate
|
||||
name: Energy Cost Pool Pump
|
||||
unique_id: energy_cost_pool_pump
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_data_cupboard_left_rate
|
||||
name: Energy Cost Data Cupboard Left
|
||||
unique_id: energy_cost_data_cupboard_left
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_data_cupboard_right_rate
|
||||
name: Energy Cost Data Cupboard Right
|
||||
unique_id: energy_cost_data_cupboard_right
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_laundry_dryer_rate
|
||||
name: Energy Cost Laundry Dryer
|
||||
unique_id: energy_cost_laundry_dryer
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_laundry_washing_machine_rate
|
||||
name: Energy Cost Laundry Washing Machine
|
||||
unique_id: energy_cost_laundry_washing_machine
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_main_dishwasher_rate
|
||||
name: Energy Cost Main Dishwasher
|
||||
unique_id: energy_cost_main_dishwasher
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_3d_printer_rate
|
||||
name: Energy Cost 3D Printer
|
||||
unique_id: energy_cost_3d_printer
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_downstairs_dishwasher_rate
|
||||
name: Energy Cost Downstairs Dishwasher
|
||||
unique_id: energy_cost_downstairs_dishwasher
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_main_fridge_rate
|
||||
name: Energy Cost Main Fridge
|
||||
unique_id: energy_cost_main_fridge
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_downstairs_fridge_rate
|
||||
name: Energy Cost Downstairs Fridge
|
||||
unique_id: energy_cost_downstairs_fridge
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_drinks_fridge_rate
|
||||
name: Energy Cost Drinks Fridge
|
||||
unique_id: energy_cost_drinks_fridge
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_vertical_freezer_rate
|
||||
name: Energy Cost Vertical Freezer
|
||||
unique_id: energy_cost_vertical_freezer
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_arcade_cabinet_1_rate
|
||||
name: Energy Cost Arcade Cabinet 1
|
||||
unique_id: energy_cost_arcade_cabinet_1
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
- platform: integration
|
||||
source: sensor.energy_cost_downstairs_lounge_north_gpo_rate
|
||||
name: Energy Cost Downstairs Lounge North GPO
|
||||
unique_id: energy_cost_downstairs_lounge_north_gpo
|
||||
unit_time: h
|
||||
method: left
|
||||
round: 5
|
||||
max_sub_interval:
|
||||
minutes: 5
|
||||
|
||||
#:########################################################################################:#
|
||||
# APPLIANCE COST RANKING METERS
|
||||
#:########################################################################################:#
|
||||
|
||||
utility_meter:
|
||||
energy_cost_daily_16a_ev_wallcharger: &energy_cost_daily_meter
|
||||
source: sensor.energy_cost_16a_ev_wallcharger
|
||||
name: 16A EV Wallcharger
|
||||
cycle: daily
|
||||
periodically_resetting: false
|
||||
always_available: true
|
||||
energy_cost_daily_32a_ev_charger:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_32a_ev_charger
|
||||
name: 32A EV Charger
|
||||
energy_cost_daily_underhouse_dehumidifier:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_underhouse_dehumidifier
|
||||
name: Underhouse Dehumidifier
|
||||
energy_cost_daily_pool_pump:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_pool_pump
|
||||
name: Pool Pump
|
||||
energy_cost_daily_data_cupboard_left:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_data_cupboard_left
|
||||
name: Data Cupboard Left
|
||||
energy_cost_daily_data_cupboard_right:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_data_cupboard_right
|
||||
name: Data Cupboard Right
|
||||
energy_cost_daily_laundry_dryer:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_laundry_dryer
|
||||
name: Laundry Dryer
|
||||
energy_cost_daily_laundry_washing_machine:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_laundry_washing_machine
|
||||
name: Washing Machine
|
||||
energy_cost_daily_main_dishwasher:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_main_dishwasher
|
||||
name: Main Dishwasher
|
||||
energy_cost_daily_3d_printer:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_3d_printer
|
||||
name: 3D Printer
|
||||
energy_cost_daily_downstairs_dishwasher:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_downstairs_dishwasher
|
||||
name: Downstairs Dishwasher
|
||||
energy_cost_daily_main_fridge:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_main_fridge
|
||||
name: Main Fridge
|
||||
energy_cost_daily_downstairs_fridge:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_downstairs_fridge
|
||||
name: Downstairs Fridge
|
||||
energy_cost_daily_drinks_fridge:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_drinks_fridge
|
||||
name: Drinks Fridge
|
||||
energy_cost_daily_vertical_freezer:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_vertical_freezer
|
||||
name: Vertical Freezer
|
||||
energy_cost_daily_arcade_cabinet_1:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_arcade_cabinet_1
|
||||
name: Arcade Cabinet 1
|
||||
energy_cost_daily_downstairs_lounge_north_gpo:
|
||||
<<: *energy_cost_daily_meter
|
||||
source: sensor.energy_cost_downstairs_lounge_north_gpo
|
||||
name: Downstairs Lounge North GPO (X48PM)
|
||||
|
||||
energy_cost_weekly_16a_ev_wallcharger: &energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_16a_ev_wallcharger
|
||||
name: 16A EV Wallcharger
|
||||
cycle: weekly
|
||||
periodically_resetting: false
|
||||
always_available: true
|
||||
energy_cost_weekly_32a_ev_charger:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_32a_ev_charger
|
||||
name: 32A EV Charger
|
||||
energy_cost_weekly_underhouse_dehumidifier:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_underhouse_dehumidifier
|
||||
name: Underhouse Dehumidifier
|
||||
energy_cost_weekly_pool_pump:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_pool_pump
|
||||
name: Pool Pump
|
||||
energy_cost_weekly_data_cupboard_left:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_data_cupboard_left
|
||||
name: Data Cupboard Left
|
||||
energy_cost_weekly_data_cupboard_right:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_data_cupboard_right
|
||||
name: Data Cupboard Right
|
||||
energy_cost_weekly_laundry_dryer:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_laundry_dryer
|
||||
name: Laundry Dryer
|
||||
energy_cost_weekly_laundry_washing_machine:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_laundry_washing_machine
|
||||
name: Washing Machine
|
||||
energy_cost_weekly_main_dishwasher:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_main_dishwasher
|
||||
name: Main Dishwasher
|
||||
energy_cost_weekly_3d_printer:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_3d_printer
|
||||
name: 3D Printer
|
||||
energy_cost_weekly_downstairs_dishwasher:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_downstairs_dishwasher
|
||||
name: Downstairs Dishwasher
|
||||
energy_cost_weekly_main_fridge:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_main_fridge
|
||||
name: Main Fridge
|
||||
energy_cost_weekly_downstairs_fridge:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_downstairs_fridge
|
||||
name: Downstairs Fridge
|
||||
energy_cost_weekly_drinks_fridge:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_drinks_fridge
|
||||
name: Drinks Fridge
|
||||
energy_cost_weekly_vertical_freezer:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_vertical_freezer
|
||||
name: Vertical Freezer
|
||||
energy_cost_weekly_arcade_cabinet_1:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_arcade_cabinet_1
|
||||
name: Arcade Cabinet 1
|
||||
energy_cost_weekly_downstairs_lounge_north_gpo:
|
||||
<<: *energy_cost_weekly_meter
|
||||
source: sensor.energy_cost_downstairs_lounge_north_gpo
|
||||
name: Downstairs Lounge North GPO (X48PM)
|
||||
|
||||
energy_cost_monthly_16a_ev_wallcharger: &energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_16a_ev_wallcharger
|
||||
name: 16A EV Wallcharger
|
||||
cycle: monthly
|
||||
periodically_resetting: false
|
||||
always_available: true
|
||||
energy_cost_monthly_32a_ev_charger:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_32a_ev_charger
|
||||
name: 32A EV Charger
|
||||
energy_cost_monthly_underhouse_dehumidifier:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_underhouse_dehumidifier
|
||||
name: Underhouse Dehumidifier
|
||||
energy_cost_monthly_pool_pump:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_pool_pump
|
||||
name: Pool Pump
|
||||
energy_cost_monthly_data_cupboard_left:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_data_cupboard_left
|
||||
name: Data Cupboard Left
|
||||
energy_cost_monthly_data_cupboard_right:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_data_cupboard_right
|
||||
name: Data Cupboard Right
|
||||
energy_cost_monthly_laundry_dryer:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_laundry_dryer
|
||||
name: Laundry Dryer
|
||||
energy_cost_monthly_laundry_washing_machine:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_laundry_washing_machine
|
||||
name: Washing Machine
|
||||
energy_cost_monthly_main_dishwasher:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_main_dishwasher
|
||||
name: Main Dishwasher
|
||||
energy_cost_monthly_3d_printer:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_3d_printer
|
||||
name: 3D Printer
|
||||
energy_cost_monthly_downstairs_dishwasher:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_downstairs_dishwasher
|
||||
name: Downstairs Dishwasher
|
||||
energy_cost_monthly_main_fridge:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_main_fridge
|
||||
name: Main Fridge
|
||||
energy_cost_monthly_downstairs_fridge:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_downstairs_fridge
|
||||
name: Downstairs Fridge
|
||||
energy_cost_monthly_drinks_fridge:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_drinks_fridge
|
||||
name: Drinks Fridge
|
||||
energy_cost_monthly_vertical_freezer:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_vertical_freezer
|
||||
name: Vertical Freezer
|
||||
energy_cost_monthly_arcade_cabinet_1:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_arcade_cabinet_1
|
||||
name: Arcade Cabinet 1
|
||||
energy_cost_monthly_downstairs_lounge_north_gpo:
|
||||
<<: *energy_cost_monthly_meter
|
||||
source: sensor.energy_cost_downstairs_lounge_north_gpo
|
||||
name: Downstairs Lounge North GPO (X48PM)
|
||||
Reference in New Issue
Block a user