Skip to content

Instantly share code, notes, and snippets.

@hectorzin
Last active September 14, 2024 10:41
Show Gist options
  • Save hectorzin/a9d3b2c02852595c61e8bf2f66184422 to your computer and use it in GitHub Desktop.
Save hectorzin/a9d3b2c02852595c61e8bf2f66184422 to your computer and use it in GitHub Desktop.
Termostato para infrarrojos
#####################################
# AIRE ACONDICIONADO MODO FRÍO #
#####################################
climate:
- platform: generic_thermostat
name: "Aire acondicionado salón"
unique_id: "termostato_aire_acondicionado"
heater: switch.aire_abajo
target_sensor: sensor.termostato_calefaccion
min_temp: 22
max_temp: 30
ac_mode: true
cold_tolerance: 0.5
hot_tolerance: 0.5
precision: 0.5
target_temp_step: 0.5
- platform: generic_thermostat
name: "Aire acondicionado calor salón"
unique_id: "aire_acondicionado_calor_salon"
heater: switch.aire_abajo_calor
target_sensor: sensor.termostato_calefaccion
min_temp: 16
max_temp: 24
ac_mode: false
cold_tolerance: 0.5
hot_tolerance: 0.5
precision: 0.5
target_temp_step: 0.5
switch:
- platform: template
switches:
aire_abajo:
unique_id: "aire_acondicionado_abajo"
friendly_name: "Aire Abajo"
turn_on:
service: scene.turn_on
data_template:
entity_id: >
{% set temp = state_attr('climate.aire_acondicionado', 'temperature') | int %}
{% if temp >= 27 %}
scene.aire_abajo_26
{% elif temp >= 26 %}
scene.aire_abajo_25
{% elif temp >= 25 %}
scene.aire_abajo_24
{% elif temp >= 24 %}
scene.aire_abajo_23
{% else %}
scene.aire_abajo_22
{% endif %}
turn_off:
service: scene.turn_on
target:
entity_id: scene.apagar_aire_abajo
aire_abajo_calor:
unique_id: "aire_acondicionado_calor_abajo"
friendly_name: "Aire abajo calor"
turn_on:
service: scene.turn_on
data_template:
entity_id: >
{% set temp = state_attr('climate.aire_acondicionado_calor_salon', 'temperature') | int %}
{% if temp >= 16 %}
scene.aire_abajo_caliente_17
{% elif temp >= 17 %}
scene.aire_abajo_caliente_18
{% elif temp >= 18 %}
scene.aire_abajo_caliente_19
{% elif temp >= 19 %}
scene.aire_abajo_caliente_20
{% elif temp >= 20 %}
scene.aire_abajo_caliente_21
{% elif temp >= 21 %}
scene.aire_abajo_caliente_22
{% elif temp >= 22 %}
scene.aire_abajo_caliente_23
{% elif temp >= 23 %}
scene.aire_abajo_caliente_24
{% else %}
scene.aire_abajo_caliente_25
{% endif %}
turn_off:
service: scene.turn_on
target:
entity_id: scene.apagar_aire_abajo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment