Advertisement
seston

configuration.yaml 18.09.2022

Sep 18th, 2022 (edited)
958
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.40 KB | None | 0 0
  1. # Loads default set of integrations. Do not remove.
  2. default_config:
  3. # Text to speech
  4. tts:
  5.   - platform: google_translate
  6.  
  7. automation: !include automations.yaml
  8. script: !include scripts.yaml
  9. scene: !include scenes.yaml
  10. #sensor: !include sensors.yaml
  11. #secret: !include secrets.yaml
  12. lovelace:
  13.   resources:
  14.   - url: /local/apexcharts-card.js?v=1.10.0
  15.     type: module
  16. frontend:
  17.   themes: !include_dir_merge_named themes
  18. template:
  19.   - sensor:
  20.     - name: keskminetemp
  21.       unique_id: keskminetemp
  22.       state: >-
  23.         {% set list=state_attr('weather.openweathermap', 'forecast') %}
  24.         {{ ((list[0].temperature + list[3].temperature + list[7].temperature + list[11].temperature) / 4)|round(1) }}
  25.        
  26.   - sensor:
  27.     - name: keskminetemp_real_feel
  28.       unique_id: keskminetemp_real_feel
  29.       state: >-
  30.         {% set list=state_attr('weather.openweathermap', 'forecast') %}
  31.         {% set temp_rf_0=13.2+0.6215*list[0].temperature-11.37*(list[0].wind_speed**0.16)+0.3965*list[0].temperature*(list[0].wind_speed**0.16)|float %}
  32.         {% set temp_rf_4=13.2+0.6215*list[4].temperature-11.37*(list[4].wind_speed**0.16)+0.3965*list[4].temperature*(list[4].wind_speed**0.16)|float %}
  33.         {% set temp_rf_8=13.2+0.6215*list[8].temperature-11.37*(list[8].wind_speed**0.16)+0.3965*list[8].temperature*(list[8].wind_speed**0.16)|float %}
  34.         {% set temp_rf_12=13.2+0.6215*list[12].temperature-11.37*(list[12].wind_speed**0.16)+0.3965*list[12].temperature*(list[12].wind_speed**0.16)|float %}
  35.         {{ ((temp_rf_0+temp_rf_4+temp_rf_8+temp_rf_12)/4)|round(1) }}
  36.  
  37.   - sensor:
  38.     - name: heatrequest
  39.       unique_id: heatrequest
  40.       state: >-
  41.         {% set req_hours = (states('sensor.keskminetemp_real_feel')|int - 6) * -0.5 + 6 + states('input_number.pumbatunnid_input')|int %}
  42.         {% if (req_hours > 24) %}
  43.            req_hours=24
  44.         {% elif (req_hours < states('input_number.pumbatunnid_min_input')|int) %}
  45.           {% set req_hours=states('input_number.pumbatunnid_min_input')|int %}
  46.         {% endif %}
  47.         {{ req_hours|int }}
  48.  
  49.  
  50.   - binary_sensor:
  51.       - name: pumba taimer
  52.         unique_id: pumba_taimer
  53.         state: >-
  54.           {% set l=state_attr('sensor.nordpool_mwh_ee_eur_3_10_02', 'raw_today')|sort(attribute='value') %}
  55.           {% set t = now() %}
  56.           {% for i in range(states('sensor.heatrequest')|int) %}
  57.             {% if (t >= l[i].start and t <= l[i].end) %}
  58.               {{ true }}
  59.             {% endif %}
  60.           {% endfor %}
  61.  
  62.        
  63.   - sensor:
  64.     - name: Päeva odavaim hind
  65.       unique_id: odavhind
  66.       state: >-
  67.         {% set l=state_attr('sensor.nordpool_mwh_ee_eur_3_10_02', 'raw_today')|sort(attribute='value') %}
  68.         {{ l[states('sensor.heatrequest')|int-1].value }}
  69.          
  70.        
  71. switch:
  72.   - platform: rpi_gpio
  73.     ports:
  74.       17: soojuspump
  75.       18: reserv
  76.      
  77. automation Soojuspumba juhtimine:
  78.     initial_state: 'on'
  79.     alias: Soojuspumba juhtimine
  80.     trigger:
  81.       - platform: state
  82.         entity_id: binary_sensor.pumba_taimer
  83.         to: 'on'
  84.       - platform: state
  85.         entity_id: binary_sensor.pumba_taimer
  86.         to: 'off'
  87.     action:
  88.       - service_template: 'switch.turn_{{trigger.to_state.state}}'
  89.         entity_id: switch.soojuspump
  90.  
  91. automation Soojuspumba juhtimine2:
  92.     alias: kontroll
  93.     trigger:
  94.       - platform: time
  95.         at:
  96.        - '00:01:00'
  97.     condition:
  98.       condition: state
  99.       entity_id: binary_sensor.pumba_taimer
  100.       state: "on"
  101.     action:
  102.       - service: 'switch.turn_on'
  103.         entity_id: switch.soojuspump
  104.        
  105. input_number:
  106.   pumbatunnid_input:
  107.     name: pumbatunnid_input
  108.     min: -3
  109.     max: 3
  110.     step: 1
  111.     unit_of_measurement: h
  112.   pumbatunnid_min_input:
  113.     name: pumbatunnid_min_input
  114.     min: 0
  115.     max: 5
  116.     step: 1
  117.     unit_of_measurement: h
  118.  
  119. sensor:
  120.   - platform: nordpool
  121.     low_price_cutoff: 1
  122.     VAT: true
  123.     region: "EE"
  124.     precision: 3
  125.     price_type: MWh
  126.     additional_costs: '{% set s = { "day": 37300, "night": 21400 } %} {% if now().weekday() in (5,6) %} {{s.night|float}} {% else %} {% if now().hour >= 7 and now().hour < 22%} {{s.day|float}} {% else %} {{s.night|float}} {% endif %} {% endif %}'
  127.  
  128. ##### Proximity integration ####################################
  129. proximity:
  130.   home:
  131.     devices:
  132.      - person.kakaduuuuuu #@irw
  133.     tolerance: 1
  134.     unit_of_measurement: km
  135.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement