-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome-assistant.yaml
105 lines (92 loc) · 2.56 KB
/
home-assistant.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Lovelace UI
entities:
- entity: switch.rack_manual_fan
- entity: input_number.inlet_fan_speed
- entity: input_number.outlet_fan_speed
- entity: sensor.rack_inlet_temperature
- entity: sensor.rack_outlet_temperature
- entity: sensor.rack_inlet_humidity
- entity: sensor.rack_outlet_humidity
type: entities
title: Rack
# configuration.yaml:
switch:
- platform: mqtt
name: Rack Manual Fan
state_topic: "rack/manual_fan_state"
command_topic: "rack/manual_fan"
qos: 1
payload_on: "1"
payload_off: "0"
sensor:
- platform: mqtt
name: "Rack Inlet Temperature"
state_topic: "rack/inlet/temp"
unit_of_measurement: "°F"
- platform: mqtt
name: "Rack Outlet Temperature"
state_topic: "rack/outlet/temp"
unit_of_measurement: "°F"
- platform: mqtt
name: "Rack Inlet Humidity"
state_topic: "rack/inlet/humidity"
unit_of_measurement: "%"
- platform: mqtt
name: "Rack Outlet Humidity"
state_topic: "rack/outlet/humidity"
unit_of_measurement: "%"
input_number:
inlet_fan_speed:
name: "Inlet Fan Speed"
min: 0
max: 100
step: 1
icon: mdi:fan
unit_of_measurement: '%'
outlet_fan_speed:
name: "Outlet Fan Speed"
min: 0
max: 100
step: 1
icon: mdi:fan
unit_of_measurement: '%'
automation:
- alias: inletfan
trigger:
platform: state
entity_id: input_number.inlet_fan_speed
action:
service: mqtt.publish
data_template:
topic: 'rack/inlet/fan_speed'
retain: true
payload: "{{ states.input_number.inlet_fan_speed.state | int }}"
- alias: outletfan
trigger:
platform: state
entity_id: input_number.outlet_fan_speed
action:
service: mqtt.publish
data_template:
topic: 'rack/outlet/fan_speed'
retain: true
payload: "{{ states.input_number.outlet_fan_speed.state | int }}"
# MQTT in (subscribe)
- alias: Set outlet fan speed slider
trigger:
platform: mqtt
topic: "rack/outlet/fan_speed"
action:
service: input_number.set_value
data_template:
entity_id: input_number.outlet_fan_speed
value: '{{ trigger.payload | int }}'
- alias: Set inlet fan speed slider
trigger:
platform: mqtt
topic: "rack/inlet/fan_speed"
action:
service: input_number.set_value
data_template:
entity_id: input_number.inlet_fan_speed
value: '{{ trigger.payload | int }}'