Compare commits

...

2 Commits

Author SHA1 Message Date
77cd7582c4 packages 2025-11-03 14:29:43 +01:00
4525023fdf packages 2025-11-03 14:29:39 +01:00
3 changed files with 291 additions and 0 deletions

3
.gitignore vendored
View File

@ -21,6 +21,9 @@
# Uncomment this if you don' want to include secrets.yaml # Uncomment this if you don' want to include secrets.yaml
# secrets.yaml # secrets.yaml
# Packages
!packages
# Ignore these files/folders # Ignore these files/folders
.storage .storage
.cloud .cloud

View File

@ -0,0 +1,121 @@
# Klimatizace
homeassistant:
customize_domain:
climate:
# hvac_modes: auto, cool, dry, fan_only, heat, off
hvac_modes:
- heat
- cool
- dry
- fan_only
- "off"
input_select:
air_conditioner:
name: Klimatizace
options:
- livingroom
- bathroom
- bedroom
- childrensroom
- guestroom
initial: livingroom
icon: mdi:air-conditioner
template:
- sensor:
# 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') }}
# Klimatizace - režimm automatizace
- unique_id: ac_mode
name: "AC Mode"
icon: mdi:hvac
state: >
{% if ((11,1) <= (now().month, now().day)) or ((now().month, now().day) <= (3,31)) %}
heat
{% elif (7,1) <= (now().month, now().day) <= (8,31) %}
cold
{% else %}
none
{% endif %}
# 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) }}
climate:
- platform: generic_thermostat
name: Heating mirror
heater: switch.upper_bathroom_heating_mirror
target_sensor: sensor.upper_bathroom_thermometer_hygrometer_temperature
min_temp: 16
max_temp: 24
ac_mode: false
target_temp: 22
cold_tolerance: 0.3
hot_tolerance: 0
min_cycle_duration:
seconds: 5
keep_alive:
minutes: 3
initial_hvac_mode: "off"
away_temp: 16
precision: 1

167
packages/electricity.yaml Normal file
View File

@ -0,0 +1,167 @@
input_number:
# výkupní cena
electricity_sell_price:
name: "Electricity Sell Price"
icon: mdi:cash-plus
step: 0.1
min: 0
max: 10
unit_of_measurement: CZK/kWh
# Nákupní cena - nízký tarif + distribuce + Systémové služby + Daň z elektřiny
electricity_buy_price_nt:
name: "Electricity Buy Price NT"
icon: mdi:cash-minus
#initial: 2855.23
min: 0
max: 10000
step: 0.01
mode: box
unit_of_measurement: CZK/MWh
# Nákupní cena - vysoký tarif + distribuce + Systémové služby + Daň z elektřiny
electricity_buy_price_vt:
name: "Electricity Buy Price VT"
icon: mdi:cash-minus
#initial: 3370.67
min: 0
max: 10000
step: 0.01
mode: box
unit_of_measurement: CZK/MWh
# Stálý měsíční plat - poplpatek + provoz nesíťové infrastruktury + jistič 3x25 A
electricity_fix_month:
name: "Electricity Price Monthly Fee"
icon: mdi:cash-sync
#initial: 578.84
min: 0
max: 1000
step: 0.01
mode: box
unit_of_measurement: CZK/Month
template:
- binary_sensor:
# Spínání HDO - nízký tarif
- name: "Electricity HDO NT"
unique_id: electricity_hdo_nt
icon: mdi:transmission-tower
state: >-
{% set vt_hours = [10, 12, 14, 17] %}
{% set now = now() %}
{% if now.hour not in vt_hours %}
{{ true }} {# Nízký tarif #}
{% else %}
{{ false }} {# Vysoký tarif #}
{% endif %}
- sensor:
# Stav HDO - VT/NT
- name: "Electricity HDO"
unique_id: electricity_hdo
icon: mdi:transmission-tower
state: >
{% if is_state("binary_sensor.electricity_hdo_nt", "on") %}
{{ "NT" }} {# Nízký tarif #}
{% else %}
{{ "VT" }} {# Vysoký tarif #}
{% endif %}
# 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 = states('input_number.electricity_buy_price_vt')|float / 1000 %}
{% set price_nt = states('input_number.electricity_buy_price_nt')|float / 1000 %}
{% 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 %}
# Stálý měsíční plat
- name: "Electricity Standing Charge"
unique_id: electricity_standing_charge
state: "0"
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
# Shelly3EM
- name: "Shelly3EM Energy Total"
unique_id: 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 +
states('sensor.shelly3em_phase_b_energy')|float +
states('sensor.shelly3em_phase_c_energy')|float) | round(2) }}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "Shelly3EM Power Total"
unique_id: shelly3em_power_total
icon: mdi:flash
state: >-
{{ (states('sensor.shelly3em_phase_a_power')|float +
states('sensor.shelly3em_phase_b_power')|float +
states('sensor.shelly3em_phase_c_power')|float) | round(2) }}
unit_of_measurement: W
device_class: power
state_class: measurement
# TUV
- name: "TUV Energy Total"
unique_id: tuv_energy_total
icon: mdi:lightning-bolt
availability: >-
{{ states('sensor.bathroom_boiler_plug_energy') not in ['0', 'unknown', 'unavailable', 'none'] and
states('sensor.fvetuv_feedback_energy') not in ['0', 'unknown', 'unavailable', 'none'] }}
state: >-
{{ (states('sensor.bathroom_boiler_plug_energy')|float +
states('sensor.fvetuv_feedback_energy')|float) | round(2) }}
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
- name: "TUV Power Total"
unique_id: tuv_power_total
icon: mdi:flash
state: >-
{{ (states('sensor.bathroom_boiler_plug_power')|float +
states('sensor.fvetuv_feedback_power')|float) | round(2) }}
unit_of_measurement: W
device_class: power
state_class: measurement
- name: "TUV Heater"
unique_id: tuv_heater
icon: mdi:water-boiler-auto
state: >-
{% set tuv2kw = states('sensor.bathroom_boiler_plug_power') %}
{% set tuv4kw = states('sensor.fvetuv_feedback_power') %}
{% if is_number(tuv2kw) and tuv2kw|float > 0 %}
{{ "1f.2kW" }} {# distribuce #}
{% elif is_number(tuv4kw) and tuv4kw|float > 0 %}
{{ "3f.4kW" }} {# přetok fve #}
{% else %}
{{ "-" }}
{% endif %}
- trigger:
- trigger: time_pattern
hours: "/1"
sensor:
- name: Electricity Fixed Hourly Charge
unique_id: electricity_fixed_hourly_charge
icon: mdi:cash-minus
state: >-
{% set hours = ((as_timestamp(now()) - as_timestamp(as_datetime('2025-06-01'))) / 3600) %}
{% set vat = 21 %}
{{ ((hours + 1) * (states("input_number.electricity_fix_month") |float * 12 / 365 / 24) * (1 + vat / 100)) | round(2) }}
unit_of_measurement: "CZK"
state_class: total_increasing