homeassistant/template.yaml
2025-08-06 22:43:18 +02:00

108 lines
4.8 KiB
YAML

- sensor:
# # Shelly3EM
# - unique_id: shelly3em_energy_total
# name: "Shelly3EM Energy Total"
# icon: mdi:lightning-bolt
# availability: >-
# {{ states('sensor.shelly3em_phase_a_energy') not in ['0', 'unknown', 'unavailable', 'none'] and
# states('sensor.shelly3em_phase_b_energy') not in ['0', 'unknown', 'unavailable', 'none'] and
# states('sensor.shelly3em_phase_c_energy') not in ['0', 'unknown', 'unavailable', 'none'] }}
# state: >-
# {{ (states('sensor.shelly3em_phase_a_energy')|float(1) +
# states('sensor.shelly3em_phase_b_energy')|float(1) +
# states('sensor.shelly3em_phase_c_energy')|float(1)) | round(2) }}
# unit_of_measurement: kWh
# device_class: energy
# state_class: total_increasing
# - unique_id: shelly3em_power_total
# name: "Shelly3EM Power Total"
# icon: mdi:flash
# state: >-
# {{ (states('sensor.shelly3em_phase_a_power')|float(1) +
# states('sensor.shelly3em_phase_b_power')|float(1) +
# states('sensor.shelly3em_phase_c_power')|float(1)) | round(2) }}
# unit_of_measurement: W
# device_class: power
# state_class: measurement
# Klimatizace - aktuální teplota
- unique_id: ac_livingroom_current_temperature
name: "AC Livingroom Current temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
state: >
{{ state_attr('climate.ac_livingroom', 'current_temperature') }}
- unique_id: ac_bathroom_current_temperature
name: "AC Bathroom Current temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
state: >
{{ state_attr('climate.ac_bathroom', 'current_temperature') }}
- unique_id: ac_bedroom_current_temperature
name: "AC Bedroom Current temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
state: >
{{ state_attr('climate.ac_bedroom', 'current_temperature') }}
- unique_id: ac_childrensroom_current_temperature
name: "AC Childrensroom Current temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
state: >
{{ state_attr('climate.ac_childrensroom', 'current_temperature') }}
- unique_id: ac_guestroom_current_temperature
name: "AC Guestroom Current temperature"
unit_of_measurement: "°C"
icon: mdi:thermometer
state: >
{{ state_attr('climate.ac_guestroom', 'current_temperature') }}
# Korekce teploty: Teplota, kterou měří jednotka - skutečná v místnosti
- unique_id: livingroom_temperature_correction
name: "Livingroom Temperateure Correction"
unit_of_measurement: "°C"
icon: mdi:thermometer-check
state: >
{{ (states('sensor.ac_livingroom_current_temperature')|float - states('sensor.livingroom_thermometer_hygrometer_temperature')|float) | round(0) }}
- unique_id: bathroom_temperature_correction
name: "Bathroom Temperateure Correction"
unit_of_measurement: "°C"
icon: mdi:thermometer-check
state: >
{{ (states('sensor.ac_bathroom_current_temperature')|float - states('sensor.bathroom_thermometer_hygrometer_temperature')|float) | round(0) }}
- unique_id: bedroom_temperature_correction
name: "Bedroom Temperateure Correction"
unit_of_measurement: "°C"
icon: mdi:thermometer-check
state: >
{{ (states('sensor.ac_bedroom_current_temperature')|float - states('sensor.bedroom_thermometer_hygrometer_temperature')|float) | round(0) }}
- unique_id: childrensroom_temperature_correction
name: "Childrensroom Temperateure Correction"
unit_of_measurement: "°C"
icon: mdi:thermometer-check
state: >
{{ (states('sensor.ac_childrensroom_current_temperature')|float - states('sensor.childrensroom_thermometer_hygrometer_temperature')|float) | round(0) }}
- unique_id: guestroom_temperature_correction
name: "Guestroom Temperateure Correction"
unit_of_measurement: "°C"
icon: mdi:thermometer-check
state: >
{{ (states('sensor.ac_guestroom_current_temperature')|float - states('sensor.guestroom_thermometer_hygrometer_temperature')|float) | round(0) }}
# # Aktuální nákupní cena elektřiny - VT/NT
# - name: "Electricity Buy Price"
# unique_id: electricity_buy_price
# unit_of_measurement: "CZK/kWh"
# state_class: measurement
# icon: mdi:cash-minus
# state: >
# {% set price_vt = 3.37067 %}
# {% set price_nt = 2.85523 %}
# {% set vat = 21 %}
# {% if is_state("binary_sensor.electricity_hdo_nt", "on") %}
# {{ (price_nt|float * (1 + vat / 100)) | round(2) }} {# Nízký tarif #}
# {% else %}
# {{ (price_vt|float * (1 + vat / 100)) | round(2) }} {# Vysoký tarif #}
# {% endif %}