-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmqtt.yaml
181 lines (169 loc) · 5.92 KB
/
mqtt.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
---
sensor:
- name: "Humidity"
object_id: office_humidity
unique_id: 181645a6_hum
state_topic: "sensor/eplus/humidity"
unit_of_measurement: "%"
device_class: humidity
value_template: "{{ value | round(1) }}"
expire_after: 600
device:
identifiers: 00181645a6
model: Enviro+
name: Enviro+
manufacturer: Pimaroni
- name: "Pressure"
object_id: office_pressure
unique_id: 181645a6_pre
state_topic: "sensor/eplus/pressure"
unit_of_measurement: "hPa"
device_class: pressure
value_template: "{{ value | round(2) }}"
expire_after: 600
device:
identifiers: 00181645a6
model: Enviro+
name: Enviro+
manufacturer: Pimaroni
- name: "NH3"
object_id: office_nh3
unique_id: 181645a6_nh3
state_topic: "sensor/eplus/gas/nh3"
unit_of_measurement: "ppm"
value_template: |-
{% set resist = ( value | round(1))/1000 %}
{% set percentage = ((resist-10)/1490) %}
{% set ppm = 1 + (percentage*299) %}
{{ ppm | round(1) }}
expire_after: 600
device:
identifiers: 00181645a6
model: Enviro+
name: Enviro+
manufacturer: Pimaroni
- name: "Reducing"
object_id: office_reducing
unique_id: 181645a6_red
state_topic: "sensor/eplus/gas/reducing"
unit_of_measurement: "ppm"
value_template: |-
{% set resist = ( value | round(1))/1000 %}
{% set percentage = ((resist-100)/1400) %}
{% set ppm = 1 + (percentage*999) %}
{{ ppm | round(1) }}
expire_after: 600
device:
identifiers: 00181645a6
model: Enviro+
name: Enviro+
manufacturer: Pimaroni
- name: "Oxidising"
object_id: office_oxidising
unique_id: 181645a6_oxi
state_topic: "sensor/eplus/gas/oxidising"
unit_of_measurement: "ppm"
value_template: |-
{% set resist = ( value | round(1))/1000 %}
{% set percentage = ((resist-0.8)/19.2) %}
{% set ppm = 0.05 + (percentage*9.95) %}
{{ ppm | round(1) }}
expire_after: 600
device:
identifiers: 00181645a6
model: Enviro+
name: Enviro+
manufacturer: Pimaroni
# ToBS
- name: "ToBS Battery Voltage"
unique_id: "node_1__battery_voltage"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and
value_json.payload.voltage is defined and
value_json.payload.temperature is not defined %}
{{ (value_json.payload.voltage | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
unit_of_measurement: "Volts"
device:
identifiers: "!947b7813"
name: ToBS Meshtastic Node
# Telemetry packets come in two flavors: The default node telemetry, and the I2C sensor data.
# Both packets contain "voltage" so we check for temperature to ignore the sensor packet here.
- name: "ToBS Battery Percent"
unique_id: "node_1_battery_percent"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.battery_level is defined %}
{{ (value_json.payload.battery_level | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
device_class: "battery"
unit_of_measurement: "%"
- name: "ToBS ChUtil"
unique_id: "node_1_chutil"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.channel_utilization is defined %}
{{ (value_json.payload.channel_utilization | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
unit_of_measurement: "%"
- name: "ToBS AirUtilTX"
unique_id: "node_1_airutiltx"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.air_util_tx is defined %}
{{ (value_json.payload.air_util_tx | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
unit_of_measurement: "%"
- name: "ToBS Temperature"
unique_id: "node_1_temperature"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.temperature is defined %}
{{ (((value_json.payload.temperature | float) * 1.8) +32) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
device_class: "temperature"
unit_of_measurement: "°F"
# With device_class: "temperature" set, make sure to use the configured unit for temperature in your HA instance.
# If you don't, then non-temperature messages will change the value of this sensor by reinterpreting the current state with the wrong unit, unless you account for it.
# For Celsius use: {{ (value_json.payload.temperature | float) | round(1) }}
# For Fahrenheit use: {{ (((value_json.payload.temperature | float) * 1.8) +32) | round(2) }}
- name: "ToBS Humidity"
unique_id: "node_1_humidity"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.relative_humidity is defined %}
{{ (value_json.payload.relative_humidity | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
device_class: "humidity"
unit_of_measurement: "%"
- name: "ToBS Pressure"
unique_id: "node_1_pressure"
state_topic: "msh/US/2/json/LongFast/!947b7813"
state_class: measurement
value_template: >-
{% if value_json.from == 4038675309 and value_json.payload.barometric_pressure is defined %}
{{ (value_json.payload.barometric_pressure | float) | round(2) }}
{% else %}
{{ this.state }}
{% endif %}
device_class: "pressure"
unit_of_measurement: "hPa"