Código: Seleccionar todo
- platform: mqtt
name: "Ventilador À"
command_topic: "cmnd/ventiladora/FanSpeed"
speed_command_topic: "cmnd/ventiladora/FanSpeed"
state_topic: "stat/ventiladora/RESULT"
speed_state_topic: "stat/ventiladora/RESULT"
state_value_template: >
{% if value_json.FanSpeed is defined %}
{% if value_json.FanSpeed == 0 -%}0{%- elif value_json.FanSpeed > 0 -%}4{%- endif %}
{% else %}
{% if states.fan.ventiladora.state == 'off' -%}0{%- elif states.fan.ventiladora.state == 'on' -%}4{%- endif %}
{% endif %}
speed_value_template: "{{ value_json.FanSpeed }}"
availability_topic: tele/ventiladora/LWT
payload_off: "0"
payload_on: "4"
payload_low_speed: "1"
payload_medium_speed: "2"
payload_high_speed: "3"
payload_available: Online
payload_not_available: Offline
speeds:
- off
- low
- medium
- high
light:
- platform: mqtt
name: "Llum Ventilador"
state_topic: "tele/ventilador/STATE"
value_template: "{{ value_json.POWER }}"
command_topic: "cmnd/ventilador/POWER"
availability_topic: "tele/ventilador/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
- platform: mqtt
name: "Llum Ventilador À"
state_topic: "tele/ventiladora/STATE"
value_template: "{{ value_json.POWER }}"
command_topic: "cmnd/ventiladora/POWER"
availability_topic: "tele/ventiladora/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
El temporizador (en configuration.yaml).
Código: Seleccionar todo
input_number:
ventilador_a_timer:
name: "Temps Ventilador À"
min: 0
max: 60
step: 10
timer:
temporitzadorva:
duration: 00:01:00
Código: Seleccionar todo
alias: Activar Timer A
sequence:
data_template:
duration: "{{ states.input_number.ventilador_a_timer.state | int * 60}}"
entity_id: timer.temporitzadorva
service: timer.start
mode: restart
Código: Seleccionar todo
alias: Apaga Vent À
description: ''
trigger:
- event_data:
entity_id: timer.temporitzadorva
event_type: timer.finished
platform: event
condition: []
action:
- data: {}
entity_id: fan.ventilador_a
service: fan.turn_off
mode: single