Pruebas consumos con integración
This commit is contained in:
@@ -8,4 +8,4 @@ sensor:
|
|||||||
name: "Consumo Diario Calefacción"
|
name: "Consumo Diario Calefacción"
|
||||||
state_topic: "shellies/shelly4pro-061E6E/relay/2/energy"
|
state_topic: "shellies/shelly4pro-061E6E/relay/2/energy"
|
||||||
unit_of_measurement: "kW"
|
unit_of_measurement: "kW"
|
||||||
value_template: "{{ value | multiply(0.001) | float | round(2)}}"
|
value_template: "{{ value | multiply(0.000017) | float | round(2)}}"
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ sensor:
|
|||||||
name: "Consumo Diario Coche Eléctrico"
|
name: "Consumo Diario Coche Eléctrico"
|
||||||
state_topic: "shellies/shelly4pro-061E6E/relay/3/energy"
|
state_topic: "shellies/shelly4pro-061E6E/relay/3/energy"
|
||||||
unit_of_measurement: "kW"
|
unit_of_measurement: "kW"
|
||||||
value_template: "{{ value | multiply(0.001) | float | round(2)}}"
|
value_template: "{{ value | multiply(0.000017) | float | round(2)}}"
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ sensor:
|
|||||||
name: "Consumo Diario Luces"
|
name: "Consumo Diario Luces"
|
||||||
state_topic: "shellies/shelly4pro-061E6E/relay/0/energy"
|
state_topic: "shellies/shelly4pro-061E6E/relay/0/energy"
|
||||||
unit_of_measurement: "kW"
|
unit_of_measurement: "kW"
|
||||||
value_template: "{{ value | multiply(0.001) | float | round(2)}}"
|
value_template: "{{ value | multiply(0.000017) | float | round(2)}}"
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ sensor:
|
|||||||
name: "Consumo Diario Persianas"
|
name: "Consumo Diario Persianas"
|
||||||
state_topic: "shellies/shelly4pro-061E6E/relay/1/energy"
|
state_topic: "shellies/shelly4pro-061E6E/relay/1/energy"
|
||||||
unit_of_measurement: "kW"
|
unit_of_measurement: "kW"
|
||||||
value_template: "{{ value | multiply(0.001) | float | round(2)}}"
|
value_template: "{{ value | multiply(0.000017) | float | round(2)}}"
|
||||||
|
|||||||
35
packages/sensor/consumo_tarificacion_general.yaml
Normal file
35
packages/sensor/consumo_tarificacion_general.yaml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
utility_meter:
|
||||||
|
periodo_consumo_diario_general:
|
||||||
|
source: sensor.consumo_integrado_general
|
||||||
|
cycle: daily
|
||||||
|
tariffs:
|
||||||
|
- punta
|
||||||
|
- valle
|
||||||
|
periodo_consumo_mensual_general:
|
||||||
|
source: sensor.consumo_integrado_general
|
||||||
|
cycle: monthly
|
||||||
|
offset:
|
||||||
|
days: 1
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
tariffs:
|
||||||
|
- punta
|
||||||
|
- valle
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_general
|
||||||
|
name: Consumo Integrado General
|
||||||
|
unit_prefix: k
|
||||||
|
round: 2
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
consumo_diario_general:
|
||||||
|
friendly_name: Consumo Diario General
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
value_template: "{{ (states('sensor.periodo_consumo_diario_general_punta')|float + states('sensor.periodo_consumo_diario_general_valle')|float) |round(2) }}"
|
||||||
|
consumo_mensual_general:
|
||||||
|
friendly_name: Consumo Mensual General
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
value_template: "{{ (states('sensor.periodo_consumo_mensual_general_punta')|float + states('sensor.periodo_consumo_mensual_general_valle')|float) |round(2) }}"
|
||||||
41
packages/sensor/consumo_tarificacion_varios_2.yaml
Normal file
41
packages/sensor/consumo_tarificacion_varios_2.yaml
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
utility_meter:
|
||||||
|
periodo_consumo_diario_varios_2:
|
||||||
|
source: sensor.consumo_varios_2
|
||||||
|
cycle: daily
|
||||||
|
tariffs:
|
||||||
|
- punta
|
||||||
|
- valle
|
||||||
|
periodo_consumo_mensual_varios_2:
|
||||||
|
source: sensor.consumo_varios_2
|
||||||
|
cycle: monthly
|
||||||
|
offset:
|
||||||
|
days: 1
|
||||||
|
hours: 0
|
||||||
|
minutes: 0
|
||||||
|
tariffs:
|
||||||
|
- punta
|
||||||
|
- valle
|
||||||
|
|
||||||
|
sensor:
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
consumo_bruto_diario_varios_2:
|
||||||
|
friendly_name: Consumo Bruto Diario Varios 2
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
value_template: "{{ states('sensor.periodo_consumo_diario_varios_2_punta')|float + states('sensor.periodo_consumo_diario_varios_2_valle')|float |round(2) }}"
|
||||||
|
consumo_bruto_mensual_varios_2:
|
||||||
|
friendly_name: Consumo Bruto Mensual Varios 2
|
||||||
|
unit_of_measurement: kWh
|
||||||
|
value_template: "{{ states('sensor.periodo_consumo_mensual_varios_2_punta')|float + states('sensor.periodo_consumo_mensual_varios_2_valle')|float |round(2) }}"
|
||||||
|
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_bruto_diario_varios_2
|
||||||
|
name: Consumo Integrado Diario Varios 2
|
||||||
|
unit: kWh
|
||||||
|
round: 2
|
||||||
|
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_bruto_mensual_varios_2
|
||||||
|
name: Consumo Integrado Mensual Varios 2
|
||||||
|
unit: kWh
|
||||||
|
round: 2
|
||||||
12
packages/sensor/consumo_varios_1.yaml
Normal file
12
packages/sensor/consumo_varios_1.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
sensor:
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
consumo_varios_1:
|
||||||
|
friendly_name: "Consumo Varios 1"
|
||||||
|
unit_of_measurement: 'W'
|
||||||
|
value_template: "{{(states('sensor.consumo_varios_1_completo')|float - states('sensor.consumo_nevera')|float)|round(2)}}"
|
||||||
|
|
||||||
|
consumo_diario_varios_1:
|
||||||
|
friendly_name: "Consumo Diario Varios 1"
|
||||||
|
unit_of_measurement: 'kW'
|
||||||
|
value_template: "{{(states('sensor.consumo_diario_varios_1_completo')|float - states('sensor.consumo_diario_nevera')|float)|round(2)}}"
|
||||||
69
packages/sensor/consumos_x_integracion.yaml
Normal file
69
packages/sensor/consumos_x_integracion.yaml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
sensor:
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_varios_1
|
||||||
|
name: Consumo Diario Integracion Varios 1
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_varios_2
|
||||||
|
name: Consumo Diario Integracion Varios 2
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_horno
|
||||||
|
name: Consumo Diario Integracion Horno
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_lavadora
|
||||||
|
name: Consumo Diario Integracion lavadora
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_lavavajillas
|
||||||
|
name: Consumo Diario Integracion lavavajillas
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_humedos
|
||||||
|
name: Consumo Diario Integracion Humedos
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_luces
|
||||||
|
name: Consumo Diario Integracion luces
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_calefacion
|
||||||
|
name: Consumo Diario Integracion calefaccion
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_coche_electrico
|
||||||
|
name: Consumo Diario Integracion coche electrico
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_persianas
|
||||||
|
name: Consumo Diario Integracion persianas
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
|
- platform: integration
|
||||||
|
source: sensor.consumo_nevera
|
||||||
|
name: Consumo Diario Integracion nevera
|
||||||
|
round: 2
|
||||||
|
unit_time: d
|
||||||
|
unit: kW
|
||||||
@@ -8,7 +8,7 @@ sensor:
|
|||||||
FROM
|
FROM
|
||||||
((SELECT DATE(created) as ayer, (AVG(CAST ( state AS numeric ))*12*0.082/1000) AS avr_day_0_12,0 as avr_day_12_22,0 as avr_day_22_23, 0 as avr_day_full
|
((SELECT DATE(created) as ayer, (AVG(CAST ( state AS numeric ))*12*0.082/1000) AS avr_day_0_12,0 as avr_day_12_22,0 as avr_day_22_23, 0 as avr_day_full
|
||||||
FROM states
|
FROM states
|
||||||
WHERE entity_id = 'sensor.qubino_zmnhtdx_smart_meter_s4_s5_s6_power'
|
WHERE entity_id = 'sensor.consumo_general'
|
||||||
AND state != 'unknown'
|
AND state != 'unknown'
|
||||||
AND state != ''
|
AND state != ''
|
||||||
AND CAST(state AS numeric) >= 0
|
AND CAST(state AS numeric) >= 0
|
||||||
@@ -20,7 +20,7 @@ FROM
|
|||||||
UNION
|
UNION
|
||||||
(SELECT DATE(created),0,(AVG(CAST ( state AS numeric ))*10*0.161/1000) AS avr_day_12_22,0,0
|
(SELECT DATE(created),0,(AVG(CAST ( state AS numeric ))*10*0.161/1000) AS avr_day_12_22,0,0
|
||||||
FROM states
|
FROM states
|
||||||
WHERE entity_id = 'sensor.qubino_zmnhtdx_smart_meter_s4_s5_s6_power'
|
WHERE entity_id = 'sensor.consumo_general'
|
||||||
AND state != 'unknown'
|
AND state != 'unknown'
|
||||||
AND state != ''
|
AND state != ''
|
||||||
AND CAST(state AS numeric) >= 0
|
AND CAST(state AS numeric) >= 0
|
||||||
@@ -32,7 +32,7 @@ UNION
|
|||||||
UNION
|
UNION
|
||||||
(SELECT DATE(created),0,0, (AVG(CAST ( state AS numeric ))*2*0.082/1000) AS avr_day_23_00, 0
|
(SELECT DATE(created),0,0, (AVG(CAST ( state AS numeric ))*2*0.082/1000) AS avr_day_23_00, 0
|
||||||
FROM states
|
FROM states
|
||||||
WHERE entity_id = 'sensor.qubino_zmnhtdx_smart_meter_s4_s5_s6_power'
|
WHERE entity_id = 'sensor.consumo_general'
|
||||||
AND state != 'unknown'
|
AND state != 'unknown'
|
||||||
AND state != ''
|
AND state != ''
|
||||||
AND CAST(state AS numeric) >= 0
|
AND CAST(state AS numeric) >= 0
|
||||||
@@ -44,7 +44,7 @@ UNION
|
|||||||
UNION
|
UNION
|
||||||
(SELECT DATE(created),0,0,0, (AVG(CAST ( state AS numeric ))*24*0.139/1000) AS avr_day_full
|
(SELECT DATE(created),0,0,0, (AVG(CAST ( state AS numeric ))*24*0.139/1000) AS avr_day_full
|
||||||
FROM states
|
FROM states
|
||||||
WHERE entity_id = 'sensor.qubino_zmnhtdx_smart_meter_s4_s5_s6_power'
|
WHERE entity_id = 'sensor.consumo_general'
|
||||||
AND state != 'unknown'
|
AND state != 'unknown'
|
||||||
AND state != ''
|
AND state != ''
|
||||||
AND CAST(state AS numeric) >= 0
|
AND CAST(state AS numeric) >= 0
|
||||||
@@ -60,7 +60,7 @@ group by ayer;"
|
|||||||
- name: Coste Ayer TSDH
|
- name: Coste Ayer TSDH
|
||||||
query: "SELECT DATE(created), (AVG(CAST ( state AS numeric ))*24*0.139/1000) AS total
|
query: "SELECT DATE(created), (AVG(CAST ( state AS numeric ))*24*0.139/1000) AS total
|
||||||
FROM states
|
FROM states
|
||||||
WHERE entity_id = 'sensor.qubino_zmnhtdx_smart_meter_s4_s5_s6_power'
|
WHERE entity_id = 'sensor.consumo_general'
|
||||||
AND state != 'unknown'
|
AND state != 'unknown'
|
||||||
AND state != ''
|
AND state != ''
|
||||||
AND CAST(state AS numeric) >= 0
|
AND CAST(state AS numeric) >= 0
|
||||||
|
|||||||
Reference in New Issue
Block a user