5999 lines
171 KiB
YAML
5999 lines
171 KiB
YAML
- alias: Abrir puerta con botón Shelly BLU 908F
|
|
id: shelly_blu_908f_abrir_puerta
|
|
trigger:
|
|
- platform: state
|
|
entity_id: event.shelly_blu_button1_908f_button
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.attributes.event_type == ''press'' }}
|
|
|
|
'
|
|
action:
|
|
- service: script.abrir_puerta_principal
|
|
- alias: PKG AC Clima - Quitar away si alguien regresa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
- platform: state
|
|
entity_id: group.simulador_personas
|
|
from: 'off'
|
|
to: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_control_refrigeracion_home
|
|
- alias: PKG AC Encender aire si el climate lo solicita
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- alias: PKG AC Apagar aire si el climate lo solicita
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.ac_panasonic_ion_motivo_apagado
|
|
data:
|
|
value: '{{ states(''sensor.ac_panasonic_ion_motivo_apagado'') }}'
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.ac_panasonic_ion_ultima_desconexion
|
|
data:
|
|
value: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
|
|
- alias: PKG AC Iniciar temporizador al encender en modo AUTO
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ac_panasonic_ion_modo
|
|
state: auto
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.ac_panasonic_ion_temporizador
|
|
duration: "{{ '%02d:%02d:00' | format(\n (states('input_number.ac_panasonic_ion_temporizador_minutos')\
|
|
\ | int // 60),\n (states('input_number.ac_panasonic_ion_temporizador_minutos')\
|
|
\ | int % 60)\n) }}\n"
|
|
- alias: PKG AC Apagar aire al finalizar temporizador
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.ac_panasonic_ion_temporizador
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
state: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
- alias: PKG AC Ajustar AC al cambiar umbrales
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- input_number.pkg_ind_umbral_maximo
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_control_refrigeracion
|
|
data:
|
|
st_target: input_number.pkg_ind_umbral_maximo
|
|
st_real: sensor.ac_panasonic_ion_sensacion_termica
|
|
- id: AC_actualizar_estado
|
|
alias: AC - Actualizar estado
|
|
trigger:
|
|
- platform: event
|
|
event_type: call_service
|
|
event_data:
|
|
domain: remote
|
|
service: script.aire_acondicionado_power
|
|
action:
|
|
- service: input_boolean.toggle
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado
|
|
mode: single
|
|
- id: AC_actualizacion_timer
|
|
alias: AC - Actualización timer
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_number.aire_acondicionado_timer
|
|
condition:
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: active
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.aire_acondicionado_timer'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- id: AC_encender_temporizador
|
|
alias: Encender AC cuando se active temporizador
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: active
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'off'
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_y_finalizar
|
|
alias: Apagar AC y finalizar temporizador
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: idle
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'off'
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
- service: timer.finish
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- id: AC_encender_modo_temperatura
|
|
alias: Encender A/C al activar modo temperatura
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'on'
|
|
- platform: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
above: 0
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'off'
|
|
- condition: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
above: 0
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_por_temperatura
|
|
alias: Apagar A/C al alcanzar temperatura objetivo
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.aire_acondicionado_temperatura
|
|
- platform: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
below: 0.1
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
- condition: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
below: 0.1
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_apagar_modo_manual
|
|
alias: Apagar A/C al desactivar modo temperatura manualmente
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: idle
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_modo_si_ac_se_apaga_manual
|
|
alias: Desactivar modo temperatura al apagar A/C manualmente
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_temporizador_on_apaga_modo
|
|
alias: Aire acondicionado - Modo temperatura + Temporizador (on)
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: active
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_modo_on_apaga_temporizador
|
|
alias: Aire acondicionado - Temporizador + Modo temperatura (on)
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: active
|
|
action:
|
|
- service: timer.finish
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- alias: Notificar puerta abierta más de 10 minutos
|
|
id: notificar_puerta_abierta_10min
|
|
description: Envía una notificación si la puerta está abierta 10 minutos
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.puerta_principal_door_2
|
|
to: 'on'
|
|
for: 00:10:00
|
|
condition:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unlocked
|
|
action:
|
|
- action: notify.mobile_app_sm_a155f
|
|
data:
|
|
title: 🚪 Puerta principal abierta
|
|
message: La puerta lleva abierta más de 10 minutos. ¿Quieres cerrarla?
|
|
data:
|
|
actions:
|
|
- action: SABE_ABIERTA
|
|
title: Sí, lo sé
|
|
- action: CERRAR_PUERTA
|
|
title: Ciérrala ahora
|
|
- alias: Responder notificación interactiva - cerrar puerta
|
|
id: respuesta_cerrar_puerta
|
|
description: Ejecuta el script para cerrar la puerta si el usuario pulsa "Ciérrala
|
|
ahora"
|
|
trigger:
|
|
- platform: event
|
|
event_type: mobile_app_notification_action
|
|
event_data:
|
|
action: CERRAR_PUERTA
|
|
condition:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unlocked
|
|
- condition: state
|
|
entity_id: binary_sensor.puerta_principal_door_2
|
|
state: 'on'
|
|
action:
|
|
- service: script.cerrar_puerta_principal
|
|
- alias: Registrar respuesta "sí, lo sé"
|
|
id: respuesta_sabe_abierta
|
|
description: Solo registra que el usuario lo sabe (opcional)
|
|
trigger:
|
|
- platform: event
|
|
event_type: mobile_app_notification_action
|
|
event_data:
|
|
action: SABE_ABIERTA
|
|
action:
|
|
- service: logbook.log
|
|
data:
|
|
name: Puerta principal
|
|
message: El usuario ha confirmado que sabía que estaba abierta
|
|
- id: alerta_co2_activada
|
|
alias: Alerta CO2 activada
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.alerta_co2
|
|
to: 'on'
|
|
action:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_pinguino
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: '<b>Alerta CO2</b>: {{ states(''sensor.zigbee_heiman_hs3aq_01_co2'')
|
|
}}ppm '
|
|
mode: single
|
|
- id: alerta_co2_desactivada
|
|
alias: Alerta CO2 desactivada
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.alerta_co2
|
|
to: 'off'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_pinguino
|
|
mode: single
|
|
- alias: Guardar peso Pau
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_pau_peso
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_pau_peso_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar impedancia Pau
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_pau_impedance
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_pau_impedance_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar impedancia baja Pau
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_pau_impedance_low
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_pau_impedance_low_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar peso Ramón
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_ramon_peso
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_ramon_peso_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar impedancia Ramón
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_ramon_impedance
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_ramon_impedance_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar impedancia baja Ramón
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_bodymiscale_ramon_impedance_low
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_bodymiscale_ramon_impedance_low_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar peso Ramón
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_salut_ramon_peso
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_salut_ramon_peso_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar IMC Ramón
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_salut_ramon_imc
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_salut_ramon_imc_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar peso Pau
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_salut_pau_peso
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_salut_pau_peso_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- alias: Guardar IMC Pau
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.pkg_salut_pau_imc
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.state | float(0) > 0 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.pkg_salut_pau_imc_last
|
|
value: '{{ trigger.to_state.state | float(0) }}'
|
|
- id: boton_send_confort
|
|
alias: Send Confort
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.send_confort
|
|
conditions: []
|
|
action:
|
|
- service: rest_command.send_to_influxdb
|
|
data:
|
|
value: '{{ states(''input_number.nivel_confort_actual'') | float }}'
|
|
mode: single
|
|
- id: '1735560626804'
|
|
alias: Calendar DL
|
|
description: ''
|
|
triggers:
|
|
- trigger: calendar
|
|
entity_id: calendar.domotica
|
|
event: start
|
|
offset: -0:5:0
|
|
conditions: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Calendar {{ trigger.calendar_event.summary }} at {{trigger.calendar_event.start
|
|
}}
|
|
mode: single
|
|
- alias: Iniciar o reiniciar temporizador de bloqueo al cerrar puerta
|
|
id: iniciar_temporizador_bloqueo_puerta
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.puerta_principal_door_2
|
|
to: 'off'
|
|
action:
|
|
- service: timer.start
|
|
target:
|
|
entity_id: timer.bloqueo_puerta_principal
|
|
- service: system_log.write
|
|
data:
|
|
level: info
|
|
message: Temporizador iniciado al cerrarse la puerta principal
|
|
- alias: Bloquear puerta al terminar temporizador
|
|
id: bloquear_puerta_tras_temporizador
|
|
mode: single
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.bloqueo_puerta_principal
|
|
condition:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unlocked
|
|
- condition: state
|
|
entity_id: binary_sensor.puerta_principal_door_2
|
|
state: 'off'
|
|
action:
|
|
- service: lock.lock
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- service: system_log.write
|
|
data:
|
|
level: info
|
|
message: Puerta principal bloqueada automáticamente tras cierre y temporizador
|
|
- alias: Clima Adaptativo con Predicción
|
|
id: clima_adaptativo_prediccion
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_button.n8n_test
|
|
action:
|
|
- service: rest_command.clima_adaptativo
|
|
- id: luces_cortesia
|
|
alias: Dispositivos de cortesía al abrir la puerta
|
|
description: Enciende los dispositivos con etiqueta "cortesia" si estaban apagados
|
|
y los apaga después
|
|
mode: restart
|
|
trigger:
|
|
- platform: conversation
|
|
command: test
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_entrada
|
|
from: 'off'
|
|
to: 'on'
|
|
condition:
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.my_box_2
|
|
state: 'on'
|
|
action:
|
|
- variables:
|
|
dispositivos_a_encender: "{% set dispositivos = states.switch\n | selectattr('attributes.custom_etiquetas',\
|
|
\ 'defined')\n | selectattr('attributes.custom_etiquetas', 'search', 'cortesia')\n\
|
|
\ | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id') | list\
|
|
\ %}\n{{ dispositivos }}"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dispositivos_a_encender | length > 0 }}'
|
|
sequence:
|
|
- service: switch.turn_on
|
|
data:
|
|
entity_id: '{{ dispositivos_a_encender }}'
|
|
- delay: 00:03:00
|
|
- service: switch.turn_off
|
|
data:
|
|
entity_id: '{{ dispositivos_a_encender }}'
|
|
- id: custom_temporizador1_automation_on
|
|
alias: Reloj 1 on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.custom_temporizador1_toggle
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.custom_temporizador1_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.custom_temporizador1
|
|
mode: single
|
|
- id: custom_temporizador1_automation_off
|
|
alias: Reloj 1 off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.custom_temporizador1
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Temporizador1 off
|
|
mode: single
|
|
- id: custom_temporizador2_automation_on
|
|
alias: Reloj 2 on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.custom_temporizador2_toggle
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.custom_temporizador2_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.custom_temporizador2
|
|
mode: single
|
|
- id: custom_temporizador2_automation_off
|
|
alias: Reloj 2 off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.custom_temporizador2
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Temporizador 2 off
|
|
mode: single
|
|
- id: pc_wake_up
|
|
alias: '[PC] Se ha despertado'
|
|
trigger:
|
|
- platform: mqtt
|
|
topic: iotlink/workgroup/pc-gaming/lwt
|
|
payload: 'ON'
|
|
condition: []
|
|
action:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- id: boton_shelly_1_double
|
|
alias: Boton shelly H&T (double)
|
|
description: ''
|
|
triggers:
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: double_press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_2
|
|
mode: single
|
|
- alias: Encender luz piano con botón Shelly BLU 908F
|
|
id: shelly_blu_908f_luz_piano
|
|
trigger:
|
|
- platform: state
|
|
entity_id: event.shelly_blu_button1_908f_button
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ trigger.to_state.attributes.event_type == ''double_press''
|
|
}}
|
|
|
|
'
|
|
action:
|
|
- service: hassio.addon_restart
|
|
data:
|
|
addon: 45df7312_zigbee2mqtt
|
|
- service: system_log.write
|
|
data:
|
|
message: Zigbee2MQTT reiniciado automáticamente por sensores caídos.
|
|
level: warning
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- id: sincronizar_dos_enchufes
|
|
alias: Sincronizar dos enchufes
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
action:
|
|
- delay: 00:00:02
|
|
- service: switch.turn_{{ trigger.to_state.state }}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_2
|
|
mode: single
|
|
- alias: Encender y apagar leds ESP32 Proxy según ubicación y áreas activas
|
|
description: 'Enciende leds de ESP32 en áreas activas donde esté alguien.
|
|
|
|
'
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- input_select.ubicacion_ramon
|
|
- input_select.ubicacion_pau
|
|
- platform: state
|
|
entity_id: sensor.esp32_btproxy_areas
|
|
variables:
|
|
ubicaciones: '{{ [ states(''input_select.ubicacion_ramon''), states(''input_select.ubicacion_pau'')
|
|
] }}
|
|
|
|
'
|
|
areas_activas: '{{ states(''sensor.esp32_btproxy_areas'').split('','') | reject(''equalto'',
|
|
'''') | list }}
|
|
|
|
'
|
|
leds_presentes: "{{ areas_activas | select('in', ubicaciones)\n \
|
|
\ | map('regex_replace', '^(.*)$', 'light.esp32_btproxy_\\\\1_led_area')\n\
|
|
\ | list }}\n"
|
|
all_leds: "{{ states.light\n | selectattr('entity_id', 'search', '^light\\\\\
|
|
.esp32_btproxy_.*_led_area$')\n | map(attribute='entity_id')\n | list\
|
|
\ }}\n"
|
|
leds_ausentes: '{{ all_leds | reject(''in'', leds_presentes) | list }}
|
|
|
|
'
|
|
action:
|
|
- service: light.turn_off
|
|
data:
|
|
entity_id: '{{ leds_ausentes }}'
|
|
- service: light.turn_on
|
|
data:
|
|
entity_id: '{{ leds_presentes }}'
|
|
- id: nfc_etiqueta_piano
|
|
alias: NFC etiqueta mesapiano
|
|
mode: single
|
|
trigger:
|
|
- platform: conversation
|
|
command: piano
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
action:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- id: nfc_etiqueta_yale_exterior
|
|
alias: NFC etiqueta yale interior
|
|
mode: single
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_exterior
|
|
action:
|
|
- action: script.abrir_puerta_principal
|
|
- id: nfc_etiqueta_yale_interior
|
|
alias: NFC etiqueta yale interior
|
|
mode: single
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_door
|
|
action:
|
|
- service: script.secuencia_of_switches
|
|
data:
|
|
my_estado: 'off'
|
|
- alias: Iniciar temporizador extractor bathroom 01 al encender
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
to: 'on'
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.temporizador_extractor_bathroom_01
|
|
mode: single
|
|
- alias: Encender extractor bathroom 01 por humedad alta
|
|
trigger:
|
|
- platform: template
|
|
value_template: "{{ \n states('sensor.cfg_humedad_bathroom_1') | float(0) >\n\
|
|
\ states('sensor.umbral_dinamico_encendido_extractor_bathroom_01') | float(70)\
|
|
\ \n}}\n"
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
state: 'off'
|
|
action:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
mode: single
|
|
- alias: Apagar extractor bathroom 01 por humedad baja
|
|
trigger:
|
|
- platform: template
|
|
value_template: "{{ \n states('sensor.cfg_humedad_bathroom_1') | float(0) <\n\
|
|
\ states('sensor.umbral_dinamico_apagado_extractor_bathroom_01') | float(70)\
|
|
\ \n}}\n"
|
|
for: 00:03:00
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
state: 'on'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
mode: single
|
|
- alias: Apagar extractor bathroom 01 tras x minutos (por temporizador)
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.temporizador_extractor_bathroom_01
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
state: 'on'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
mode: single
|
|
- alias: Parar temporizador extractor baño 01 si se apaga
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.alias_aire_extractor_bathroom_01
|
|
to: 'off'
|
|
action:
|
|
- service: timer.cancel
|
|
data:
|
|
entity_id: timer.temporizador_extractor_bathroom_01
|
|
mode: single
|
|
- alias: Aviso de lluvia próximas 12 horas con debug
|
|
id: aviso_lluvia_12h_debug
|
|
trigger:
|
|
- platform: time
|
|
at: 08:00:00
|
|
- platform: state
|
|
entity_id: binary_sensor.salida_casa_detectada
|
|
to: 'on'
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_despacho
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
- platform: state
|
|
entity_id: binary_sensor.ramon_en_habitacion_02
|
|
to: 'off'
|
|
- platform: state
|
|
entity_id: sensor.multi_forecast_home_rain_next_12h
|
|
to: 'yes'
|
|
action:
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: weather.forecast_home
|
|
data:
|
|
type: hourly
|
|
response_variable: pronostico
|
|
- service: python_script.forecast_processor
|
|
data:
|
|
location: home
|
|
forecast: '{{ pronostico[''weather.forecast_home''][''forecast''] }}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set condiciones = [''rainy'',''pouring'',''hail'',''lightning'',''lightning-rainy'',''snowy-rainy'']
|
|
%} {% set fc = pronostico[''weather.forecast_home''][''forecast''] | default([])
|
|
%} {{ fc[:24] | selectattr(''condition'',''defined'') | selectattr(''condition'',''in'',condiciones)
|
|
| list | count > 0 }}
|
|
|
|
'
|
|
sequence:
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: '🌧️ Parece que hoy va a llover. No te olvides el paraguas ☂️
|
|
|
|
🔹 Pronóstico completo (próximas 24h):
|
|
|
|
{% for f in pronostico[''weather.forecast_home''][''forecast''][:24] %}
|
|
- {{ as_datetime(f.datetime).strftime(''%H:%M'') }}: {{ f.condition }},
|
|
T: {{ f.temperature }}°C {% endfor %}
|
|
|
|
'
|
|
default:
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: "☀️ No hay previsión de lluvia en las próximas 24h.\n\U0001F539 Pronóstico\
|
|
\ completo (próximas 24h):\n \n{% for f in pronostico['weather.forecast_home']['forecast'][:24]\
|
|
\ %} - {{ as_datetime(f.datetime).strftime('%H:%M') }}: {{ f.condition }},\
|
|
\ T: {{ f.temperature }}°C {% endfor %}\n"
|
|
- alias: Reset luces alerta forecast
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_button.reset_luces_alerta
|
|
- platform: state
|
|
entity_id: input_boolean.forecast_alert_active
|
|
to: 'off'
|
|
action:
|
|
- action: script.secuencia_by_label
|
|
data:
|
|
my_label: alerta
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
- alias: Reset alerta forecast
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.forecast_alert_active
|
|
to: 'on'
|
|
action:
|
|
- delay: '12:00:00'
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.forecast_alert_active
|
|
- alias: Notificación de alerta meteorológica
|
|
id: forecast_alert_notify
|
|
trigger:
|
|
- platform: event
|
|
event_type: forecast_alert
|
|
action:
|
|
- variables:
|
|
loc: '{{ trigger.event.data.location }}'
|
|
reasons: '{{ trigger.event.data.details }}'
|
|
msg: '⚠️ Alerta meteorológica en {{ loc }}: {{ reasons }}. {% if states(''sun.sun'')
|
|
== ''below_horizon'' %} 🔆 Se han encendido las luces de alerta. {% endif %}'
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.forecast_alert_active
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: '{{ msg }}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sun.sun
|
|
state: below_horizon
|
|
sequence:
|
|
- service: homeassistant.turn_on
|
|
target:
|
|
entity_id: "{{ expand(states.switch, states.light)\n | selectattr('attributes.custom_etiquetas','defined')\n\
|
|
\ | selectattr('attributes.custom_etiquetas','contains','alerta')\n\
|
|
\ | map(attribute='entity_id')\n | list }}\n"
|
|
- alias: Forecast scheduler
|
|
id: forecast_scheduler
|
|
variables:
|
|
weather_entity_home: weather.forecast_home
|
|
weather_entity_work: weather.forecast_work
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_button.get_forecasts
|
|
- platform: time_pattern
|
|
minutes: /30
|
|
action:
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: '{{ weather_entity_home }}'
|
|
data:
|
|
type: hourly
|
|
response_variable: pronostico_home
|
|
- service: python_script.forecast_processor
|
|
data:
|
|
location: home
|
|
forecast: '{{ pronostico_home[weather_entity_home][''forecast''] }}'
|
|
current: "{{\n {\n 'temperature': state_attr(weather_entity_home, 'temperature'),\n\
|
|
\ 'dew_point': state_attr(weather_entity_home, 'dew_point'),\n 'humidity':\
|
|
\ state_attr(weather_entity_home, 'humidity'),\n 'cloud_coverage': state_attr(weather_entity_home,\
|
|
\ 'cloud_coverage'),\n 'uv_index': state_attr(weather_entity_home, 'uv_index'),\n\
|
|
\ 'pressure': state_attr(weather_entity_home, 'pressure'),\n 'wind_speed':\
|
|
\ state_attr(weather_entity_home, 'wind_speed'),\n 'wind_bearing': state_attr(weather_entity_home,\
|
|
\ 'wind_bearing')\n }\n}}\n"
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: '{{ weather_entity_work }}'
|
|
data:
|
|
type: hourly
|
|
response_variable: pronostico_work
|
|
- service: python_script.forecast_processor
|
|
data:
|
|
location: work
|
|
forecast: '{{ pronostico_work[weather_entity_work][''forecast''] }}'
|
|
current: "{{\n {\n 'temperature': state_attr(weather_entity_work, 'temperature'),\n\
|
|
\ 'dew_point': state_attr(weather_entity_work, 'dew_point'),\n 'humidity':\
|
|
\ state_attr(weather_entity_work, 'humidity'),\n 'cloud_coverage': state_attr(weather_entity_work,\
|
|
\ 'cloud_coverage'),\n 'uv_index': state_attr(weather_entity_work, 'uv_index'),\n\
|
|
\ 'pressure': state_attr(weather_entity_work, 'pressure'),\n 'wind_speed':\
|
|
\ state_attr(weather_entity_work, 'wind_speed'),\n 'wind_bearing': state_attr(weather_entity_work,\
|
|
\ 'wind_bearing')\n }\n}}\n"
|
|
- alias: Resumen trayecto moto al desenchufar móvil
|
|
variables:
|
|
weather_entity_home: weather.forecast_home
|
|
weather_entity_work: weather.forecast_work
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_button.get_trip_forecasts
|
|
- platform: state
|
|
entity_id: binary_sensor.salida_casa_detectada
|
|
to: 'on'
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_despacho
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
- platform: state
|
|
entity_id: binary_sensor.ramon_en_habitacion_02
|
|
to: 'off'
|
|
- platform: state
|
|
entity_id: sensor.multi_forecast_home_rain_next_12h
|
|
to: 'yes'
|
|
action:
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: '{{ weather_entity_home }}'
|
|
data:
|
|
type: hourly
|
|
response_variable: pronostico_home
|
|
- action: weather.get_forecasts
|
|
target:
|
|
entity_id: '{{ weather_entity_work }}'
|
|
data:
|
|
type: hourly
|
|
response_variable: pronostico_work
|
|
- service: python_script.forecast_processor
|
|
data:
|
|
location: home
|
|
forecast: '{{ pronostico_home[weather_entity_home][''forecast''] }}'
|
|
current: "{{\n {\n 'temperature': state_attr(weather_entity_home, 'temperature'),\n\
|
|
\ 'dew_point': state_attr(weather_entity_home, 'dew_point'),\n 'humidity':\
|
|
\ state_attr(weather_entity_home, 'humidity'),\n 'cloud_coverage': state_attr(weather_entity_home,\
|
|
\ 'cloud_coverage'),\n 'uv_index': state_attr(weather_entity_home, 'uv_index'),\n\
|
|
\ 'pressure': state_attr(weather_entity_home, 'pressure'),\n 'wind_speed':\
|
|
\ state_attr(weather_entity_home, 'wind_speed'),\n 'wind_bearing': state_attr(weather_entity_home,\
|
|
\ 'wind_bearing')\n }\n}}\n"
|
|
- service: python_script.forecast_processor
|
|
data:
|
|
location: work
|
|
forecast: '{{ pronostico_work[weather_entity_work][''forecast''] }}'
|
|
current: "{{\n {\n 'temperature': state_attr(weather_entity_work, 'temperature'),\n\
|
|
\ 'dew_point': state_attr(weather_entity_work, 'dew_point'),\n 'humidity':\
|
|
\ state_attr(weather_entity_work, 'humidity'),\n 'cloud_coverage': state_attr(weather_entity_work,\
|
|
\ 'cloud_coverage'),\n 'uv_index': state_attr(weather_entity_work, 'uv_index'),\n\
|
|
\ 'pressure': state_attr(weather_entity_work, 'pressure'),\n 'wind_speed':\
|
|
\ state_attr(weather_entity_work, 'wind_speed'),\n 'wind_bearing': state_attr(weather_entity_work,\
|
|
\ 'wind_bearing')\n }\n}}\n"
|
|
- service: python_script.forecast_trip
|
|
data:
|
|
forecast_home: '{{ pronostico_home[weather_entity_home][''forecast''] }}'
|
|
forecast_work: '{{ pronostico_work[weather_entity_work][''forecast''] }}'
|
|
departure_hour: '{{ now().hour }}'
|
|
trip_duration: 8
|
|
current_hour: '{{ now().strftime(''%H:%M'') }}'
|
|
temperature: '{{ states(''sensor.temperatura_exterior'') }}'
|
|
humidity: '{{ states(''sensor.humedad_exterior'') }}'
|
|
- alias: Controlar válvula del salón
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.temperatura_salon
|
|
below: 21
|
|
action:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.valvula_salon
|
|
data:
|
|
hvac_mode: heat
|
|
- id: invierno_calefaccion_toggle
|
|
alias: Boton Invierno calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.invierno
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_interior'') }}'
|
|
mode: single
|
|
- alias: Encender luzled living_1 con presencia
|
|
id: encender_luzled_living_1_presencia
|
|
description: Enciende el luzled si hay presencia en living_1
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_living_1
|
|
to: 'on'
|
|
for:
|
|
seconds: 15
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.my_box_2
|
|
state: 'on'
|
|
action:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id:
|
|
- switch.enchufe_habitacion_socket_1
|
|
- alias: Apagar luzled living_1 sin presencia
|
|
id: apagar_luzled_living_1_sin_presencia
|
|
description: Apaga el luzled si no hay presencia en living_1 y está encendido
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_living_1
|
|
to: 'off'
|
|
for:
|
|
minutes: 3
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
state: 'on'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.enchufe_habitacion_socket_1
|
|
- id: WH_Luz_Habitacion_2
|
|
alias: Webhook luz habitacion_2
|
|
description: ''
|
|
triggers:
|
|
- trigger: webhook
|
|
allowed_methods:
|
|
- POST
|
|
- PUT
|
|
- GET
|
|
local_only: true
|
|
webhook_id: wh_luz_habitacion_2
|
|
conditions: []
|
|
actions:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_4_2
|
|
mode: single
|
|
- alias: Actualizar estado WashingMachine
|
|
id: wm_actualizar_estado
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.washing_machine_ciclo_en_curso
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.washing_machine_ciclo_en_curso
|
|
state: 'on'
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.washingmachine_en_uso
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.washing_machine_ciclo_en_curso
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: input_boolean.washingmachine_en_uso
|
|
state: 'on'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.washingmachine_en_uso
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: WashingMachine terminada
|
|
message: La WashingMachine ha finalizado su ciclo. Puedes vaciarla.
|
|
- alias: Meteocat forzar update manual
|
|
trigger:
|
|
- platform: event
|
|
event_type: input_button.press
|
|
event_data:
|
|
entity_id: input_button.meteocat_update
|
|
action:
|
|
- service: homeassistant.update_entity
|
|
target:
|
|
entity_id: sensor.meteocat_home_raw
|
|
- alias: Meteocat incrementar contador y procesar home
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.meteocat_home_raw
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: input_number.meteocat_call_counter
|
|
below: 10
|
|
sequence:
|
|
- service: input_number.increment
|
|
target:
|
|
entity_id: input_number.meteocat_call_counter
|
|
- service: python_script.meteocat_processor
|
|
data:
|
|
entity_id: sensor.meteocat_home_raw
|
|
name_prefix: meteocat_home
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: input_number.meteocat_call_counter
|
|
above: 9
|
|
sequence:
|
|
- service: notify.telegram
|
|
data:
|
|
message: ⚠️ Se ha superado el límite de 10 llamadas al mes de Meteocat.
|
|
- alias: Reset contador Meteocat mensual
|
|
trigger:
|
|
- platform: time
|
|
at: 00:00:00
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ now().day == 1 }}'
|
|
action:
|
|
- service: input_number.set_value
|
|
data:
|
|
entity_id: input_number.meteocat_call_counter
|
|
value: 0
|
|
- id: control_ventilador_por_co2_on
|
|
alias: Activar ventilador por CO2 alto
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
above: 1000
|
|
for:
|
|
minutes: 2
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: control_ventilador_por_co2_off
|
|
alias: Apagar ventilador por CO2 normal
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
below: 750
|
|
for:
|
|
minutes: 5
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: seq_shutdown
|
|
alias: Secuencia de apagado
|
|
mode: single
|
|
trigger:
|
|
- platform: conversation
|
|
command: desconecta
|
|
- platform: state
|
|
entity_id: input_button.shutdown
|
|
- platform: state
|
|
entity_id: group.simulador_personas
|
|
from: 'on'
|
|
to: 'off'
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'off'
|
|
action:
|
|
- service: script.cerrar_puerta_principal
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: 🛑 Cerrando puerta...
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: Shut down
|
|
message: '{{ states(''input_text.resumen_shutdown'') }}'
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_exterior'') }}'
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ "\n· Calefacción apagada (" ~ states(''sensor.temperatura_interior'')
|
|
~ "°C)" }}
|
|
|
|
'
|
|
- action: script.ac_panasonic_control_refrigeracion_away
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ "\n· Aire acondicionado apagado (" ~ states(''sensor.temperatura_interior'')
|
|
~ "°C)" }}
|
|
|
|
'
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: living_2
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Dispositivos salón
|
|
apagados" }}
|
|
|
|
'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
desde: secuencia
|
|
modo: manual
|
|
valor: Apagar
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador habitación
|
|
apagado" }}
|
|
|
|
'
|
|
- delay: 00:00:01
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador equation
|
|
apagado" }}
|
|
|
|
'
|
|
- delay: 00:00:01
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: secuencia
|
|
modo: manual
|
|
valor: Apagar
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador despacho
|
|
apagado" }}
|
|
|
|
'
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n✅ Fin desconexión total."
|
|
}}
|
|
|
|
'
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: Shutdown
|
|
message: '{{ states(''input_text.resumen_shutdown'') }}'
|
|
- id: '1735397441465'
|
|
alias: myBOx pause enciende luz 1
|
|
description: ''
|
|
triggers:
|
|
- device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
domain: media_player
|
|
entity_id: e97f30b9edecdd38711ec6b28781147b
|
|
type: idle
|
|
trigger: device
|
|
conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
actions:
|
|
- type: turn_on
|
|
device_id: fd3d372290728ff8c9438f0d40b84e53
|
|
entity_id: 6eba2032971432a1ed86d5363bbd2770
|
|
domain: switch
|
|
mode: single
|
|
- id: pkg_kts_encender_luces_cortesia_entrada
|
|
alias: Encender dispositivos de cortesía al entrar
|
|
description: Enciende los interruptores con etiqueta 'cortesia' si están apagados,
|
|
y arranca un temporizador
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_entrada
|
|
from: 'off'
|
|
to: 'on'
|
|
- platform: conversation
|
|
command: test
|
|
condition:
|
|
- condition: state
|
|
entity_id: sun.sun
|
|
state: below_horizon
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.my_box_2
|
|
state: 'on'
|
|
action:
|
|
- variables:
|
|
dispositivos_a_encender: "{% set dispositivos = states.switch\n | selectattr('attributes.custom_etiquetas',\
|
|
\ 'defined')\n | selectattr('attributes.custom_etiquetas', 'search', 'cortesia')\n\
|
|
\ | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id') | list\
|
|
\ %}\n{{ dispositivos }}"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dispositivos_a_encender | length > 0 }}'
|
|
sequence:
|
|
- service: switch.turn_on
|
|
data:
|
|
entity_id: '{{ dispositivos_a_encender }}'
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.luces_cortesia_entrada
|
|
- id: pkg_kts_apagar_luces_cortesia_entrada_timer
|
|
alias: Apagar dispositivos de cortesía al finalizar el temporizador
|
|
description: Apaga los dispositivos con etiqueta 'cortesia' al terminar el temporizador
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.luces_cortesia_entrada
|
|
action:
|
|
- variables:
|
|
dispositivos_a_apagar: "{% set dispositivos = states.switch\n | selectattr('attributes.custom_etiquetas',\
|
|
\ 'defined')\n | selectattr('attributes.custom_etiquetas', 'search', 'cortesia')\n\
|
|
\ | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id') | list\
|
|
\ %}\n{{ dispositivos }}"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dispositivos_a_apagar | length > 0 }}'
|
|
sequence:
|
|
- service: switch.turn_off
|
|
data:
|
|
entity_id: '{{ dispositivos_a_apagar }}'
|
|
- id: pkg_kts_cancelar_temporizador_cortesia_por_living
|
|
alias: Cancelar temporizador cortesía si pasas a living_1
|
|
description: Cancela el temporizador si se detecta presencia en living_1
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_living_1
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: timer.luces_cortesia_entrada
|
|
state: active
|
|
action:
|
|
- service: timer.cancel
|
|
data:
|
|
entity_id: timer.luces_cortesia_entrada
|
|
- alias: '[Presencia] Ramon - Actualizar ubicación habitacion 02'
|
|
id: ramon_actualizar_ubicacion_habitacion_02
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.ramon_en_habitacion_02
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.ramon_en_habitacion_02
|
|
state: 'on'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: habitacion_2
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.ramon_en_habitacion_02
|
|
state: 'off'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: unknown
|
|
- alias: '[Presencia] Activar si alguien llega a casa'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: home
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Desactivar si todos se van (con FOR)'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: not_home
|
|
for: 00:01:00
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Sincronizar al iniciar Home Assistant'
|
|
trigger:
|
|
- platform: homeassistant
|
|
event: start
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: home
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: not_home
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: Ramon - Entrada al despacho
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_despacho
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ubicacion_ramon'') = ''despacho'' }}'
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: despacho
|
|
- alias: Tag despacho
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_despacho
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'off'
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ventilador_despacho_modo_auto
|
|
data:
|
|
option: auto
|
|
- alias: Ramon - Tocando el piano
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: living_1
|
|
- alias: Ramon - En la cama
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_bedroom_2
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: habitacion_2
|
|
- alias: Pau - En la habitacion
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.scene_switch_01_1
|
|
to: 'on'
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_pau
|
|
data:
|
|
option: habitacion_1
|
|
- alias: '[Presencia] Actualizar ubicación Ramón si se va de casa'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: person.ramon
|
|
to: not_home
|
|
for: 00:05:00
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: not_home
|
|
- alias: Actualizar ubicación Ramon desde Bermuda
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.bermuda_543f666fe64b4cbc93b0895ef6488bfb_100_40004_area
|
|
condition:
|
|
- condition: state
|
|
entity_id: sensor.sm_a155f_charger_type
|
|
state: none
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: '{{ trigger.to_state.state }}'
|
|
- alias: Encender ventilador habitación al salir de casa
|
|
id: encender_ventilador_habitacion_salida_casa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.entrada_casa_detectada
|
|
to: 'on'
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: <b>PRSC</b> Entrada de casa {{ state_attr('binary_sensor.entrada_casa_detectada',
|
|
'probability') | float * 100 }} %
|
|
- alias: Apagar ventilador habitación al salir de casa
|
|
id: apagar_ventilador_habitacion_salida_casa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.salida_casa_detectada
|
|
to: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: <b>PRSC</b> Salida de casa {{ state_attr('binary_sensor.salida_casa_detectada',
|
|
'probability') | float * 100 }} %
|
|
- id: boton_shelly_1_press
|
|
alias: Boton shelly H&T (press)
|
|
description: ''
|
|
triggers:
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
mode: single
|
|
- id: boton_shelly_1_press_studioBricks
|
|
alias: Boton shelly H&T (press)
|
|
description: ''
|
|
triggers:
|
|
- platform: conversation
|
|
command: caja
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.studiobricks_toggle
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_3
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
mode: single
|
|
- id: boton_shelly_1_press_studioBricks_luz
|
|
alias: Boton shelly H&T (press)
|
|
description: Al apretar boton del shelly H&T, se enciende la luz. Otro trigger studioBricks.luz.on
|
|
sobre la luz encendera el resto
|
|
triggers:
|
|
- platform: conversation
|
|
command: caja
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.studiobricks_toggle
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_3
|
|
mode: single
|
|
- id: boton_shelly_1_double_press
|
|
alias: Boton shelly H&T (double click)
|
|
description: Al doble click boton del shelly H&T...
|
|
triggers:
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: double_press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
mode: single
|
|
- id: pulsador_scene_switch_01
|
|
alias: Zigbee Scene Switch - Todas las acciones
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
condition: []
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 1_single
|
|
sequence:
|
|
- service: script.scene_switch_01_1_single
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 2_single
|
|
sequence:
|
|
- service: script.scene_switch_01_2_single
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 1_double
|
|
sequence:
|
|
- service: script.scene_switch_01_1_double
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 2_double
|
|
sequence:
|
|
- service: script.scene_switch_01_2_double
|
|
mode: single
|
|
- id: secuencia_switches
|
|
alias: Secuencia de apagado
|
|
mode: single
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_door
|
|
action:
|
|
- service: script.secuencia_of_switches
|
|
data:
|
|
my_estado: 'off'
|
|
- id: '1736097910938'
|
|
alias: TV off luces cortesia (NFC o boton)
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.a_dormir
|
|
- device_id: f2cf32e97e729a9a14fd3657ed260afe
|
|
domain: media_player
|
|
entity_id: 595047351c96be1289eefa62731cda3e
|
|
type: turned_off
|
|
trigger: device
|
|
- type: turned_off
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
trigger: device
|
|
conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_2
|
|
mode: single
|
|
- id: scheduler_studioBricks_activa_aire
|
|
alias: Scheduler studioBricks activa aire
|
|
description: Activa el aire de la cabina
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.studiobricks_schedule
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: scheduler_studioBricks_desactiva_aire
|
|
alias: Scheduler studioBricks desactiva aire
|
|
description: Si el scheduler cambia a off, desactiva el aire si es que no hay luz
|
|
(se esta usando la cabina)
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.studiobricks_schedule
|
|
to: 'off'
|
|
conditions:
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.regleta_antela_socket_3
|
|
state: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: studioBricks.luz.on
|
|
alias: StudioBricks luz on
|
|
description: Al encender luz, secuencia de encendido
|
|
triggers:
|
|
- type: turned_on
|
|
device_id: 28e6316f3bac782b057d5d82b60dc60a
|
|
entity_id: 729509638d02b0959917f15e1c9c1104
|
|
domain: switch
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: studioBricks.luz.off
|
|
alias: StudioBricks luz off
|
|
description: Al apagar luz, secuencia de apagado. aire, ultimo, con mas retardo
|
|
triggers:
|
|
- type: turned_off
|
|
device_id: 28e6316f3bac782b057d5d82b60dc60a
|
|
entity_id: 729509638d02b0959917f15e1c9c1104
|
|
domain: switch
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
- delay: 00:00:02
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:02
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: '1735563377877'
|
|
alias: Atardecer
|
|
description: ''
|
|
triggers:
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: 00:05:00
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.presencia
|
|
state: 'on'
|
|
actions:
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: habitacion_2
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_on
|
|
mode: single
|
|
- id: '1735396993529'
|
|
alias: Tele on Luces off (v3)
|
|
triggers:
|
|
- device_id: f2cf32e97e729a9a14fd3657ed260afe
|
|
domain: media_player
|
|
entity_id: 595047351c96be1289eefa62731cda3e
|
|
type: turned_on
|
|
trigger: device
|
|
- type: turned_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
trigger: device
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_2
|
|
mode: single
|
|
- id: '1735739612217'
|
|
alias: NFC Temporizador Helper
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
conditions: []
|
|
actions:
|
|
- entity_id: timer.cocina_10m
|
|
action: timer.start
|
|
- action: tts.speak
|
|
metadata: {}
|
|
data:
|
|
cache: true
|
|
message: 'inicio temporal '
|
|
media_player_entity_id: media_player.my_box_2
|
|
mode: single
|
|
- id: '1735485273824'
|
|
alias: NFC temporizador
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
conditions: []
|
|
actions:
|
|
- type: toggle
|
|
device_id: fd3d372290728ff8c9438f0d40b84e53
|
|
entity_id: 6eba2032971432a1ed86d5363bbd2770
|
|
domain: switch
|
|
- type: turn_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
- action: notify.mobile_app_sm_a155f
|
|
metadata: {}
|
|
data:
|
|
message: NFC Temporizador
|
|
title: HA NFC
|
|
mode: single
|
|
- id: temporizador_luces_automation_on
|
|
alias: temporizador luces automation on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.temporizador_luces
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.temporizador_luces_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.temporizador_luces
|
|
mode: single
|
|
- id: temporizador_luces_automation_off
|
|
alias: temporizador luces automation off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.temporizador_luces
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- action: script.notifica_movil
|
|
data:
|
|
title: luces automation off
|
|
message: Han pasado {{ states('input_number.temporizador_luces_mm') }} min
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: habitacion_1
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
- delay: 00:00:01
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: habitacion_2
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: boton_calefaccion_toggle
|
|
alias: Boton calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.calefaccion_boolean
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: '{{ ''heat'' if states(''input_boolean.calefaccion_boolean'') == ''on''
|
|
else ''off'' }}'
|
|
temperatura: '{{states(''input_number.nivel_sensacion_termica_ideal'') if
|
|
states(''input_boolean.calefaccion_boolean'') == ''on'' else states(''sensor.temperatura_exterior'')
|
|
}}'
|
|
mode: single
|
|
- id: trigger_on_demanda_de_calefaccion_on
|
|
alias: Activar termostato si hay demanda de calor
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.demanda_de_calefaccion
|
|
to: 'on'
|
|
action:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
- id: trigger_on_demanda_de_calefaccion_off
|
|
alias: Apagar termostato si no hay demanda de calor
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.demanda_de_calefaccion
|
|
to: 'off'
|
|
action: null
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
- id: trigger_on_nivel_confort_change
|
|
alias: Cambio de nivel confort envía a InfluxDB
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_number.nivel_confort_actual
|
|
action:
|
|
- service: rest_command.send_to_influxdb
|
|
data:
|
|
value: '{{ states(''input_number.nivel_confort_actual'') | float }}'
|
|
- id: scheduler_calefaccion_on
|
|
alias: Scheduler calefaccion on
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.calefaccion_schedule
|
|
to: 'on'
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
actions:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
mode: single
|
|
- id: scheduler_calefaccion_off
|
|
alias: Scheduler calefaccion off
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.calefaccion_schedule
|
|
to: 'off'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_interior'') }}'
|
|
mode: single
|
|
- id: scheduler_lavavajillas_on
|
|
alias: Scheduler lavavajillas on
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.lavavajillas_schedule
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.alias_lavavajillas
|
|
mode: single
|
|
- id: scheduler_lavavajillas_off
|
|
alias: Scheduler lavavajillas off
|
|
trigger:
|
|
- platform: state
|
|
entity_id: schedule.lavavajillas_schedule
|
|
to: 'off'
|
|
action:
|
|
- wait_template: '{{ states(''sensor.zigbee_nous_enchufe_03_power'')|float < 5 }}'
|
|
timeout: 00:10:00
|
|
continue_on_timeout: false
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_lavavajillas
|
|
mode: single
|
|
- id: trigger_on_temperatura_change
|
|
alias: Ajustar termostato según la TRV con mayor temperatura
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: sensor.temperatura_objetivo_max
|
|
- trigger: state
|
|
entity_id: sensor.temperatura_caldera
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: sensor.demanda_calefaccion
|
|
state: 'on'
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion_advanced
|
|
data:
|
|
st_target: sensor.temperatura_objetivo_max
|
|
st_real: sensor.temperatura_caldera
|
|
mode: single
|
|
- id: trigger_on_termostato_virtual_off
|
|
alias: Apagar TRVs cuando el termostato virtual se apaga
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: climate.termostato_virtual
|
|
to: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: group.lista_trvs
|
|
data:
|
|
hvac_mode: 'off'
|
|
mode: single
|
|
- id: trigger_on_trvs
|
|
alias: Controlar calefacción según las TRVs individuales
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- climate.zigbee_sonoff_trvzb_01
|
|
- climate.zigbee_sonoff_trvzb_02
|
|
- climate.zigbee_sonoff_trvzb_03
|
|
- climate.zigbee_sonoff_trvzb_04
|
|
for:
|
|
seconds: 10
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set trvs = state_attr(''group.lista_trvs'', ''entity_id'')
|
|
%} {{ trvs | map(''states'') | select(''in'', [''heat'', ''auto'']) | list
|
|
| count > 0 }}
|
|
|
|
'
|
|
sequence:
|
|
- delay: 00:00:05
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
hvac_mode: heat
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set trvs = state_attr(''group.lista_trvs'', ''entity_id'')
|
|
%} {{ trvs | map(''states'') | select(''in'', [''heat'', ''auto'']) | list
|
|
| count == 0 }}
|
|
|
|
'
|
|
sequence:
|
|
- delay: 00:00:05
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
hvac_mode: 'off'
|
|
mode: single
|
|
- id: update_titulo_video
|
|
alias: Guardar Título de Reproducción
|
|
description: Al cambiar el video se actualiza el nombre del titulo
|
|
triggers:
|
|
- platform: state
|
|
entity_id: media_player.my_box
|
|
attribute: media_title
|
|
- platform: state
|
|
entity_id: media_player.my_box_2
|
|
attribute: app_name
|
|
- platform: conversation
|
|
command: titulo
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: input_text.set_value
|
|
metadata: {}
|
|
data:
|
|
value: '{{ state_attr(''media_player.my_box'', ''media_title'') | default(state_attr(''media_player.my_box_2'',
|
|
''app_name'') | replace(''com.'', '''') | replace(''google.android.'',
|
|
'''') | replace(''.androidtv'', ''''), true) | default(''Desconocido'')
|
|
}}'
|
|
target:
|
|
entity_id: input_text.ultimo_video_reproducido
|
|
mode: restart
|
|
- id: ventiladores_apagar
|
|
alias: ventiladores apagar
|
|
triggers:
|
|
- platform: conversation
|
|
command: apaga todos los ventiladores
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.ventiladores_off
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
desde: apagar_Script
|
|
valor: Apagar
|
|
- delay: 00:00:01
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: apagar_Script
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: Activar extractores si temperatura exterior es menor
|
|
id: activar_extractores_si_temp_exterior_menor
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_exterior
|
|
- sensor.cfg_temperatura_habitacion_2
|
|
- platform: homeassistant
|
|
event: start
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'off'
|
|
- condition: template
|
|
value_template: "{{ states('sensor.temperatura_exterior') | float(default=100)\
|
|
\ <\n states('sensor.cfg_temperatura_habitacion_2') | float(default=100) }}\n"
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- alias: Desactivar extractores si temperatura exterior no es menor
|
|
id: desactivar_extractores_si_temp_exterior_no_menor
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_exterior
|
|
- sensor.cfg_temperatura_habitacion_2
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
state: 'on'
|
|
- condition: template
|
|
value_template: "{{ states('sensor.temperatura_exterior') | float(default=100)\
|
|
\ >=\n states('sensor.cfg_temperatura_habitacion_2') | float(default=100)\
|
|
\ }}\n"
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- alias: Ciclo de trabajo de extractores según modo (2 switches)
|
|
id: ciclo_extractores_modos_2switch
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_activos
|
|
to: 'on'
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.extractores_descanso
|
|
- platform: state
|
|
entity_id: input_select.modo_extractores
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_activos
|
|
state: 'on'
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_select.modo_extractores
|
|
state: Extracción
|
|
sequence:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_aire_extraccion_habitacion_02
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_aire_introduccion_habitacion_02
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_select.modo_extractores
|
|
state: Introducción
|
|
sequence:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_aire_extraccion_habitacion_02
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_aire_introduccion_habitacion_02
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_select.modo_extractores
|
|
state: Mixto
|
|
sequence:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_extraccion_habitacion_02
|
|
- delay: 00:00:05
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_introduccion_habitacion_02
|
|
default: []
|
|
- delay: 00:05:00
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_extraccion_habitacion_02
|
|
- delay: 00:00:05
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_introduccion_habitacion_02
|
|
- service: timer.start
|
|
target:
|
|
entity_id: timer.extractores_descanso
|
|
- alias: Apagar extractores si input_boolean se apaga
|
|
id: apagar_extractores_manual
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_activos
|
|
to: 'off'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_extraccion_habitacion_02
|
|
- switch.alias_aire_introduccion_habitacion_02
|
|
- service: timer.cancel
|
|
target:
|
|
entity_id: timer.extractores_descanso
|
|
- alias: Guardar temperatura inicial al activar extractores
|
|
id: guardar_temp_inicial_extractores
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_activos
|
|
to: 'on'
|
|
action:
|
|
- service: input_number.set_value
|
|
target:
|
|
entity_id: input_number.temperatura_inicial
|
|
data:
|
|
value: '{{ states(''sensor.cfg_temperatura_habitacion_2'') | float(default=0)
|
|
}}'
|
|
- alias: Comprobar si temperatura bajó tras ciclo con extractores encendidos
|
|
id: alerta_temp_no_baja
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.extractores_descanso
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_activos
|
|
state: 'on'
|
|
- condition: template
|
|
value_template: '{% set temp_actual = states(''sensor.cfg_temperatura_habitacion_2'')
|
|
| float(default=0) %} {% set temp_inicial = states(''input_number.temperatura_inicial'')
|
|
| float(default=0) %} {{ temp_actual >= temp_inicial }}
|
|
|
|
'
|
|
action:
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.extractores_modo_alerta
|
|
data:
|
|
value: '{{ states(''input_select.modo_extractores'') }}'
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: Alerta Extractores
|
|
message: 'La temperatura interior no ha bajado tras 15 minutos de ventilación.\nModo
|
|
activo: {{ states(''input_select.modo_extractores'') }}
|
|
|
|
'
|
|
- alias: Elegir modo óptimo según fallos
|
|
id: elegir_modo_optimo_extractores
|
|
trigger:
|
|
- platform: time
|
|
at: 07:00:00
|
|
- platform: homeassistant
|
|
event: start
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
state: 'on'
|
|
action:
|
|
- variables:
|
|
fallos_extraccion: '{{ states(''sensor.fallos_en_modo_extraccion'') | int(default=99)
|
|
}}'
|
|
fallos_introduccion: '{{ states(''sensor.fallos_en_modo_introduccion'') | int(default=99)
|
|
}}'
|
|
fallos_mixto: '{{ states(''sensor.fallos_en_modo_mixto'') | int(default=99)
|
|
}}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ fallos_extraccion <= fallos_introduccion and fallos_extraccion
|
|
<= fallos_mixto }}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.modo_extractores
|
|
data:
|
|
option: Extracción
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ fallos_introduccion < fallos_extraccion and fallos_introduccion
|
|
<= fallos_mixto }}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.modo_extractores
|
|
data:
|
|
option: Introducción
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ fallos_mixto < fallos_extraccion and fallos_mixto < fallos_introduccion
|
|
}}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.modo_extractores
|
|
data:
|
|
option: Mixto
|
|
- alias: Apagar extractores si se enciende el ventilador de techo
|
|
id: extractores_apagan_si_ventilador_techo_on
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_extraccion_habitacion_02
|
|
- switch.alias_aire_introduccion_habitacion_02
|
|
- service: timer.cancel
|
|
target:
|
|
entity_id: timer.extractores_descanso
|
|
- alias: Apagar extractores si se deshabilitan manualmente
|
|
id: extractores_desactivados_por_maestro
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
to: 'off'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_aire_extraccion_habitacion_02
|
|
- switch.alias_aire_introduccion_habitacion_02
|
|
- service: timer.cancel
|
|
target:
|
|
entity_id: timer.extractores_descanso
|
|
- alias: Revisar si deben activarse extractores al habilitarlos
|
|
id: revisar_extractores_al_habilitar
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'off'
|
|
- condition: template
|
|
value_template: "{{ states('sensor.temperatura_exterior') | float(default=100)\
|
|
\ <\n states('sensor.cfg_temperatura_habitacion_2') | float(default=100) }}\n"
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- alias: Evitar activación extractores si no están habilitados o ventilador ON
|
|
id: evitar_activacion_extractores_no_permitida
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.extractores_activos
|
|
to: 'on'
|
|
condition:
|
|
- condition: or
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.extractores_habilitados
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.extractores_activos
|
|
- alias: PKG VD Ventilador Despacho - alguien regresa
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG VD Encender ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'on'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: velocidad 1
|
|
- alias: PKG VD Apagar ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'off'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- id: ventilador_despacho_sinergia
|
|
alias: PKG VD Ventilador despacho - sinergia booleano/switch
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho_running
|
|
action:
|
|
- action: script.ventilador_despacho_change
|
|
mode: restart
|
|
- id: ventilador_despacho_auto
|
|
alias: PKG VD Control ventilador despacho por temperatura (input_number)
|
|
description: Ajusta la velocidad del ventilador despacho según diferencia térmica,
|
|
con umbrales configurables
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_despacho
|
|
- input_select.ventilador_despacho_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
- input_number.ventilador_umbral_velocidad_1
|
|
- input_number.ventilador_umbral_velocidad_2
|
|
- input_number.ventilador_umbral_velocidad_3
|
|
- input_number.ventilador_umbral_brisa
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_despacho_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.cfg_sensacion_termica_despacho') | float + states('input_number.ventilador_margen_calor')\
|
|
\ | float)\n - states('input_number.nivel_sensacion_termica_ideal') | float\
|
|
\ }}\n"
|
|
u1: '{{ states(''input_number.ventilador_umbral_velocidad_1'') | float }}'
|
|
u2: '{{ states(''input_number.ventilador_umbral_velocidad_2'') | float }}'
|
|
u3: '{{ states(''input_number.ventilador_umbral_velocidad_3'') | float }}'
|
|
ub: '{{ states(''input_number.ventilador_umbral_brisa'') | float }}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''Apagar'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0 and dif_temp <= u1 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 1'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u1 and dif_temp <= u2 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 2'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 2
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u2 and dif_temp <= u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 3'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 3
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''brisa'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: brisa
|
|
mode: single
|
|
- id: ventilador_despacho_timer_on
|
|
alias: PKG VD Iniciar temporizador del ventilador del despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
condition:
|
|
- condition: template
|
|
value_template: "{{ trigger.to_state.state != 'idle'\n and trigger.to_state.state\
|
|
\ in state_attr('input_select.ventilador_despacho_temporizador', 'options')\
|
|
\ }}\n"
|
|
action:
|
|
- action: timer.start
|
|
data:
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
duration: "{% set opt = trigger.to_state.state %} {% if opt == \"1\" %}\n 00:30:00\n\
|
|
{% elif opt == \"2\" %}\n 01:30:00\n{% elif opt == \"3\" %}\n 06:00:00\n\
|
|
{% elif opt == \"4\" %}\n 09:00:00\n{% elif opt == \"0\" %}\n 00:03:30\n\
|
|
{% endif %}\n"
|
|
- id: ventilador_despacho_timer_off
|
|
alias: PKG VD timer despacho off
|
|
description: ''
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
to: idle
|
|
condition: []
|
|
action:
|
|
- action: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: idle
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: manual
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: Actualizar presencia en despacho
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
for: 00:00:05
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
state: 'on'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: 4
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: auto
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
state: 'off'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: 0
|
|
- alias: PKG EQ Ventilador Equation - alguien regresa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_equation
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG EQ Encender ventilador Equation desde input_boolean
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.mando_ventilador_equation
|
|
data:
|
|
valor: speed
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation_running
|
|
- alias: PKG EQ Apagar ventilador Equation desde input_boolean
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
to: 'off'
|
|
action:
|
|
- service: script.mando_ventilador_equation
|
|
data:
|
|
valor: Apagar
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_equation
|
|
valor: manual
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation_running
|
|
- alias: PKG EQ Oscilación ventilador Equation
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation_oscilacion
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- service: script.mando_ventilador_equation
|
|
data:
|
|
valor: oscilacion
|
|
- id: ventilador_equation_auto
|
|
alias: PKG VE Control ventilador equation por temperatura
|
|
description: Ajusta la velocidad del ventilador equation según diferencia térmica
|
|
(PCKG)
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_equation
|
|
- input_select.ventilador_equation_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_equation_modo_auto
|
|
state: auto
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{\n (states('sensor.sensacion_termica_equation') | float(0) +\n\
|
|
\ states('input_number.ventilador_margen_calor') | float(0)) -\n states('input_number.nivel_sensacion_termica_ideal')\
|
|
\ | float(0)\n}}\n"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0.0 }}'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0.2 }}'
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
mode: single
|
|
- alias: Actualizar presencia en living 1
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- input_select.ubicacion_ramon
|
|
- input_select.ubicacion_pau
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set ubicaciones = expand(''group.ubicacion_personas'')
|
|
| map(attribute=''state'') | list %} {{ ''living_1'' in ubicaciones or ''living_2''
|
|
in ubicaciones }}
|
|
|
|
'
|
|
sequence:
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_equation
|
|
valor: auto
|
|
- alias: PKG VH Ventilador habitacion - alguien regresa
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG VH Encender ventilador habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'on'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
- alias: PKG VH Apagar ventilador habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'off'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
- id: ventilador_habitacion_sinergia
|
|
alias: PKG VH Ventilador habitacion - sinergia booleano/switch
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion_running
|
|
action:
|
|
- action: script.ventilador_habitacion_change
|
|
mode: restart
|
|
- id: ventilador_habitacion_auto
|
|
alias: PKG VH Control ventilador habitacion por temperatura (input_number)
|
|
description: Ajusta la velocidad del ventilador habitacion según diferencia térmica,
|
|
con umbrales configurables
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_habitacion
|
|
- input_select.ventilador_habitacion_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
- input_number.ventilador_umbral_velocidad_1
|
|
- input_number.ventilador_umbral_velocidad_2
|
|
- input_number.ventilador_umbral_velocidad_3
|
|
- input_number.ventilador_umbral_brisa
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_habitacion_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.cfg_sensacion_termica_habitacion_2') | float +\
|
|
\ states('input_number.ventilador_margen_calor') | float)\n - states('input_number.nivel_sensacion_termica_ideal')\
|
|
\ | float }}\n"
|
|
u1: '{{ states(''input_number.ventilador_umbral_velocidad_1'') | float }}'
|
|
u2: '{{ states(''input_number.ventilador_umbral_velocidad_2'') | float }}'
|
|
u3: '{{ states(''input_number.ventilador_umbral_velocidad_3'') | float }}'
|
|
ub: '{{ states(''input_number.ventilador_umbral_brisa'') | float }}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''Apagar'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0 and dif_temp <= u1 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 1'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u1 and dif_temp <= u2 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 2'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 2
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u2 and dif_temp <= u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 3'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 3
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''brisa'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: brisa
|
|
mode: single
|
|
- id: ventilador_habitacion_timer_on
|
|
alias: PKG VH Iniciar temporizador del ventilador de habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
condition:
|
|
- condition: template
|
|
value_template: "{{ trigger.to_state.state != 'idle'\n and trigger.to_state.state\
|
|
\ in state_attr('input_select.ventilador_habitacion_temporizador', 'options')\
|
|
\ }}\n"
|
|
action:
|
|
- action: timer.start
|
|
data:
|
|
entity_id: timer.ventilador_habitacion_file_timer
|
|
duration: "{% set opt = trigger.to_state.state %} {% if opt == \"1\" %}\n 00:30:00\n\
|
|
{% elif opt == \"2\" %}\n 01:30:00\n{% elif opt == \"3\" %}\n 06:00:00\n\
|
|
{% elif opt == \"4\" %}\n 09:00:00\n{% elif opt == \"0\" %}\n 00:03:30\n\
|
|
{% endif %}\n"
|
|
- id: ventilador_habitacion_timer_off
|
|
alias: PKG VH timer habitacion off
|
|
description: ''
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: timer.ventilador_habitacion_file_timer
|
|
to: idle
|
|
condition: []
|
|
action:
|
|
- action: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
option: idle
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: manual
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: Actualizar presencia en habitacion
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- input_select.ubicacion_ramon
|
|
- input_select.ubicacion_pau
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ ''habitacion_2'' in expand(''group.ubicacion_personas'')
|
|
| map(attribute=''state'') | list }}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
option: 4
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: auto
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ ''habitacion_2'' not in expand(''group.ubicacion_personas'')
|
|
| map(attribute=''state'') | list }}
|
|
|
|
'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
option: 0
|
|
- id: sync_boolean_to_climate_ventilador_habitacion_01
|
|
alias: Boolean -> Climate ventilador habitación 01
|
|
description: Enciende/apaga el climate habitacion 01 según el boolean
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
state: 'on'
|
|
sequence:
|
|
- service: climate.turn_on
|
|
target:
|
|
entity_id: climate.ventilador_habitacion_01
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
state: 'off'
|
|
sequence:
|
|
- service: climate.turn_off
|
|
target:
|
|
entity_id: climate.ventilador_habitacion_01
|
|
- id: sync_climate_to_boolean_ventilador_habitacion
|
|
alias: Climate -> Boolean ventilador habitación
|
|
description: Enciende/apaga el boolean según el climate
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: climate.ventilador_habitacion_01
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: climate.ventilador_habitacion_01
|
|
state: cool
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: climate.ventilador_habitacion_01
|
|
state: 'off'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_habitacion_01_running
|
|
- id: ventiladores_por_calor_exterior
|
|
alias: Enciende ventiladores si hace más calor fuera
|
|
description: Enciende los ventiladores si la temperatura exterior supera la interior
|
|
+ margen y hay alguien en casa
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_interior
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.temperatura_interior'') | float > (states(''input_number.nivel_sensacion_termica_ideal'')
|
|
| float) }}
|
|
|
|
'
|
|
- condition: state
|
|
entity_id: person.ramon
|
|
state: home
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: time
|
|
after: 07:00:00
|
|
before: '23:00:00'
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
state: 'off'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: time
|
|
after: '23:00:00'
|
|
- condition: time
|
|
before: 07:00:00
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'off'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
mode: single
|
|
- alias: Encender ventilador living_1 en verano con presencia
|
|
id: encender_ventilador_living_1_verano
|
|
description: Enciende el ventilador si hay presencia en living_1 y es verano
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_living_1
|
|
to: 'on'
|
|
for:
|
|
seconds: 20
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.my_box_2
|
|
state: 'on'
|
|
action:
|
|
- action: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_ventilador_living_1
|
|
- alias: Apagar ventilador living_1 sin presencia
|
|
id: apagar_ventilador_living_1_sin_presencia
|
|
description: Apaga el ventilador si no hay presencia en living_1 y está encendido
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_living_1
|
|
to: 'off'
|
|
for:
|
|
minutes: 3
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.control_por_presencia
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: switch.alias_ventilador_living_1
|
|
state: 'on'
|
|
action:
|
|
- action: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_ventilador_living_1
|
|
- alias: Sincronizar boolean con ventilador living_1
|
|
id: sync_boolean_ventilador_living_1
|
|
description: Mantiene input_boolean.ventilador_living_1_running sincronizado con
|
|
el switch
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.alias_ventilador_living_1
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_ventilador_living_1
|
|
state: 'on'
|
|
sequence:
|
|
- action: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_living_1_running
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_ventilador_living_1
|
|
state: 'off'
|
|
sequence:
|
|
- action: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_living_1_running
|
|
- alias: PKG TH Apagar ventiladores al desactivar verano
|
|
id: pkg_th_apagar_ventiladores_fin_verano
|
|
description: Apaga todos los dispositivos
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.verano
|
|
to: 'off'
|
|
action:
|
|
- service: homeassistant.turn_off
|
|
target:
|
|
entity_id:
|
|
- input_boolean.ventilador_equation
|
|
- delay: 00:00:01
|
|
- service: homeassistant.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_ventilador_living_1
|
|
- delay: 00:00:01
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
- delay: 00:00:01
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- id: apagado_ventiladores_por_templado
|
|
alias: Apaga ventiladores si ya no hace más calor fuera
|
|
description: Apaga ventiladores si la temperatura interior vuelve a ser menor o
|
|
igual que la exterior - margen
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_interior
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.temperatura_interior'') | float <= (states(''input_number.nivel_sensacion_termica_ideal'')
|
|
| float) }}
|
|
|
|
'
|
|
- condition: state
|
|
entity_id: person.ramon
|
|
state: home
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
state: 'on'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'on'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
mode: single
|
|
- id: vigilancia_grp_luces_habitacion
|
|
alias: Apagar enchufes habitacion si es de día
|
|
description: Cada x minutos revisa el enchufe y lo apaga si es de día
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: /6
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.modo_ahorro
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: switch.grp_luces_habitacion
|
|
state: 'on'
|
|
- condition: sun
|
|
after: sunrise
|
|
before: sunset
|
|
action:
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: habitacion_1
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: vigilancia_grp_luces_comedor
|
|
alias: Apagar enchufes comedor si es de día
|
|
description: Cada x minutos revisa el enchufe y lo apaga si es de día
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: /5
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.modo_ahorro
|
|
state: 'on'
|
|
- condition: sun
|
|
after: sunrise
|
|
before: sunset
|
|
action:
|
|
- action: script.secuencia_by_label
|
|
data:
|
|
my_label: nocturno
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: vigilancia_ventilador_por_co2
|
|
alias: Control de ventilador por CO2 (max y min con scheduler)
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
above: 1000
|
|
for:
|
|
minutes: 2
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
below: 750
|
|
for:
|
|
minutes: 2
|
|
- platform: time_pattern
|
|
minutes: /4
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
above: 1000
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_01_co2
|
|
below: 750
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: '1735500800353'
|
|
alias: NFC lanza youtube
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
- platform: conversation
|
|
command: musica
|
|
conditions: []
|
|
actions:
|
|
- type: turn_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
- delay: 00:00:05
|
|
- action: media_player.play_media
|
|
target:
|
|
entity_id: media_player.my_box_2
|
|
data:
|
|
media_content_type: url
|
|
media_content_id: https://www.youtube.com/watch?v=aelpqWEBHR4&list=PL9cZWaO9mg-Re-NKyuQA25s7igEbNZd8-
|
|
mode: single
|
|
- alias: WD Watchdog Zigbee Devices Offline
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.zigbee_heiman_hs3aq_01_co2
|
|
- sensor.zigbee_sonoff_snzb02_01_temperature
|
|
- sensor.zigbee_sonoff_trvzb_01_temperature
|
|
- sensor.zigbee_nous_enchufe_01_power
|
|
- sensor.zigbee_nous_enchufe_02_power
|
|
- sensor.zigbee_nous_enchufe_03_power
|
|
- sensor.zigbee_nous_enchufe_04_power
|
|
to: unavailable
|
|
for:
|
|
minutes: 1
|
|
action:
|
|
- service: script.notifica_telegram
|
|
data:
|
|
message: '"Dispositivo Zigbee unavailable: {{ trigger.entity_id }}"
|
|
|
|
'
|
|
- service: system_log.write
|
|
data:
|
|
message: 'Dispositivo Zigbee unavailable detectado: {{ trigger.entity_id }}'
|
|
level: warning
|
|
- alias: Sincronizar válvulas con caldera
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.alias_caldera
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_caldera
|
|
state: 'on'
|
|
sequence:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.valvula_salon
|
|
- climate.valvula_habitacion
|
|
data:
|
|
hvac_mode: heat
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_caldera
|
|
state: 'off'
|
|
sequence:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.valvula_salon
|
|
- climate.valvula_habitacion
|
|
data:
|
|
hvac_mode: 'off'
|
|
- id: boton_calefaccion_toggle
|
|
alias: Boton calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.calefaccion_boolean
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id:
|
|
- climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''sensor.temperatura_exterior'') }}'
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.termostato_virtual
|
|
data:
|
|
hvac_mode: '{{ ''heat'' if states(''input_boolean.calefaccion_boolean'') ==
|
|
''on'' else ''off'' }}'
|
|
mode: single
|
|
- id: trigger_on_termostato_virtual_off
|
|
alias: Apagar TRVs cuando el termostato virtual se apaga
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: climate.termostato_virtual
|
|
to: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: group.lista_trvs
|
|
data:
|
|
hvac_mode: auto
|
|
mode: single
|
|
- alias: Bloquear puerta principal con switch
|
|
id: bloquear_puerta_principal_con_switch
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.bloquear_puerta_principal
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unlocked
|
|
action:
|
|
- service: lock.lock
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- delay: 00:00:01
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.bloquear_puerta_principal
|
|
- alias: Desbloquear puerta principal con switch
|
|
id: desbloquear_puerta_principal_con_switch
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.desbloquear_puerta_principal
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: locked
|
|
action:
|
|
- service: lock.unlock
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- delay: 00:00:01
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.desbloquear_puerta_principal
|
|
- alias: Abrir puerta principal con switch
|
|
id: abrir_puerta_principal_con_switch
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.abrir_puerta_principal
|
|
to: 'on'
|
|
condition:
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unavailable
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: locked
|
|
sequence:
|
|
- service: lock.unlock
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- delay: 00:00:02
|
|
- service: lock.open
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- delay: 00:00:01
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.abrir_puerta_principal
|
|
- delay: 00:00:30
|
|
- condition: state
|
|
entity_id: sun.sun
|
|
state: below_horizon
|
|
- condition: state
|
|
entity_id: binary_sensor.puerta_principal_door_2
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: lock.puerta_principal_2
|
|
state: unlocked
|
|
- service: lock.lock
|
|
target:
|
|
entity_id: lock.puerta_principal_2
|
|
- alias: '[Presencia] Activar si alguien llega a casa'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: home
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Desactivar si todos se van (con FOR)'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: not_home
|
|
for: 00:01:00
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Sincronizar al iniciar Home Assistant'
|
|
trigger:
|
|
- platform: homeassistant
|
|
event: start
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: home
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: not_home
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: Ramon - Actualizar ubicación con ESPresense
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.presence_movil_ramon
|
|
for: 00:00:10
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.configuracion_espresense_activa
|
|
state: 'on'
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.presence_movil_ramon'') = states(''input_select.ubicacion_ramon'')
|
|
}}
|
|
|
|
'
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: '{{ states(''sensor.presence_movil_ramon'') }}'
|
|
- alias: Ramon - Entrada al despacho
|
|
trigger:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_despacho
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ubicacion_ramon'') = ''despacho'' }}'
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: despacho
|
|
- alias: Ramon - Tocando el piano
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: living_1
|
|
- alias: Ramon - En la cama
|
|
trigger:
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_bedroom_2
|
|
- platform: state
|
|
entity_id: sensor.sm_a155f_charger_type
|
|
to: ac
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: habitacion_2
|
|
- alias: Ramon - donde estara
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.sm_a155f_charger_type
|
|
to: none
|
|
action:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.ubicacion_ramon
|
|
data:
|
|
option: not_home
|
|
- id: temporizador_luces_automation_on
|
|
alias: temporizador luces automation on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.temporizador_luces
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.temporizador_luces_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.temporizador_luces
|
|
mode: single
|
|
- id: temporizador_luces_automation_off
|
|
alias: temporizador luces automation off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.temporizador_luces
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- action: script.notifica_movil
|
|
data:
|
|
title: luces automation off
|
|
message: Han pasado {{ states('input_number.temporizador_luces_mm') }} min
|
|
- action: script.secuencia_by_friendly_name
|
|
data:
|
|
my_name: comedor
|
|
my_estado: turn_off
|
|
mode: single
|
|
- alias: PKG VD Ventilador Despacho - alguien regresa
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG VD Encender ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'on'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: velocidad 1
|
|
- alias: PKG VD Apagar ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'off'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- id: ventilador_despacho_sinergia
|
|
alias: PKG VD Ventilador despacho - sinergia booleano/switch
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho_running
|
|
action:
|
|
- action: script.ventilador_despacho_change
|
|
mode: restart
|
|
- id: ventilador_despacho_auto
|
|
alias: PKG VD Control ventilador despacho por temperatura (input_number)
|
|
description: Ajusta la velocidad del ventilador despacho según diferencia térmica,
|
|
con umbrales configurables
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_despacho
|
|
- input_select.ventilador_despacho_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
- input_number.ventilador_umbral_velocidad_1
|
|
- input_number.ventilador_umbral_velocidad_2
|
|
- input_number.ventilador_umbral_velocidad_3
|
|
- input_number.ventilador_umbral_brisa
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_despacho_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.cfg_sensacion_termica_despacho') | float + states('input_number.ventilador_margen_calor')\
|
|
\ | float)\n - states('input_number.nivel_sensacion_termica_ideal') | float\
|
|
\ }}\n"
|
|
u1: '{{ states(''input_number.ventilador_umbral_velocidad_1'') | float }}'
|
|
u2: '{{ states(''input_number.ventilador_umbral_velocidad_2'') | float }}'
|
|
u3: '{{ states(''input_number.ventilador_umbral_velocidad_3'') | float }}'
|
|
ub: '{{ states(''input_number.ventilador_umbral_brisa'') | float }}'
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''Apagar'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0 and dif_temp <= u1 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 1'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u1 and dif_temp <= u2 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 2'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 2
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u2 and dif_temp <= u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 3'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 3
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > u3 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''brisa'' }}'
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: brisa
|
|
mode: single
|
|
- id: ventilador_despacho_timer_on
|
|
alias: PKG VD Iniciar temporizador del ventilador del despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
condition:
|
|
- condition: template
|
|
value_template: "{{ trigger.to_state.state != 'idle'\n and trigger.to_state.state\
|
|
\ in state_attr('input_select.ventilador_despacho_temporizador', 'options')\
|
|
\ }}\n"
|
|
action:
|
|
- action: timer.start
|
|
data:
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
duration: "{% set opt = trigger.to_state.state %} {% if opt == \"1\" %}\n 00:30:00\n\
|
|
{% elif opt == \"2\" %}\n 01:30:00\n{% elif opt == \"3\" %}\n 06:00:00\n\
|
|
{% elif opt == \"4\" %}\n 09:00:00\n{% elif opt == \"0\" %}\n 00:03:30\n\
|
|
{% endif %}\n"
|
|
- id: ventilador_despacho_timer_off
|
|
alias: PKG VD timer despacho off
|
|
description: ''
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
to: idle
|
|
condition: []
|
|
action:
|
|
- action: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: idle
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: manual
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: Actualizar presencia en despacho
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
for: 00:00:05
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
state: 'on'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: 4
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: auto
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.presencia_zona_despacho
|
|
state: 'off'
|
|
sequence:
|
|
- service: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: 0
|
|
- id: ventilador_habitacion_speed_1
|
|
alias: ventilador habitacion speed 1
|
|
triggers:
|
|
- platform: conversation
|
|
command: enciende ventilador habitacion
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
mode: single
|
|
- id: ventilador_habitacion_apagar
|
|
alias: ventilador habitacion apagar
|
|
triggers:
|
|
- platform: conversation
|
|
command: apaga ventilador habitacion
|
|
- trigger: state
|
|
entity_id: input_button.ventilador_habitacion_off
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'off'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
mode: single
|
|
- id: vigilancia_luces
|
|
alias: vigilancia luces
|
|
description: Apagar luces etiquetadas después de 5 minutos si es de día
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: switch.grp_luces
|
|
to: 'on'
|
|
condition:
|
|
- condition: sun
|
|
after: sunset
|
|
action:
|
|
- delay: 00:01:00
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.grp_luces
|
|
- alias: PKG AC Clima - Quitar away si alguien regresa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
- platform: state
|
|
entity_id: group.simulador_personas
|
|
from: 'off'
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- service: script.ac_panasonic_control_refrigeracion_home
|
|
mode: single
|
|
- alias: PKG AC Encender aire si el climate lo solicita
|
|
id: ac_panasonic_ion_encender_automatizacion
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- alias: PKG AC Apagar aire si el climate lo solicita
|
|
id: ac_panasonic_ion_apagar_automatizacion
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'off'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- alias: PKG AC Iniciar temporizador al encender en modo AUTO
|
|
id: ac_panasonic_ion_temporizador_inicio
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ac_panasonic_ion_modo
|
|
state: auto
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.ac_panasonic_ion_temporizador
|
|
duration: "{{ '%02d:%02d:00' | format(\n (states('input_number.ac_panasonic_ion_temporizador_minutos')\
|
|
\ | int // 60),\n (states('input_number.ac_panasonic_ion_temporizador_minutos')\
|
|
\ | int % 60)\n) }}\n"
|
|
- alias: PKG AC Apagar aire al finalizar temporizador
|
|
id: ac_panasonic_ion_temporizador_final
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.ac_panasonic_ion_temporizador
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
state: 'on'
|
|
action:
|
|
- service: script.ac_panasonic_ion_power
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.ac_panasonic_ion_encendido
|
|
- id: trigger_on_cool_temperatura_change
|
|
alias: PKG AC Ajustar AC al cambiar umbrales
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: input_number.pkg_ind_umbral_maximo
|
|
- trigger: state
|
|
entity_id: sensor.ac_panasonic_ion_temperatura
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.verano
|
|
state: 'on'
|
|
actions:
|
|
- sequence:
|
|
- action: script.ac_panasonic_control_refrigeracion
|
|
data:
|
|
st_target: input_number.pkg_ind_umbral_maximo
|
|
st_real: sensor.ac_panasonic_ion_temperatura
|
|
mode: single
|
|
- id: AC_actualizar_estado
|
|
alias: AC - Actualizar estado
|
|
trigger:
|
|
- platform: event
|
|
event_type: call_service
|
|
event_data:
|
|
domain: remote
|
|
service: script.aire_acondicionado_power
|
|
action:
|
|
- service: input_boolean.toggle
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado
|
|
mode: single
|
|
- id: AC_actualizacion_timer
|
|
alias: AC - Actualización timer
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_number.aire_acondicionado_timer
|
|
condition:
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: active
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.aire_acondicionado_timer'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- id: AC_encender_temporizador
|
|
alias: Encender AC cuando se active temporizador
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: active
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'off'
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_y_finalizar
|
|
alias: Apagar AC y finalizar temporizador
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: idle
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'off'
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
- service: timer.finish
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- id: AC_encender_modo_temperatura
|
|
alias: Encender A/C al activar modo temperatura
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'on'
|
|
- platform: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
above: 0
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'off'
|
|
- condition: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
above: 0
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_por_temperatura
|
|
alias: Apagar A/C al alcanzar temperatura objetivo
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.aire_acondicionado_temperatura
|
|
- platform: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
below: 0.1
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
- condition: numeric_state
|
|
entity_id: sensor.aire_acondicionado_diferencia_temperatura_target
|
|
below: 0.1
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_apagar_modo_manual
|
|
alias: Apagar A/C al desactivar modo temperatura manualmente
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: idle
|
|
action:
|
|
- service: script.aire_acondicionado_power
|
|
mode: single
|
|
- id: AC_apagar_modo_si_ac_se_apaga_manual
|
|
alias: Desactivar modo temperatura al apagar A/C manualmente
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado
|
|
to: 'off'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_temporizador_on_apaga_modo
|
|
alias: Aire acondicionado - Modo temperatura + Temporizador (on)
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.aire_acondicionado
|
|
to: active
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
mode: single
|
|
- id: AC_modo_on_apaga_temporizador
|
|
alias: Aire acondicionado - Temporizador + Modo temperatura (on)
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.aire_acondicionado_modo_temperatura
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: timer.aire_acondicionado
|
|
state: active
|
|
action:
|
|
- service: timer.finish
|
|
target:
|
|
entity_id: timer.aire_acondicionado
|
|
mode: single
|
|
- id: alerta_co2_activada
|
|
alias: Alerta CO2 activada
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.alerta_co2
|
|
to: 'on'
|
|
action:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_pinguino
|
|
- choose:
|
|
- conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
before: sunrise
|
|
sequence:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.alias_antimosquitos
|
|
mode: single
|
|
- id: alerta_co2_desactivada
|
|
alias: Alerta CO2 desactivada
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.alerta_co2
|
|
to: 'off'
|
|
action:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id:
|
|
- switch.alias_pinguino
|
|
- switch.alias_antimosquitos
|
|
mode: single
|
|
- id: boton_send_confort
|
|
alias: Send Confort
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.send_confort
|
|
conditions: []
|
|
action:
|
|
- service: rest_command.send_to_influxdb
|
|
data:
|
|
value: '{{ states(''input_number.nivel_confort_actual'') | float }}'
|
|
mode: single
|
|
- id: '1735560626804'
|
|
alias: Calendar DL
|
|
description: ''
|
|
triggers:
|
|
- trigger: calendar
|
|
entity_id: calendar.domotica
|
|
event: start
|
|
offset: -0:5:0
|
|
conditions: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Calendar {{ trigger.calendar_event.summary }} at {{trigger.calendar_event.start
|
|
}}
|
|
mode: single
|
|
- id: custom_temporizador1_automation_on
|
|
alias: Reloj 1 on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.custom_temporizador1_toggle
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.custom_temporizador1_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.custom_temporizador1
|
|
mode: single
|
|
- id: custom_temporizador1_automation_off
|
|
alias: Reloj 1 off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.custom_temporizador1
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Temporizador1 off
|
|
mode: single
|
|
- id: custom_temporizador2_automation_on
|
|
alias: Reloj 2 on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.custom_temporizador2_toggle
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.custom_temporizador2_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.custom_temporizador2
|
|
mode: single
|
|
- id: custom_temporizador2_automation_off
|
|
alias: Reloj 2 off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.custom_temporizador2
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- device_id: 2e125cc8a76db2210a51672189f23b01
|
|
domain: mobile_app
|
|
type: notify
|
|
message: Temporizador 2 off
|
|
mode: single
|
|
- id: boton_shelly_1_double
|
|
alias: Boton shelly H&T (double)
|
|
description: ''
|
|
triggers:
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: double_press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_2
|
|
mode: single
|
|
- id: nfc_etiqueta_piano
|
|
alias: NFC etiqueta mesapiano
|
|
mode: single
|
|
trigger:
|
|
- platform: conversation
|
|
command: piano
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_piano
|
|
action:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- alias: Controlar válvula del salón
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.temperatura_salon
|
|
below: 21
|
|
action:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.valvula_salon
|
|
data:
|
|
hvac_mode: heat
|
|
- id: invierno_calefaccion_toggle
|
|
alias: Boton Invierno calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.invierno
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_interior'') }}'
|
|
mode: single
|
|
- id: control_ventilador_por_co2_on
|
|
alias: Activar ventilador por CO2 alto
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
above: 1000
|
|
for:
|
|
minutes: 2
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: control_ventilador_por_co2_off
|
|
alias: Apagar ventilador por CO2 normal
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
below: 750
|
|
for:
|
|
minutes: 5
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: seq_shutdown
|
|
alias: Secuencia de apagado
|
|
mode: single
|
|
trigger:
|
|
- platform: conversation
|
|
command: desconecta
|
|
- platform: tag
|
|
tag_id: secret nfc_tag_ha_door
|
|
- platform: state
|
|
entity_id: input_button.shutdown
|
|
- platform: state
|
|
entity_id: group.simulador_personas
|
|
from: 'on'
|
|
to: 'off'
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'off'
|
|
action:
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: 🛑 Inicio desconexión total...
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: Shut down
|
|
message: '{{ states(''input_text.resumen_shutdown'') }}'
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_exterior'') }}'
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ "\n· Calefacción apagada (" ~ states(''sensor.temperatura_interior'')
|
|
~ "°C)" }}
|
|
|
|
'
|
|
- action: script.ac_panasonic_control_refrigeracion_away
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ "\n· Aire acondicionado apagado (" ~ states(''sensor.temperatura_interior'')
|
|
~ "°C)" }}
|
|
|
|
'
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Bedroom
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Dispositivos dormitorio
|
|
apagados" }}
|
|
|
|
'
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Living room
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Dispositivos salón
|
|
apagados" }}
|
|
|
|
'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
desde: secuencia
|
|
modo: manual
|
|
valor: Apagar
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador habitación
|
|
apagado" }}
|
|
|
|
'
|
|
- delay: 00:00:01
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador equation
|
|
apagado" }}
|
|
|
|
'
|
|
- delay: 00:00:01
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: secuencia
|
|
modo: manual
|
|
valor: Apagar
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n· Ventilador despacho
|
|
apagado" }}
|
|
|
|
'
|
|
- service: input_text.set_value
|
|
data:
|
|
entity_id: input_text.resumen_shutdown
|
|
value: '{{ states(''input_text.resumen_shutdown'') ~ "\n✅ Fin desconexión total."
|
|
}}
|
|
|
|
'
|
|
- service: script.notifica_movil
|
|
data:
|
|
title: Shutdown
|
|
message: '{{ states(''input_text.resumen_shutdown'') }}'
|
|
- id: '1735397441465'
|
|
alias: myBOx pause enciende luz 1
|
|
description: ''
|
|
triggers:
|
|
- device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
domain: media_player
|
|
entity_id: e97f30b9edecdd38711ec6b28781147b
|
|
type: idle
|
|
trigger: device
|
|
conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
actions:
|
|
- type: turn_on
|
|
device_id: fd3d372290728ff8c9438f0d40b84e53
|
|
entity_id: 6eba2032971432a1ed86d5363bbd2770
|
|
domain: switch
|
|
mode: single
|
|
- alias: '[Presencia] Activar si alguien llega a casa'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: home
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Desactivar si todos se van (con FOR)'
|
|
trigger:
|
|
- platform: state
|
|
entity_id: group.all_persons
|
|
to: not_home
|
|
for: 00:01:00
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- alias: '[Presencia] Sincronizar al iniciar Home Assistant'
|
|
trigger:
|
|
- platform: homeassistant
|
|
event: start
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: home
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: group.all_persons
|
|
state: not_home
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.presencia
|
|
- id: boton_shelly_1_press
|
|
alias: Boton shelly H&T (press)
|
|
description: ''
|
|
triggers:
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
mode: single
|
|
- id: boton_shelly_1_press_studioBricks
|
|
alias: Boton shelly H&T (press)
|
|
description: ''
|
|
triggers:
|
|
- platform: conversation
|
|
command: caja
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.studiobricks_toggle
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_3
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
mode: single
|
|
- id: boton_shelly_1_press_studioBricks_luz
|
|
alias: Boton shelly H&T (press)
|
|
description: Al apretar boton del shelly H&T, se enciende la luz. Otro trigger studioBricks.luz.on
|
|
sobre la luz encendera el resto
|
|
triggers:
|
|
- platform: conversation
|
|
command: caja
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.studiobricks_toggle
|
|
- device_id: 78214af407f022e52036cd35517b0838
|
|
domain: bthome
|
|
type: button
|
|
subtype: press
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.toggle
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_3
|
|
mode: single
|
|
- id: pulsador_scene_switch_01
|
|
alias: Zigbee Scene Switch - Todas las acciones
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
condition: []
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 1_single
|
|
sequence:
|
|
- service: script.scene_switch_01_1_single
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 2_single
|
|
sequence:
|
|
- service: script.scene_switch_01_2_single
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 1_double
|
|
sequence:
|
|
- service: script.scene_switch_01_1_double
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.zigbee_scene_switch_01_action
|
|
state: 2_double
|
|
sequence:
|
|
- service: script.scene_switch_01_2_double
|
|
mode: single
|
|
- id: '1736097910938'
|
|
alias: TV off luces cortesia (NFC o boton)
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.a_dormir
|
|
- device_id: f2cf32e97e729a9a14fd3657ed260afe
|
|
domain: media_player
|
|
entity_id: 595047351c96be1289eefa62731cda3e
|
|
type: turned_off
|
|
trigger: device
|
|
- type: turned_off
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
trigger: device
|
|
conditions:
|
|
- condition: sun
|
|
after: sunset
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_habitacion_socket_2
|
|
mode: single
|
|
- id: scheduler_studioBricks_activa_aire
|
|
alias: Scheduler studioBricks activa aire
|
|
description: Activa el aire de la cabina
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.studiobricks_schedule
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: scheduler_studioBricks_desactiva_aire
|
|
alias: Scheduler studioBricks desactiva aire
|
|
description: Si el scheduler cambia a off, desactiva el aire si es que no hay luz
|
|
(se esta usando la cabina)
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.studiobricks_schedule
|
|
to: 'off'
|
|
conditions:
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.regleta_antela_socket_3
|
|
state: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: studioBricks.luz.on
|
|
alias: StudioBricks luz on
|
|
description: Al encender luz, secuencia de encendido
|
|
triggers:
|
|
- type: turned_on
|
|
device_id: 28e6316f3bac782b057d5d82b60dc60a
|
|
entity_id: 729509638d02b0959917f15e1c9c1104
|
|
domain: switch
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: studioBricks.luz.off
|
|
alias: StudioBricks luz off
|
|
description: Al apagar luz, secuencia de apagado. aire, ultimo, con mas retardo
|
|
triggers:
|
|
- type: turned_off
|
|
device_id: 28e6316f3bac782b057d5d82b60dc60a
|
|
entity_id: 729509638d02b0959917f15e1c9c1104
|
|
domain: switch
|
|
trigger: device
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- delay: 00:00:02
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_5
|
|
- delay: 00:00:02
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_1
|
|
- delay: 00:00:02
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.regleta_antela_socket_2
|
|
mode: single
|
|
- id: '1735563377877'
|
|
alias: Atardecer
|
|
description: ''
|
|
triggers:
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: 00:05:00
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.presencia
|
|
state: 'on'
|
|
actions:
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Bedroom
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_on
|
|
mode: single
|
|
- id: '1735396993529'
|
|
alias: Tele on Luces off (v3)
|
|
triggers:
|
|
- device_id: f2cf32e97e729a9a14fd3657ed260afe
|
|
domain: media_player
|
|
entity_id: 595047351c96be1289eefa62731cda3e
|
|
type: turned_on
|
|
trigger: device
|
|
- type: turned_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
trigger: device
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_1
|
|
- delay: 00:00:01
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.enchufe_doble_socket_2
|
|
mode: single
|
|
- id: '1735739612217'
|
|
alias: NFC Temporizador Helper
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
conditions: []
|
|
actions:
|
|
- entity_id: timer.cocina_10m
|
|
action: timer.start
|
|
- action: tts.speak
|
|
metadata: {}
|
|
data:
|
|
cache: true
|
|
message: 'inicio temporal '
|
|
media_player_entity_id: media_player.my_box_2
|
|
mode: single
|
|
- id: '1735485273824'
|
|
alias: NFC temporizador
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
conditions: []
|
|
actions:
|
|
- type: toggle
|
|
device_id: fd3d372290728ff8c9438f0d40b84e53
|
|
entity_id: 6eba2032971432a1ed86d5363bbd2770
|
|
domain: switch
|
|
- type: turn_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
- action: notify.mobile_app_sm_a155f
|
|
metadata: {}
|
|
data:
|
|
message: NFC Temporizador
|
|
title: HA NFC
|
|
mode: single
|
|
- id: temporizador_luces_automation_on
|
|
alias: temporizador luces automation on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.temporizador_luces
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.temporizador_luces_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.temporizador_luces
|
|
mode: single
|
|
- id: temporizador_luces_automation_off
|
|
alias: temporizador luces automation off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.temporizador_luces
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- action: script.notifica_movil
|
|
data:
|
|
title: luces automation off
|
|
message: Han pasado {{ states('input_number.temporizador_luces_mm') }} min
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Bedroom
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: boton_calefaccion_toggle
|
|
alias: Boton calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.calefaccion_boolean
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: '{{ ''heat'' if states(''input_boolean.calefaccion_boolean'') == ''on''
|
|
else ''off'' }}'
|
|
temperatura: '{{states(''input_number.nivel_sensacion_termica_ideal'') if
|
|
states(''input_boolean.calefaccion_boolean'') == ''on'' else states(''sensor.temperatura_exterior'')
|
|
}}'
|
|
mode: single
|
|
- id: trigger_on_demanda_de_calefaccion_on
|
|
alias: Activar termostato si hay demanda de calor
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.demanda_de_calefaccion
|
|
to: 'on'
|
|
action:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
- id: trigger_on_demanda_de_calefaccion_off
|
|
alias: Apagar termostato si no hay demanda de calor
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.demanda_de_calefaccion
|
|
to: 'off'
|
|
action: null
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
- id: trigger_on_nivel_confort_change
|
|
alias: Cambio de nivel confort envía a InfluxDB
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_number.nivel_confort_actual
|
|
action:
|
|
- service: rest_command.send_to_influxdb
|
|
data:
|
|
value: '{{ states(''input_number.nivel_confort_actual'') | float }}'
|
|
- id: scheduler_calefaccion_on
|
|
alias: Scheduler calefaccion on
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.calefaccion_schedule
|
|
to: 'on'
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
actions:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''input_number.nivel_sensacion_termica_ideal'') }}'
|
|
mode: single
|
|
- id: scheduler_calefaccion_off
|
|
alias: Scheduler calefaccion off
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.calefaccion_schedule
|
|
to: 'off'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion
|
|
data:
|
|
mode: 'off'
|
|
temperatura: '{{ states(''sensor.temperatura_interior'') }}'
|
|
mode: single
|
|
- id: scheduler_lavavajillas_on
|
|
alias: Scheduler lavavajillas on
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- schedule.lavavajillas_schedule
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.alias_lavavajillas
|
|
mode: single
|
|
- id: scheduler_lavavajillas_off
|
|
alias: Scheduler lavavajillas off
|
|
trigger:
|
|
- platform: state
|
|
entity_id: schedule.lavavajillas_schedule
|
|
to: 'off'
|
|
action:
|
|
- wait_template: '{{ states(''sensor.zigbee_nous_enchufe_03_power'')|float < 5 }}'
|
|
timeout: 00:10:00
|
|
continue_on_timeout: false
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.alias_lavavajillas
|
|
mode: single
|
|
- id: trigger_on_temperatura_change
|
|
alias: Ajustar termostato según la TRV con mayor temperatura
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: sensor.temperatura_objetivo_max
|
|
- trigger: state
|
|
entity_id: sensor.temperatura_caldera
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: sensor.demanda_calefaccion
|
|
state: 'on'
|
|
actions:
|
|
- sequence:
|
|
- action: script.control_calefaccion_advanced
|
|
data:
|
|
st_target: sensor.temperatura_objetivo_max
|
|
st_real: sensor.temperatura_caldera
|
|
mode: single
|
|
- id: trigger_on_termostato_virtual_off
|
|
alias: Apagar TRVs cuando el termostato virtual se apaga
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: climate.termostato_virtual
|
|
to: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: group.lista_trvs
|
|
data:
|
|
hvac_mode: 'off'
|
|
mode: single
|
|
- id: trigger_on_trvs
|
|
alias: Controlar calefacción según las TRVs individuales
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- climate.zigbee_sonoff_trvzb_01
|
|
- climate.zigbee_sonoff_trvzb_02
|
|
- climate.zigbee_sonoff_trvzb_03
|
|
- climate.zigbee_sonoff_trvzb_04
|
|
for:
|
|
seconds: 10
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.invierno
|
|
state: 'on'
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set trvs = state_attr(''group.lista_trvs'', ''entity_id'')
|
|
%} {{ trvs | map(''states'') | select(''in'', [''heat'', ''auto'']) | list
|
|
| count > 0 }}
|
|
|
|
'
|
|
sequence:
|
|
- delay: 00:00:05
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
hvac_mode: heat
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{% set trvs = state_attr(''group.lista_trvs'', ''entity_id'')
|
|
%} {{ trvs | map(''states'') | select(''in'', [''heat'', ''auto'']) | list
|
|
| count == 0 }}
|
|
|
|
'
|
|
sequence:
|
|
- delay: 00:00:05
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: climate.termostato_virtual
|
|
data:
|
|
hvac_mode: 'off'
|
|
mode: single
|
|
- id: update_titulo_video
|
|
alias: Guardar Título de Reproducción
|
|
description: Al cambiar el video se actualiza el nombre del titulo
|
|
triggers:
|
|
- platform: state
|
|
entity_id: media_player.my_box
|
|
attribute: media_title
|
|
- platform: state
|
|
entity_id: media_player.my_box_2
|
|
attribute: app_name
|
|
- platform: conversation
|
|
command: titulo
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: input_text.set_value
|
|
metadata: {}
|
|
data:
|
|
value: '{{ state_attr(''media_player.my_box'', ''media_title'') | default(state_attr(''media_player.my_box_2'',
|
|
''app_name'') | replace(''com.'', '''') | replace(''google.android.'',
|
|
'''') | replace(''.androidtv'', ''''), true) | default(''Desconocido'')
|
|
}}'
|
|
target:
|
|
entity_id: input_text.ultimo_video_reproducido
|
|
mode: restart
|
|
- id: ventiladores_apagar
|
|
alias: ventiladores apagar
|
|
triggers:
|
|
- platform: conversation
|
|
command: apaga todos los ventiladores
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.ventiladores_off
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
desde: apagar_Script
|
|
valor: Apagar
|
|
- delay: 00:00:01
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: apagar_Script
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: PKG VD Ventilador Despacho - alguien regresa
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG VD Encender ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'on'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: velocidad 1
|
|
- alias: PKG VD Apagar ventilador despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'off'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- id: ventilador_despacho_sinergia
|
|
alias: PKG VD Ventilador despacho - sinergia booleano/switch
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho_running
|
|
action:
|
|
- action: script.ventilador_despacho_change
|
|
mode: restart
|
|
- id: ventilador_despacho_auto
|
|
alias: PKG VD Control ventilador despacho por temperatura
|
|
description: Ajusta la velocidad del ventilador despacho según diferencia térmica
|
|
(PCKG)
|
|
trigger:
|
|
- trigger: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_despacho
|
|
- input_select.ventilador_despacho_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_despacho_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.cfg_sensacion_termica_despacho') | float + states('input_number.ventilador_margen_calor')\
|
|
\ | float) -\n states('input_number.nivel_sensacion_termica_ideal') | float\
|
|
\ }}\n"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''Apagar'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0.0 and dif_temp <= 1.5 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 1'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 1.5 and dif_temp <= 2.5 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 2'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 2
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 2.5 and dif_temp <= 3.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''velocidad 3'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: velocidad 3
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 3.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_despacho_botonera'')
|
|
!= ''brisa'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
modo: auto
|
|
valor: brisa
|
|
mode: single
|
|
- id: ventilador_despacho_timer_on
|
|
alias: PKG VD Iniciar temporizador del ventilador del despacho
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
action:
|
|
- action: timer.start
|
|
data:
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
duration: "{% set opt = trigger.to_state.state %} {% if opt == \"1\" %}\n 00:30:00\n\
|
|
{% elif opt == \"2\" %}\n 01:30:00\n{% elif opt == \"3\" %}\n 06:00:00\n\
|
|
{% elif opt == \"4\" %}\n 08:00:00\n{% else %}\n 00:45:00\n{% endif %}\n"
|
|
- id: ventilador_despacho_timer_off
|
|
alias: PKG VD timer despacho off
|
|
description: ''
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: timer.ventilador_despacho_file_timer
|
|
to: idle
|
|
condition: []
|
|
action:
|
|
- action: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_despacho_temporizador
|
|
option: idle
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
mode: single
|
|
- alias: PKG EQ Ventilador Equation - alguien regresa
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- service: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG EQ Encender ventilador Equation desde input_boolean
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
to: 'on'
|
|
action:
|
|
- service: script.mando_ventilador_equation
|
|
data:
|
|
valor: speed
|
|
- alias: PKG EQ Apagar ventilador Equation desde input_boolean
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
to: 'off'
|
|
action:
|
|
- action: script.mando_ventilador_equation
|
|
data:
|
|
valor: Apagar
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_equation
|
|
valor: manual
|
|
- alias: PKG EQ Oscilación ventilador Equation
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.ventilador_equation_oscilacion
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_equation
|
|
state: 'on'
|
|
action:
|
|
- service: script.mando_ventilador_equation
|
|
data:
|
|
valor: oscilacion
|
|
- id: ventilador_equation_auto
|
|
alias: PKG VE Control ventilador equation por temperatura
|
|
description: Ajusta la velocidad del ventilador equation según diferencia térmica
|
|
(PCKG)
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_equation
|
|
- input_select.ventilador_equation_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_equation_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.sensacion_termica_equation') | float + states('input_number.ventilador_margen_calor')\
|
|
\ | float) -\n states('input_number.nivel_sensacion_termica_ideal') | float\
|
|
\ }}\n"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0.0 }}'
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0.2 }}'
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.ventilador_equation
|
|
mode: single
|
|
- alias: PKG VH Ventilador habitacion - alguien regresa
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.presencia
|
|
to: 'on'
|
|
condition: []
|
|
action:
|
|
- action: script.modo_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: auto
|
|
mode: single
|
|
- alias: PKG VH Encender ventilador habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'on'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
- alias: PKG VH Apagar ventilador habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'off'
|
|
action:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
- id: ventilador_habitacion_sinergia
|
|
alias: PKG VH Ventilador habitacion - sinergia booleano/switch
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion_running
|
|
action:
|
|
- action: script.ventilador_habitacion_change
|
|
mode: restart
|
|
- id: ventilador_habitacion_auto
|
|
alias: PKG VH Control ventilador habitacion por temperatura
|
|
description: Ajusta la velocidad del ventilador habitacion según diferencia térmica
|
|
(PCKG)
|
|
trigger:
|
|
- trigger: state
|
|
entity_id:
|
|
- sensor.sensacion_termica_habitacion
|
|
- input_select.ventilador_habitacion_modo_auto
|
|
- input_number.ventilador_margen_calor
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_select.ventilador_habitacion_modo_auto
|
|
state: auto
|
|
action:
|
|
- variables:
|
|
dif_temp: "{{ (states('sensor.sensacion_termica_habitacion') | float + states('input_number.ventilador_margen_calor')\
|
|
\ | float) -\n states('input_number.nivel_sensacion_termica_ideal') | float\
|
|
\ }}\n"
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp <= 0.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''Apagar'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 0.0 and dif_temp <= 1.5 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 1'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 1.5 and dif_temp <= 2.5 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 2'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 2
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 2.5 and dif_temp <= 3.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''velocidad 3'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: velocidad 3
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ dif_temp > 3.0 }}'
|
|
sequence:
|
|
- condition: template
|
|
value_template: '{{ states(''input_select.ventilador_habitacion_botonera'')
|
|
!= ''brisa'' }}'
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
modo: auto
|
|
valor: brisa
|
|
mode: single
|
|
- id: ventilador_habitacion_timer_on
|
|
alias: PKG VH Iniciar temporizador del ventilador del habitacion
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
action:
|
|
- action: timer.start
|
|
data:
|
|
entity_id: timer.ventilador_habitacion_file_timer
|
|
duration: "{% set opt = trigger.to_state.state %} {% if opt == \"1\" %}\n 00:30:00\n\
|
|
{% elif opt == \"2\" %}\n 01:30:00\n{% elif opt == \"3\" %}\n 06:00:00\n\
|
|
{% elif opt == \"4\" %}\n 08:00:00\n{% else %}\n 00:45:00\n{% endif %}\n"
|
|
- id: ventilador_habitacion_timer_off
|
|
alias: PKG VH timer habitacion off
|
|
description: ''
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: timer.ventilador_habitacion_file_timer
|
|
to: idle
|
|
condition: []
|
|
action:
|
|
- action: input_select.select_option
|
|
data:
|
|
entity_id: input_select.ventilador_habitacion_temporizador
|
|
option: idle
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
mode: single
|
|
- id: ventiladores_por_calor_exterior
|
|
alias: Enciende ventiladores si hace más calor fuera
|
|
description: Enciende los ventiladores si la temperatura exterior supera la interior
|
|
+ margen y hay alguien en casa
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_interior
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.temperatura_interior'') | float > (states(''input_number.nivel_sensacion_termica_ideal'')
|
|
| float) }}
|
|
|
|
'
|
|
- condition: state
|
|
entity_id: person.ramon
|
|
state: home
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: time
|
|
after: 07:00:00
|
|
before: '23:00:00'
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
state: 'off'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: velocidad 1
|
|
- conditions:
|
|
- condition: or
|
|
conditions:
|
|
- condition: time
|
|
after: '23:00:00'
|
|
- condition: time
|
|
before: 07:00:00
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'off'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
mode: single
|
|
- id: apagado_ventiladores_por_templado
|
|
alias: Apaga ventiladores si ya no hace más calor fuera
|
|
description: Apaga ventiladores si la temperatura interior vuelve a ser menor o
|
|
igual que la exterior - margen
|
|
trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- sensor.temperatura_interior
|
|
- input_number.nivel_sensacion_termica_ideal
|
|
condition:
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.temperatura_interior'') | float <= (states(''input_number.nivel_sensacion_termica_ideal'')
|
|
| float) }}
|
|
|
|
'
|
|
- condition: state
|
|
entity_id: person.ramon
|
|
state: home
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
state: 'on'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
valor: Apagar
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
state: 'on'
|
|
sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
mode: single
|
|
- id: vigilancia_grp_luces_habitacion
|
|
alias: Apagar enchufes habitacion si es de día
|
|
description: Cada x minutos revisa el enchufe y lo apaga si es de día
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: /6
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.grp_luces_habitacion
|
|
state: 'on'
|
|
- condition: sun
|
|
after: sunrise
|
|
before: sunset
|
|
action:
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Bedroom
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: vigilancia_grp_luces_comedor
|
|
alias: Apagar enchufes comedor si es de día
|
|
description: Cada x minutos revisa el enchufe y lo apaga si es de día
|
|
trigger:
|
|
- platform: time_pattern
|
|
minutes: /5
|
|
condition:
|
|
- condition: state
|
|
entity_id: switch.grp_luces_comedor
|
|
state: 'on'
|
|
- condition: sun
|
|
after: sunrise
|
|
before: sunset
|
|
action:
|
|
- action: script.secuencia_by_area
|
|
data:
|
|
my_area: Living room
|
|
my_excludes: sonoff_trvzb
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: vigilancia_ventilador_por_co2
|
|
alias: Control de ventilador por CO2 (max y min con scheduler)
|
|
trigger:
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
above: 1000
|
|
for:
|
|
minutes: 2
|
|
- platform: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
below: 750
|
|
for:
|
|
minutes: 2
|
|
- platform: time_pattern
|
|
minutes: /4
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
above: 1000
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
- conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.zigbee_heiman_hs3aq_co2
|
|
below: 750
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alerta_co2
|
|
mode: single
|
|
- id: '1735500800353'
|
|
alias: NFC lanza youtube
|
|
description: ''
|
|
triggers:
|
|
- trigger: tag
|
|
tag_id: secret nfc_tag_ha_37
|
|
- platform: conversation
|
|
command: play youtube
|
|
conditions: []
|
|
actions:
|
|
- type: turn_on
|
|
device_id: 4212ed74edbdc7e8bd7b75f3ae1a9c4c
|
|
entity_id: 8c098c4f5799ff0d519ed64b05a880e1
|
|
domain: remote
|
|
- delay: 00:00:05
|
|
- action: media_player.play_media
|
|
target:
|
|
entity_id: media_player.you_box
|
|
data:
|
|
media_content_type: url
|
|
media_content_id: https://www.youtube.com/playlist?list=PLjF50Dlp9ienDb1cqXQOSDgNZFC-tVdya
|
|
mode: single
|
|
- alias: Sincronizar válvulas con caldera
|
|
trigger:
|
|
- platform: state
|
|
entity_id: switch.alias_caldera
|
|
action:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_caldera
|
|
state: 'on'
|
|
sequence:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.valvula_salon
|
|
- climate.valvula_habitacion
|
|
data:
|
|
hvac_mode: heat
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: switch.alias_caldera
|
|
state: 'off'
|
|
sequence:
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.valvula_salon
|
|
- climate.valvula_habitacion
|
|
data:
|
|
hvac_mode: 'off'
|
|
- id: boton_calefaccion_toggle
|
|
alias: Boton calefaccion toggle
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_boolean.calefaccion_boolean
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- service: climate.set_temperature
|
|
target:
|
|
entity_id:
|
|
- climate.termostato_virtual
|
|
data:
|
|
temperature: '{{ states(''sensor.temperatura_exterior'') }}'
|
|
- service: climate.set_hvac_mode
|
|
target:
|
|
entity_id:
|
|
- climate.termostato_virtual
|
|
data:
|
|
hvac_mode: '{{ ''heat'' if states(''input_boolean.calefaccion_boolean'') ==
|
|
''on'' else ''off'' }}'
|
|
mode: single
|
|
- id: trigger_on_termostato_virtual_off
|
|
alias: Apagar TRVs cuando el termostato virtual se apaga
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: climate.termostato_virtual
|
|
to: 'off'
|
|
actions:
|
|
- sequence:
|
|
- action: climate.set_hvac_mode
|
|
target:
|
|
entity_id: group.lista_trvs
|
|
data:
|
|
hvac_mode: auto
|
|
mode: single
|
|
- id: temporizador_luces_automation_on
|
|
alias: temporizador luces automation on
|
|
description: ''
|
|
triggers:
|
|
- trigger: state
|
|
entity_id:
|
|
- input_button.temporizador_luces
|
|
conditions: []
|
|
action:
|
|
- service: timer.start
|
|
data:
|
|
duration: '{{ states(''input_number.temporizador_luces_mm'') | int * 60 }}'
|
|
target:
|
|
entity_id: timer.temporizador_luces
|
|
mode: single
|
|
- id: temporizador_luces_automation_off
|
|
alias: temporizador luces automation off
|
|
description: ''
|
|
trigger:
|
|
- platform: state
|
|
entity_id: timer.temporizador_luces
|
|
to: idle
|
|
condition: []
|
|
actions:
|
|
- action: script.notifica_movil
|
|
data:
|
|
title: luces automation off
|
|
message: Han pasado {{ states('input_number.temporizador_luces_mm') }} min
|
|
- action: script.secuencia_by_friendly_name
|
|
data:
|
|
my_name: comedor
|
|
my_estado: turn_off
|
|
mode: single
|
|
- id: ventilador_despacho_speed_1
|
|
alias: ventilador despacho speed 1
|
|
triggers:
|
|
- platform: conversation
|
|
command: enciende ventilador despacho
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: speed_1_Script
|
|
valor: velocidad 1
|
|
mode: single
|
|
- id: ventilador_despacho_apagar
|
|
alias: ventilador despacho apagar
|
|
triggers:
|
|
- platform: conversation
|
|
command: apaga ventilador despacho
|
|
- trigger: state
|
|
entity_id: input_button.ventilador_despacho_off
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_despacho
|
|
to: 'off'
|
|
conditions: []
|
|
actions:
|
|
- service: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_despacho
|
|
desde: speed_1_Script
|
|
valor: Apagar
|
|
mode: single
|
|
- id: ventilador_habitacion_speed_1
|
|
alias: ventilador habitacion speed 1
|
|
triggers:
|
|
- platform: conversation
|
|
command: enciende ventilador habitacion
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'on'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: velocidad 1
|
|
mode: single
|
|
- id: ventilador_habitacion_apagar
|
|
alias: ventilador habitacion apagar
|
|
triggers:
|
|
- platform: conversation
|
|
command: apaga ventilador habitacion
|
|
- trigger: state
|
|
entity_id: input_button.ventilador_habitacion_off
|
|
- trigger: state
|
|
entity_id: input_boolean.ventilador_habitacion
|
|
to: 'off'
|
|
conditions: []
|
|
actions:
|
|
- sequence:
|
|
- action: script.selector_ventilador
|
|
data:
|
|
dispositivo: ventilador_habitacion
|
|
valor: Apagar
|
|
mode: single
|
|
- id: vigilancia_luces
|
|
alias: vigilancia luces
|
|
description: Apagar luces etiquetadas después de 5 minutos si es de día
|
|
triggers:
|
|
- trigger: state
|
|
entity_id: switch.grp_luces
|
|
to: 'on'
|
|
condition:
|
|
- condition: sun
|
|
after: sunset
|
|
action:
|
|
- delay: 00:01:00
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.grp_luces
|