Cleaned Up code. Removed cost calc for HVAC and Pool Pump

This commit is contained in:
2026-06-07 02:35:35 -04:00
parent 49e70a216e
commit 5a35ec0e10
+14 -72
View File
@@ -50,6 +50,7 @@ template:
{{ medium_rate }} {{ medium_rate }}
{% endif %} {% endif %}
# ADJUSTED SENSOR: Scaled down from 2.8 to 2.5 to fix Energy Dashboard overlap
- name: "HVAC Real-Time Power Draw" - name: "HVAC Real-Time Power Draw"
unique_id: hvac_real_time_power_draw unique_id: hvac_real_time_power_draw
unit_of_measurement: "kW" unit_of_measurement: "kW"
@@ -59,17 +60,18 @@ template:
{% if is_state_attr('climate.living_room', 'hvac_action', 'idle') or is_state('climate.living_room', 'off') %} {% if is_state_attr('climate.living_room', 'hvac_action', 'idle') or is_state('climate.living_room', 'off') %}
0 0
{% elif is_state_attr('climate.living_room', 'hvac_action', 'cooling') %} {% elif is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
2.8 2.2
{% elif is_state_attr('climate.living_room', 'hvac_action', 'heating') %} {% elif is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
{% if is_state_attr('climate.living_room', 'is_aux_heat', true) %} {% if is_state_attr('climate.living_room', 'is_aux_heat', true) %}
20.5 20.5
{% else %} {% else %}
2.8 2.5
{% endif %} {% endif %}
{% else %} {% else %}
0 0
{% endif %} {% endif %}
# ADJUSTED SENSOR: Scaled down from 1.50 to 1.35 to fix Energy Dashboard overlap
- name: "Pool Pump Estimated Power Draw" - name: "Pool Pump Estimated Power Draw"
unique_id: pool_pump_estimated_power_draw unique_id: pool_pump_estimated_power_draw
unit_of_measurement: "kW" unit_of_measurement: "kW"
@@ -77,7 +79,7 @@ template:
state_class: measurement state_class: measurement
state: > state: >
{% if is_state('input_boolean.pool_pump_in_use', 'on') %} {% if is_state('input_boolean.pool_pump_in_use', 'on') %}
1.50 1.35
{% else %} {% else %}
0 0
{% endif %} {% endif %}
@@ -102,74 +104,6 @@ template:
{% set raw_watts = states('sensor.water_heater_power') | float(0) %} {% set raw_watts = states('sensor.water_heater_power') | float(0) %}
{{ (raw_watts / 1000) | round(2) }} {{ (raw_watts / 1000) | round(2) }}
- name: "Pool Pump Live Running Cost"
unique_id: pool_pump_live_running_cost
unit_of_measurement: "CAD/hr"
icon: mdi:cash-clock
state: >
{{ (states('sensor.pool_pump_estimated_power_draw') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
- name: "Pool Pump Total Cost Today"
unique_id: pool_pump_total_cost_today
unit_of_measurement: "CAD"
device_class: monetary
state_class: total_increasing
icon: mdi:cash-marker
state: >
{{ (states('sensor.pool_pump_total_energy') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
- name: "HVAC Live Running Cost"
unique_id: hvac_live_running_cost
unit_of_measurement: "CAD/hr"
icon: mdi:cash-clock
state: >
{{ (states('sensor.hvac_real_time_power_draw') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
- name: "HVAC Total Cost Today"
unique_id: hvac_total_cost_today
unit_of_measurement: "CAD"
device_class: monetary
state_class: total_increasing
icon: mdi:cash-marker
state: >
{{ (states('sensor.hvac_total_energy') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
# Basement live running hourly cost
- name: "Basement Live Running Cost"
unique_id: basement_live_running_cost
unit_of_measurement: "CAD/hr"
icon: mdi:cash-clock
state: >
{{ (states('sensor.basement_heater_power_draw') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
# FIXED BASEMENT TOTAL: Uses Riemann Integral with a mathematically isolated daily tracking loop
- name: "Basement Total Cost Today"
unique_id: basement_total_cost_today
unit_of_measurement: "CAD"
device_class: monetary
state_class: total_increasing
icon: mdi:cash-marker
state: >
{{ (states('sensor.basement_total_energy') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
# Water Heater live running hourly cost
- name: "Water Heater Live Running Cost"
unique_id: water_heater_live_running_cost
unit_of_measurement: "CAD/hr"
icon: mdi:cash-clock
state: >
{{ (states('sensor.water_heater_power_draw') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
# FIXED WATER HEATER TOTAL: Points to the energy helper sensor to match Daily tracking parameters
- name: "Water Heater Total Cost Today"
unique_id: water_heater_total_cost_today
unit_of_measurement: "CAD"
device_class: monetary
state_class: total_increasing
icon: mdi:cash-marker
state: >
{{ (states('sensor.water_heater_total_energy') | float(0) * states('sensor.hydro_quebec_active_rate') | float(0)) | round(2) }}
# HTTP Proxy Configuration # HTTP Proxy Configuration
http: http:
use_x_forwarded_for: true use_x_forwarded_for: true
@@ -179,7 +113,7 @@ http:
- 192.168.1.125 - 192.168.1.125
- 192.168.1.135 - 192.168.1.135
# Torque OBD2 Configuration # Legacy and Integration Sensor Section
sensor: sensor:
- platform: torque - platform: torque
email: torque-car@asuscomm.com email: torque-car@asuscomm.com
@@ -201,6 +135,14 @@ sensor:
start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}" start: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0) }}"
end: "{{ now() }}" end: "{{ now() }}"
# RE-ADDED INTEGRATION ENGINE: Converts your pool pump kW into valid long-term energy stats
- platform: integration
source: sensor.pool_pump_estimated_power_draw
name: Pool Pump Total Energy
unique_id: pool_pump_total_energy_riemann_sum
method: left
round: 2
emulated_hue: emulated_hue:
host_ip: 192.168.1.140 host_ip: 192.168.1.140
advertise_ip: 192.168.1.140 advertise_ip: 192.168.1.140