From 790a26b00e171baa7ced1c710eb5e0b5f3a33cd9 Mon Sep 17 00:00:00 2001 From: monster Date: Sat, 9 Feb 2019 23:56:22 +0300 Subject: [PATCH] Power stats --- .../template/xiaomi_socket_money_cost.yaml | 34 +++++++++ .../xiaomi_socket_power_consumed.yaml} | 22 +++--- .../utility_meter/thermopot.yaml | 12 +-- hass/settings/ui-lovelace.yaml | 75 ++++++++++--------- 4 files changed, 90 insertions(+), 53 deletions(-) create mode 100644 hass/settings/configuration/sensor/template/xiaomi_socket_money_cost.yaml rename hass/settings/configuration/sensor/{power/xiaomi_socket_power_cunsumed.yaml => template/xiaomi_socket_power_consumed.yaml} (67%) diff --git a/hass/settings/configuration/sensor/template/xiaomi_socket_money_cost.yaml b/hass/settings/configuration/sensor/template/xiaomi_socket_money_cost.yaml new file mode 100644 index 0000000..307c388 --- /dev/null +++ b/hass/settings/configuration/sensor/template/xiaomi_socket_money_cost.yaml @@ -0,0 +1,34 @@ +- platform: template + sensors: + counter_hot_money_monthly: + friendly_name: "Горячая в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.counter_hot_monthly') | float * 188.53) | round(2) }}" + counter_cold_money_monthly: + friendly_name: "Холодная в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.counter_cold_monthly') | float * 38.06) | round(2) }}" + power_money_monthly: + friendly_name: "Электричество в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.power_monthly') | float * 4.37) | round(2) }}" + dishwasher_money_monthly: + friendly_name: "Посудомойка в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.dishwasher_monthly') | float * 4.37) | round(2) }}" + washer_money_monthly: + friendly_name: "Стиралка в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.washer_monthly') | float * 4.37) | round(2) }}" + tv_money_monthly: + friendly_name: "ТВ в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.tv_monthly') | float * 4.37) | round(2) }}" + thermopot_money_monthly: + friendly_name: "Термопот в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.thermopot_monthly') | float * 4.37) | round(2) }}" + conditioner_money_monthly: + friendly_name: "Кондиционер в мес" + unit_of_measurement: 'Р' + value_template: "{{ (states('sensor.conditioner_monthly') | float * 4.37) | round(2) }}" diff --git a/hass/settings/configuration/sensor/power/xiaomi_socket_power_cunsumed.yaml b/hass/settings/configuration/sensor/template/xiaomi_socket_power_consumed.yaml similarity index 67% rename from hass/settings/configuration/sensor/power/xiaomi_socket_power_cunsumed.yaml rename to hass/settings/configuration/sensor/template/xiaomi_socket_power_consumed.yaml index df0e2cb..d7534f4 100644 --- a/hass/settings/configuration/sensor/power/xiaomi_socket_power_cunsumed.yaml +++ b/hass/settings/configuration/sensor/template/xiaomi_socket_power_consumed.yaml @@ -2,21 +2,21 @@ sensors: dishwasher_consumed: friendly_name: "Посудомойка потреблено" - unit_of_measurement: 'wH' - value_template: "{{ state_attr('switch.plug_158d0001a68c64', 'power_consumed') }}" + unit_of_measurement: 'kWh' + value_template: "{{ state_attr('switch.plug_158d0001a68c64', 'power_consumed') / 1000 }}" washer_consumed: friendly_name: "Стиралка потреблено" - unit_of_measurement: 'wH' - value_template: "{{ state_attr('switch.plug_158d0001a4cfb4', 'power_consumed') }}" + unit_of_measurement: 'kWh' + value_template: "{{ state_attr('switch.plug_158d0001a4cfb4', 'power_consumed') / 1000 }}" tv_consumed: friendly_name: "ТВ потреблено" - unit_of_measurement: 'wH' - value_template: "{{ state_attr('switch.plug_158d0001104a0c', 'power_consumed') }}" - thermopot_consumed: + unit_of_measurement: 'kWh' + value_template: "{{ state_attr('switch.plug_158d0001104a0c', 'power_consumed') / 1000 }}" + thermopot_consumed2: friendly_name: "Термопот потреблено" - unit_of_measurement: 'wH' - value_template: "{{ state_attr('switch.plug_158d0001a68b18', 'power_consumed') }}" + unit_of_measurement: 'kWh' + value_template: "{{ state_attr('switch.plug_158d0001a68b18', 'power_consumed') / 1000 }}" conditioner_consumed: friendly_name: "Кондиционер потреблено" - unit_of_measurement: 'wH' - value_template: "{{ state_attr('switch.plug_158d00010dd98d', 'power_consumed') }}" \ No newline at end of file + unit_of_measurement: 'kWh' + value_template: "{{ state_attr('switch.plug_158d00010dd98d', 'power_consumed') / 1000 }}" \ No newline at end of file diff --git a/hass/settings/configuration/utility_meter/thermopot.yaml b/hass/settings/configuration/utility_meter/thermopot.yaml index 96dd5cd..ab189fd 100644 --- a/hass/settings/configuration/utility_meter/thermopot.yaml +++ b/hass/settings/configuration/utility_meter/thermopot.yaml @@ -1,9 +1,9 @@ -thermopot_hourly: - source: sensor.thermopot_consumed +thermopot_hourly2: + source: sensor.thermopot_consumed2 cycle: hourly -thermopot_dialy: - source: sensor.thermopot_consumed +thermopot_dialy2: + source: sensor.thermopot_consumed2 cycle: daily -thermopot_monthly: - source: sensor.thermopot_consumed +thermopot_monthly2: + source: sensor.thermopot_consumed2 cycle: monthly diff --git a/hass/settings/ui-lovelace.yaml b/hass/settings/ui-lovelace.yaml index fe0e03f..f0a670a 100644 --- a/hass/settings/ui-lovelace.yaml +++ b/hass/settings/ui-lovelace.yaml @@ -74,7 +74,7 @@ views: cards: - type: entities title: "Движение" - show_header_toggle: true + show_header_toggle: false entities: - binary_sensor.motion_sensor_158d0000e7c7ad - binary_sensor.motion_sensor_158d0002044548 @@ -88,7 +88,7 @@ views: - binary_sensor.motion_sensor_158d0001e80f0d - type: entities title: "Протечка" - show_header_toggle: true + show_header_toggle: false entities: - binary_sensor.water_leak_sensor_158d0001d594fa - binary_sensor.water_leak_sensor_158d0001c34960 @@ -98,12 +98,12 @@ views: - binary_sensor.water_leak_sensor_158d00023a48f0 - type: entities title: "Датчики дыма" - show_header_toggle: true + show_header_toggle: false entities: - binary_sensor.smoke_sensor_158d00023115ad - type: entities title: "Двери" - show_header_toggle: true + show_header_toggle: false entities: - binary_sensor.door_window_sensor_158d0001130141 - binary_sensor.door_window_sensor_158d000111a469 @@ -113,9 +113,8 @@ views: - binary_sensor.door_window_sensor_158d0001c0e46d - binary_sensor.door_window_sensor_158d0001e74660 - type: entities - title: "Счетчики вод\ - ы" - show_header_toggle: true + title: "Счетчики воды" + show_header_toggle: false entities: - sensor.epd_balance - sensor.counter_cold @@ -124,7 +123,7 @@ views: - sensor.counter_mosru_hot - type: entities title: "Метки" - show_header_toggle: true + show_header_toggle: false entities: - sensor.tag_mamik_band - sensor.tag_monster_nut @@ -132,17 +131,15 @@ views: - sensor.tag_nut_white - sensor.tag_nut_guest - type: entities - title: "Пристутстви\ - е" - show_header_toggle: true + title: "Пристутствие" + show_header_toggle: false entities: - sensor.presence_hall - sensor.presence_kitchen - sensor.presence_balcony - type: entities - title: "Электропита\ - ние" - show_header_toggle: true + title: "Электропитание" + show_header_toggle: false entities: - sensor.power_mosenergosbyt_balance - sensor.power_main_total @@ -184,63 +181,69 @@ views: icon: mdi:chart-areaspline cards: - type: entities - title: "Электроэнер\ - гия" - show_header_toggle: true + title: "Электроэнергия" + show_header_toggle: false entities: + - sensor.power_hourly - sensor.power_dialy - sensor.power_monthly - - sensor.power_hourly + - sensor.power_money_monthly - type: entities title: "Горячая вода" - show_header_toggle: true + show_header_toggle: false entities: - sensor.counter_hot_hourly - sensor.counter_hot_dialy - sensor.counter_hot_monthly + - sensor.counter_hot_money_monthly - type: entities - title: "Холодная вод\ - а" - show_header_toggle: true + title: "Холодная вода" + show_header_toggle: false entities: - sensor.counter_cold_hourly - sensor.counter_cold_dialy - sensor.counter_cold_monthly + - sensor.counter_cold_money_monthly - type: entities title: "Посудомойка" - show_header_toggle: true + show_header_toggle: false entities: + - sensor.dishwasher_hourly - sensor.dishwasher_dialy - sensor.dishwasher_monthly - - sensor.dishwasher_hourly + - sensor.dishwasher_money_monthly - type: entities title: "Стиралка" - show_header_toggle: true + show_header_toggle: false entities: + - sensor.washer_hourly - sensor.washer_dialy - sensor.washer_monthly - - sensor.washer_hourly + - sensor.washer_money_monthly - type: entities title: "Телевизор" - show_header_toggle: true + show_header_toggle: false entities: + - sensor.tv_hourly - sensor.tv_dialy - sensor.tv_monthly - - sensor.tv_hourly + - sensor.tv_money_monthly - type: entities title: "Термопот" - show_header_toggle: true + show_header_toggle: false entities: - - sensor.thermopot_dialy - - sensor.thermopot_monthly - - sensor.thermopot_hourly + - sensor.thermopot_hourly2 + - sensor.thermopot_dialy2 + - sensor.thermopot_monthly2 + - sensor.thermopot_money_monthly - type: entities title: "Кондиционер" - show_header_toggle: true + show_header_toggle: false entities: + - sensor.conditioner_hourly - sensor.conditioner_dialy - sensor.conditioner_monthly - - sensor.conditioner_hourly + - sensor.conditioner_money_monthly - title: "Настройки" icon: mdi:settings cards: @@ -288,7 +291,7 @@ views: cards: - type: entities title: "ОС" - show_header_toggle: true + show_header_toggle: false entities: - sensor.processor_use - sensor.memory_free @@ -297,7 +300,7 @@ views: - sensor.ssl_certificate_expiry - type: entities title: "Сеть" - show_header_toggle: true + show_header_toggle: false entities: - sensor.speedtest_ping - sensor.speedtest_download