homebridge-easy-mqtt 1.4.0-beta.2 → 1.4.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/CHANGELOG.md +21 -3
  2. package/README.md +271 -24
  3. package/config.schema.json +2309 -342
  4. package/dist/accessory/abstract/base.js +5 -5
  5. package/dist/accessory/abstract/base.js.map +1 -1
  6. package/dist/accessory/abstract/common.d.ts +42 -0
  7. package/dist/accessory/abstract/common.js +169 -0
  8. package/dist/accessory/abstract/common.js.map +1 -0
  9. package/dist/accessory/abstract/helper.d.ts +1 -0
  10. package/dist/accessory/abstract/helper.js +25 -0
  11. package/dist/accessory/abstract/helper.js.map +1 -1
  12. package/dist/accessory/abstract/mqtt.d.ts +15 -26
  13. package/dist/accessory/abstract/mqtt.js +29 -148
  14. package/dist/accessory/abstract/mqtt.js.map +1 -1
  15. package/dist/accessory/addons/addon.d.ts +24 -0
  16. package/dist/accessory/addons/addon.js +52 -0
  17. package/dist/accessory/addons/addon.js.map +1 -0
  18. package/dist/accessory/addons/filter.d.ts +11 -0
  19. package/dist/accessory/addons/filter.js +37 -0
  20. package/dist/accessory/addons/filter.js.map +1 -0
  21. package/dist/accessory/climate/active.d.ts +11 -0
  22. package/dist/accessory/climate/active.js +44 -0
  23. package/dist/accessory/climate/active.js.map +1 -0
  24. package/dist/accessory/climate/fan2.d.ts +20 -0
  25. package/dist/accessory/climate/fan2.js +122 -0
  26. package/dist/accessory/climate/fan2.js.map +1 -0
  27. package/dist/accessory/climate/heaterCooler.d.ts +2 -6
  28. package/dist/accessory/climate/heaterCooler.js +7 -39
  29. package/dist/accessory/climate/heaterCooler.js.map +1 -1
  30. package/dist/accessory/climate/purifier.d.ts +19 -0
  31. package/dist/accessory/climate/purifier.js +114 -0
  32. package/dist/accessory/climate/purifier.js.map +1 -0
  33. package/dist/accessory/climate/{climate.d.ts → temperatureControl.d.ts} +4 -3
  34. package/dist/accessory/climate/temperatureControl.js +35 -0
  35. package/dist/accessory/climate/temperatureControl.js.map +1 -0
  36. package/dist/accessory/climate/thermostat.d.ts +2 -2
  37. package/dist/accessory/climate/thermostat.js +11 -10
  38. package/dist/accessory/climate/thermostat.js.map +1 -1
  39. package/dist/accessory/garage.d.ts +17 -0
  40. package/dist/accessory/garage.js +110 -0
  41. package/dist/accessory/garage.js.map +1 -0
  42. package/dist/accessory/lock.d.ts +2 -2
  43. package/dist/accessory/lock.js +3 -3
  44. package/dist/accessory/lock.js.map +1 -1
  45. package/dist/accessory/onoff/lightbulb.js +4 -4
  46. package/dist/accessory/onoff/lightbulb.js.map +1 -1
  47. package/dist/accessory/onoff/onoff.js +1 -1
  48. package/dist/accessory/onoff/onoff.js.map +1 -1
  49. package/dist/accessory/onoff/outlet.js +1 -1
  50. package/dist/accessory/onoff/outlet.js.map +1 -1
  51. package/dist/accessory/position/blind.d.ts +10 -0
  52. package/dist/accessory/position/blind.js +22 -0
  53. package/dist/accessory/position/blind.js.map +1 -0
  54. package/dist/accessory/position/position.d.ts +14 -0
  55. package/dist/accessory/position/position.js +80 -0
  56. package/dist/accessory/position/position.js.map +1 -0
  57. package/dist/accessory/security.js +4 -4
  58. package/dist/accessory/security.js.map +1 -1
  59. package/dist/accessory/sensor/air.d.ts +14 -0
  60. package/dist/accessory/sensor/air.js +96 -0
  61. package/dist/accessory/sensor/air.js.map +1 -0
  62. package/dist/accessory/sensor/carbonDioxide.js +3 -3
  63. package/dist/accessory/sensor/carbonDioxide.js.map +1 -1
  64. package/dist/accessory/sensor/carbonMonoxide.js +3 -3
  65. package/dist/accessory/sensor/carbonMonoxide.js.map +1 -1
  66. package/dist/accessory/sensor/contact.js +1 -1
  67. package/dist/accessory/sensor/contact.js.map +1 -1
  68. package/dist/accessory/sensor/humidity.js +1 -1
  69. package/dist/accessory/sensor/humidity.js.map +1 -1
  70. package/dist/accessory/sensor/leak.js +1 -1
  71. package/dist/accessory/sensor/leak.js.map +1 -1
  72. package/dist/accessory/sensor/light.d.ts +9 -0
  73. package/dist/accessory/sensor/light.js +13 -0
  74. package/dist/accessory/sensor/light.js.map +1 -0
  75. package/dist/accessory/sensor/motion.js +1 -1
  76. package/dist/accessory/sensor/motion.js.map +1 -1
  77. package/dist/accessory/sensor/occupancy.js +1 -1
  78. package/dist/accessory/sensor/occupancy.js.map +1 -1
  79. package/dist/accessory/sensor/sensor.js +4 -4
  80. package/dist/accessory/sensor/sensor.js.map +1 -1
  81. package/dist/accessory/sensor/smoke.js +1 -1
  82. package/dist/accessory/sensor/smoke.js.map +1 -1
  83. package/dist/accessory/sensor/temperature.js +1 -1
  84. package/dist/accessory/sensor/temperature.js.map +1 -1
  85. package/dist/accessory/valve.d.ts +14 -0
  86. package/dist/accessory/valve.js +71 -0
  87. package/dist/accessory/valve.js.map +1 -0
  88. package/dist/homebridge/platform.js +5 -3
  89. package/dist/homebridge/platform.js.map +1 -1
  90. package/dist/homebridge-ui/public/index.html +1 -1
  91. package/dist/homebridge-ui/public/ui.js +1 -1
  92. package/dist/i18n/en.d.ts +203 -0
  93. package/dist/i18n/en.js +226 -23
  94. package/dist/i18n/en.js.map +1 -1
  95. package/dist/i18n/fr.d.ts +468 -0
  96. package/dist/i18n/fr.js +265 -0
  97. package/dist/i18n/fr.js.map +1 -1
  98. package/dist/i18n/i18n.d.ts +206 -1
  99. package/dist/i18n/i18n.js +12 -0
  100. package/dist/i18n/i18n.js.map +1 -1
  101. package/dist/i18n/ro.d.ts +889 -0
  102. package/dist/i18n/ro.js +381 -0
  103. package/dist/i18n/ro.js.map +1 -0
  104. package/dist/i18n/template.d.ts +205 -2
  105. package/dist/i18n/template.js +3 -3
  106. package/dist/i18n/template.js.map +1 -1
  107. package/dist/i18n/vi.d.ts +1034 -0
  108. package/dist/i18n/vi.js +526 -0
  109. package/dist/i18n/vi.js.map +1 -0
  110. package/dist/model/enums.d.ts +49 -5
  111. package/dist/model/enums.js +50 -5
  112. package/dist/model/enums.js.map +1 -1
  113. package/dist/model/mqtt.d.ts +5 -4
  114. package/dist/model/mqtt.js +41 -25
  115. package/dist/model/mqtt.js.map +1 -1
  116. package/dist/model/types.d.ts +141 -24
  117. package/dist/tools/properties.d.ts +11 -0
  118. package/dist/tools/properties.js +73 -0
  119. package/dist/tools/properties.js.map +1 -0
  120. package/dist/tools/temperature.d.ts +7 -3
  121. package/dist/tools/temperature.js +20 -9
  122. package/dist/tools/temperature.js.map +1 -1
  123. package/package.json +1 -1
  124. package/dist/accessory/climate/climate.js +0 -31
  125. package/dist/accessory/climate/climate.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,14 +2,32 @@
2
2
 
3
3
  All notable changes to homebridge-dummy will be documented in this file.
4
4
 
5
- ## 1.4.0-beta.1 (2025-09-XX)
5
+ ## 1.4.0-beta.21 (2025-10-01)
6
6
 
7
7
  ### Added
8
- - Support for HeaterCooler
8
+ - A bunch of new accessory types:
9
+ - `Air Purifier`
10
+ - `Air Quality Sensor`
11
+ - `Fanv2`
12
+ - `GarageDoorOpener`
13
+ - `HeaterCooler`
14
+ - `LightSensor`
15
+ - `Valve`
16
+ - `Window Covering`
17
+ - Broker, username, and password can be set via environment variables ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#environment-variables))
18
+ - Publish arbitrary MQTT messages on connect ([documentation] (https://github.com/mpatfield/homebridge-easy-mqtt#mqtt-onconnect))
19
+ - Traduceri în limba română. Mulțumesc, [@rursache](https://github.com/sponsors/rursache)!
20
+ - Bản dịch tiếng Việt. Cảm ơn [@khanhnd88](https://github.com/sponsors/khanhnd88)!
9
21
 
10
22
  ### Changed
23
+ - ⚠️ All accessory states are now saved across plugin/Homebridge restarts
24
+ - If you want to keep the old behavior, select the `Reset on Restart` option for each accessory you want to reset
25
+ - MQTT `options` JSON can now also include publish options, such as `retain`, in addition to client options
11
26
  - Optimized MQTT connections by sharing across multiple accessories when possible
12
- - Previously, every accessory had its own connection
27
+ - Previously, every accessory always had its own connection
28
+ - Better field validation in config UI (Thank you, [@justjam2013](https://github.com/sponsors/justjam2013) for teaching me this!)
29
+ - Significant under-the-hood cleanup to speed future development
30
+ - Traductions françaises mises à jour. Merci, [@7ute](https://github.com/sponsors/7ute)!
13
31
 
14
32
  ### Notes
15
33
  Would you like to see Homebridge Easy MQTT in your language? Please consider [getting involved](https://github.com/mpatfield/homebridge-easy-mqtt/issues/4). No coding experience required!
package/README.md CHANGED
@@ -25,12 +25,18 @@ This plugin is designed to be a simple replacement for the fantastic [homebridge
25
25
 
26
26
  **HomebridgeEasyMQTT** currently supports the following accessory types but will be expanded over time as more use cases are requested. If there is an accessory type you'd like to see supported, please [create an issue in GitHub](https://github.com/mpatfield/homebridge-easy-mqtt/issues/new/choose).
27
27
 
28
+ - `AirPurifier`
29
+ - `AirQualitySensor`
28
30
  - `CarbonDioxideSensor`
29
31
  - `CarbonMonoxideSensor`
30
32
  - `ContactSensor`
33
+ - `Fanv2`
34
+ - `GarageDoorOpener`
35
+ - `HeaterCooler`
31
36
  - `HumiditySensor`
32
37
  - `LeakSensor`
33
38
  - `Lightbulb`
39
+ - `LightSensor`
34
40
  - `LockMechanism`
35
41
  - `MotionSensor`
36
42
  - `OccupancySensor`
@@ -40,6 +46,8 @@ This plugin is designed to be a simple replacement for the fantastic [homebridge
40
46
  - `Switch`
41
47
  - `TemperatureSensor`
42
48
  - `Thermostat`
49
+ - `Valve`
50
+ - `WindowCovering`
43
51
 
44
52
  ## Configuration
45
53
 
@@ -64,7 +72,14 @@ Using the Homebridge Config UI is the easiest way to set up this plugin. However
64
72
  "broker": "string",
65
73
  "username": "string",
66
74
  "password": "string",
67
- "options": "string"
75
+ "options": "string",
76
+ "onConnect": [
77
+ {
78
+ "topic": "string",
79
+ "message": "string",
80
+ }
81
+
82
+ ]
68
83
  },
69
84
  "customCharacteristics": [
70
85
  {
@@ -75,6 +90,7 @@ Using the Homebridge Config UI is the easiest way to set up this plugin. However
75
90
  }
76
91
 
77
92
  ],
93
+ "resetOnRestart": false,
78
94
  "disableLogging": false,
79
95
  … // See Topics & Values below for additional attributes for each accessory type
80
96
  ],
@@ -88,7 +104,7 @@ Required fields are marked with an asterisk (*)
88
104
  ### Info
89
105
  - `id*` - A unique ID to identify this accessory. Changing this value will result in a new accessory.
90
106
  - `name*` - The display name for the accessory in HomeKit
91
- - `type*` - The type of accessory, currently Lightbulb, LockMechanism, Outlet, SecuritySystem, Switch, and Temperature Sensor are supported
107
+ - `type*` - The type of accessory. See list of currently supported types above.
92
108
  - `group` - Items sharing the same group name will be grouped together in the Home app UI
93
109
  - ⚠️ Changing the group name will require you to reconfigure any HomeKit scenes/automations for those accessories
94
110
  - `manufacturer` - The accessory manufacturer which will display in HomeKit device details
@@ -97,10 +113,21 @@ Required fields are marked with an asterisk (*)
97
113
  - `version` - The accessory software version which will display in HomeKit device details
98
114
 
99
115
  ### MQTT:
100
- - `broker*` - The URL and port to use for communicating with your MQTT device
116
+ - `broker` - The URL and port to use for communicating with your MQTT device, defaults to `mqtt://127.0.0.1:1883/`
101
117
  - `username` - Username
102
118
  - `password` - Password
103
119
  - `options` - See [MQTT Options](#mqtt-options) below
120
+ - `onConnect` - See [MQTT OnConnect](#mqtt-onconnect) below
121
+
122
+ #### Environment Variables
123
+
124
+ Alternatively, you may set the following environment variables for broker, username, and password:
125
+
126
+ - `EASYMQTT_BROKER` - expects a fully formed url, `protocol://host:port/` where port is optional
127
+ - `EASYMQTT_USERNAME`
128
+ - `EASYMQTT_PASSWORD`
129
+
130
+ Note that setting the this information in the JSON config will override the environment variables.
104
131
 
105
132
  ## Topics & Values
106
133
 
@@ -110,6 +137,8 @@ You may define topics using a JSONPath dot notation to assist the parser in find
110
137
 
111
138
  As with topics, you will also need to populate the appropriate values based on the type. Note that while they are defined as strings, they will be auto-converted to the appropriate primitives (e.g. boolean or number) where appropriate.
112
139
 
140
+ These values are used for both determining current state and, where appropriate, publishing the new state to MQTT
141
+
113
142
  ### General Purpose
114
143
  - `topicGetStatusActive` - Whether or not the accessory is connected/reachable
115
144
  - `topicGetBatteryLow` - Wether or not the accessory has a low battery
@@ -118,12 +147,12 @@ As with topics, you will also need to populate the appropriate values based on t
118
147
  - `valueBatteryLow` - Accessory has a low battery level
119
148
 
120
149
  ### On/Off Accessories
150
+
151
+ #### Lightbulb
121
152
  - `topicGetOn*` - The current state of the outlet, i.e. on/off
122
153
  - `topicSetOn*` - For setting the state of the outlet
123
154
  - `valueOn*` - Turned on, e.g. "true", or "1", or "On"
124
155
  - `valueOff*` - Turned off, e.g. "false", or "0", or "Off"
125
-
126
- #### Lightbulb
127
156
  - `topicGetBrightness` - The current brightness as a percent
128
157
  - `topicSetBrightness` - For setting the brightness
129
158
  - `topicGetColorTemperature` - The current color temperature of the lightbulb
@@ -134,15 +163,59 @@ As with topics, you will also need to populate the appropriate values based on t
134
163
  - `topicSetSaturation` - For setting the saturation setting of the lightbulb
135
164
 
136
165
  #### Outlet
166
+ - `topicGetOn*` - The current state of the outlet, i.e. on/off
167
+ - `topicSetOn*` - For setting the state of the outlet
168
+ - `valueOn*` - Turned on, e.g. "true", or "1", or "On"
169
+ - `valueOff*` - Turned off, e.g. "false", or "0", or "Off"
137
170
  - `topicGetOutletInUse` - Whether or not the outlet is currently being used
138
171
  - `valueOutletInUse` - Currently being used, e.g. "true", or "1", or "On"
139
172
 
140
173
  #### Switch
141
- -
174
+ - `topicGetOn*` - The current state of the outlet, i.e. on/off
175
+ - `topicSetOn*` - For setting the state of the outlet
176
+ - `valueOn*` - Turned on, e.g. "true", or "1", or "On"
177
+ - `valueOff*` - Turned off, e.g. "false", or "0", or "Off"
178
+
179
+ ### Position Accessories
180
+
181
+ #### WindowCovering
182
+ - `topicGetPositionState*` - Get position state (Decreasing, Increasing, Stopped)
183
+ - `topicGetCurrentPosition*` - Get current position percent
184
+ - `topicGetTargetPosition*` - Get target position percent
185
+ - `topicSetTargetPosition*` - Set target position percent
186
+ - `topicGetCurrentHorizontalTiltAngle` - Get current horizontal angle (-90° to 90°)
187
+ - `topicGetTargetHorizontalTiltAngle` - Get target horizontal angle (-90° to 90°)
188
+ - `topicSetTargetHorizontalTiltAngle` - Set target horizontal angle (-90° to 90°)
189
+ - `topicGetCurrentVerticalTiltAngle` - Get current vertical angle (-90° to 90°)
190
+ - `topicGetTargetVerticalTiltAngle` - Get target vertical angle (-90° to 90°)
191
+ - `topicSetTargetVerticalTiltAngle` - Set target vertical angle (-90° to 90°)
192
+ - `topicSetHoldPosition` - Set hold (true/false)
193
+ - `topicGetObstructionDetected` - Get obstruction detected
194
+ - `valuePositionDecreasing` - Closing
195
+ - `valuePositionIncreasing` - Opening
196
+ - `valuePositionStopped` - Stopped
197
+ - `valuePositionHold` - Hold
198
+ - `valuePositionResume` - Resume
199
+ - `valuePositionObstructed` - Obstruction detected
142
200
 
143
201
  ### Sensors
202
+
203
+ #### AirQualitySensor
204
+ - `topicGetAirQuality*` - Get air quality
205
+ - `topicGetNitrogenDioxideDensity` - Get nitrogen dioxide density in µg/m³
206
+ - `topicGetOzoneDensity` - Get ozone density in µg/m³
207
+ - `topicGetPM2_5Density` - Get PM2.5 density in µg/m³
208
+ - `topicGetPM10Density` - Get PM10 density in µg/m³
209
+ - `topicGetSulphurDioxideDensity` - Get sulphur dioxide density in µg/m³
210
+ - `topicGetVOCDensity` - Get VOC density in µg/m³
144
211
  - `topicGetStatusFault` - Whether or not the sensor has a generic fault
145
212
  - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
213
+ - `valueAQExcellent` - Air quality excellent
214
+ - `valueAQGood` - Air quality good
215
+ - `valueAQFair` - Air quality fair
216
+ - `valueAQInferior` - Air quality inferior
217
+ - `valueAQPoor` - Air quality poor
218
+ - `valueAQUnknown` - Air quality unknown
146
219
  - `valueFault` - Accessory has a fault
147
220
  - `valueTampered` - Accessory has been tampered with
148
221
 
@@ -150,60 +223,187 @@ As with topics, you will also need to populate the appropriate values based on t
150
223
  - `topicGetCarbonDioxideDetected*` - Whether or not the sensor has detected carbon dioxide
151
224
  - `topicGetCarbonDioxideLevel` - The current carbon dioxide level
152
225
  - `topicGetCarbonDioxidePeakLevel` - The peak carbon dioxide level
226
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
227
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
153
228
  - `valueCarbonDioxideDetected*` - Accessory has detected carbon dioxide
229
+ - `valueFault` - Accessory has a fault
230
+ - `valueTampered` - Accessory has been tampered with
154
231
 
155
232
  #### CarbonMonoxideSensor
156
233
  - `topicGetCarbonMonoxideDetected*` - Whether or not the sensor has detected carbon monoxide
157
234
  - `topicGetCarbonMonoxideLevel` - The current carbon monoxide level
158
235
  - `topicGetCarbonMonoxidePeakLevel` - The peak carbon monoxide level
236
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
237
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
159
238
  - `valueCarbonMonoxideDetected*` - Accessory has detected carbon monoxide
239
+ - `valueFault` - Accessory has a fault
240
+ - `valueTampered` - Accessory has been tampered with
160
241
 
161
242
  #### ContactSensor
162
243
  - `topicGetContactSensorState*` - Whether or not sensor has detected contact
244
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
245
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
163
246
  - `valueContactDetected*` - Accessory has detected contact
247
+ - `valueFault` - Accessory has a fault
248
+ - `valueTampered` - Accessory has been tampered with
164
249
 
165
250
  ### HumiditySensor
166
- - `topicGetCurrentRelativeHumidity` - The current relatively humidity
251
+ - `topicGetCurrentRelativeHumidity*` - The current relatively humidity
252
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
253
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
254
+ - `valueFault` - Accessory has a fault
255
+ - `valueTampered` - Accessory has been tampered with
167
256
 
168
257
  #### LeakSensor
169
258
  - `topicGetLeakDetected*` - Whether or not sensor has detected a leak
259
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
260
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
170
261
  - `valueLeakDetected*` - Accessory has detected a leak
262
+ - `valueFault` - Accessory has a fault
263
+ - `valueTampered` - Accessory has been tampered with
264
+
265
+ #### LightSensor
266
+ - `topicGetCurrentAmbientLightLevel*` - The current light level in lux units
267
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
268
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
269
+ - `valueFault` - Accessory has a fault
270
+ - `valueTampered` - Accessory has been tampered with
171
271
 
172
272
  #### MotionSensor
173
273
  - `topicGetMotionDetected*` - Whether or not sensor has detected motion
274
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
275
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
174
276
  - `valueMotionDetected*` - Accessory has detected motion
277
+ - `valueFault` - Accessory has a fault
278
+ - `valueTampered` - Accessory has been tampered with
175
279
 
176
280
  #### OccupancySensor
177
281
  - `topicGetOccupancyDetected*` - Whether or not sensor has detected occupancy
282
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
283
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
178
284
  - `valueOccupancyDetected*` - Accessory has detected occupancy
285
+ - `valueFault` - Accessory has a fault
286
+ - `valueTampered` - Accessory has been tampered with
179
287
 
180
288
  #### SmokeSensor
181
289
  - `topicGetSmokeDetected*` - Whether or not sensor has detected smoke
290
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
291
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
182
292
  - `valueSmokeDetected*` - Accessory has detected smoke
293
+ - `valueFault` - Accessory has a fault
294
+ - `valueTampered` - Accessory has been tampered with
183
295
 
184
296
  #### TemperatureSensor
185
297
  - `topicGetCurrentTemperature*` - The current temperature of the sensor
186
298
  - `temperatureUnits` - The temperature units of the incoming value supplied by the sensor, `C` for Celsius (default) `F` for Fahrenheit
299
+ - `topicGetStatusFault` - Whether or not the sensor has a generic fault
300
+ - `topicGetStatusTampered` - Whether or not the sensor has been tampered with
301
+ - `valueFault` - Accessory has a fault
302
+ - `valueTampered` - Accessory has been tampered with
187
303
 
188
304
  ### Climate Controllers
305
+
306
+ #### Thermostat
189
307
  - `temperatureUnits` - The temperature units of the incoming value supplied by the thermostat, `C` for Celsius (default) `F` for Fahrenheit
308
+ - `topicGetCurrentTemperature*` - Get the current temperature
309
+ - `topicGetCurrentHeatingCoolingState*` - Get the current mode (i.e. cooling, heating, off)
310
+ - `topicGetTargetHeatingCoolingState*` - Get the target mode (i.e. auto, cooling, heating, off)
311
+ - `topicSetTargetHeatingCoolingState*` - Set the target mode (i.e. auto, cooling, heating, off)
312
+ - `topicGetTargetTemperature*` - Get the target temperature
313
+ - `topicSetTargetTemperature*` - Set the target temperature
190
314
  - `topicGetCoolingThresholdTemperature` - Get the cooling threshold temperature
191
315
  - `topicSetCoolingThresholdTemperature` - Set the cooling threshold temparture
192
316
  - `topicGetHeatingThresholdTemperature` - Get the heating threshold temperature
193
317
  - `topicSetHeatingThresholdTemperature` - Set the heating threshold temperature
318
+ - `topicGetCurrentRelativeHumidity` - Get the current humidity
319
+ - `topicGetTargetRelativeHumidity` - Get the target humidity
320
+ - `topicSetTargetRelativeHumidity` - Set the target humidity
321
+ - `topicGetFilterChangeIndication` - Whether or not the filter needs to be changed. *Required if other filter topics are defined.
322
+ - `topicGetFilterLifeLevel` - Filter life remaining as a percentage
323
+ - `topicResetFilterIndication` - Used to reset the filter
324
+ - `valueModeAuto` - Auto mode
325
+ - `valueModeCool` - Cool mode
326
+ - `valueModeHeat` - Heat mode
327
+ - `valueModeOff` - Thermostat off
328
+ - `valueFilterChange` - Indicates that the filter needs to be changed. *Required if `topicGetFilterChangeIndication` is defined.
329
+
330
+ #### AirPurifier
331
+ - `topicGetActive*` - Get whether or not the accessory is currently active
332
+ - `topicSetActive*` - Set whether or not the accessory is currently active
333
+ - `topicGetCurrentPurifierState*` - Get the current mode (i.e. inactive, idle, purifying)
334
+ - `topicGetTargetPurifierState*` - Get the target mode (i.e. auto, manual)
335
+ - `topicSetTargetPurifierState*` - Set the target mode (i.e. auto, manual)
336
+ - `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
337
+ - `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
338
+ - `topicGetRotationSpeed` - Get the rotation speed as a percentage
339
+ - `topicSetRotationSpeed` - Set the rotation speed as a percentage
340
+ - `topicGetSwingMode` - Get whether or not accessory is oscillating
341
+ - `topicSetSwingMode` - Set whether or not accessory is oscillating
342
+ - `topicGetFilterChangeIndication` - Whether or not the filter needs to be changed. *Required if other filter topics are defined.
343
+ - `topicGetFilterLifeLevel` - Filter life remaining as a percentage
344
+ - `topicResetFilterIndication` - Used to reset the filter
345
+ - `valueStateActive*` - Accessory is currently active
346
+ - `valueStateInactive*` - Accessory is currently inactive
347
+ - `valueModeAuto` - Auto target mode
348
+ - `valueModeIdle` - Idle mode
349
+ - `valueModeInactive` - Inactive mode
350
+ - `valueModeManual` - Manual target mode
351
+ - `valueModePurifying` - Purifying mode
352
+ - `valueControlLock` - Physical controls are locked
353
+ - `valueControlUnlock` - Physical controls are unlocked
354
+ - `valueSwingEnabled` - Accessory is oscillating
355
+ - `valueSwingDisabled` - Accessory is not oscillating
356
+ - `valueFilterChange` - Indicates that the filter needs to be changed. *Required if `topicGetFilterChangeIndication` is defined.
357
+
358
+ #### Fanv2
359
+ - `topicGetActive*` - Get whether or not the accessory is currently active
360
+ - `topicSetActive*` - Set whether or not the accessory is currently active
361
+ - `topicGetCurrentFanState` - Get current fan mode (blowing, idle, inactive)
362
+ - `topicGetTargetFanState` - Get target fan mode (auto, manual)
363
+ - `topicSetTargetFanState` - Set target fan mode (auto, manual)
364
+ - `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
365
+ - `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
366
+ - `topicGetRotationDirection` - Get the fan rotation direction (clockwise, counter clockwise)
367
+ - `topicSetRotationDirection` - Set the fan rotation direction (clockwise, counter clockwise)
368
+ - `topicGetRotationSpeed` - Get the rotation speed as a percentage
369
+ - `topicSetRotationSpeed` - Set the rotation speed as a percentage
370
+ - `topicGetSwingMode` - Get whether or not accessory is oscillating
371
+ - `topicSetSwingMode` - Set whether or not accessory is oscillating
372
+ - `valueStateActive*` - Accessory is currently active
373
+ - `valueStateInactive*` - Accessory is currently inactive
374
+ - `valueModeBlowing` - Air blowing mode
375
+ - `valueModeIdle` - Idle mode
376
+ - `valueModeInactive` - Inactive mode
377
+ - `valueModeAuto` - Auto target mode
378
+ - `valueModeManual` - Manual target mode
379
+ - `valueDirectionClockwise` - Rotating clockwise
380
+ - `valueDirectionCounterClockwise` - Rotating counter clockwise
381
+ - `valueControlLock` - Physical controls are locked
382
+ - `valueControlUnlock` - Physical controls are unlocked
383
+ - `valueSwingEnabled` - Accessory is oscillating
384
+ - `valueSwingDisabled` - Accessory is not oscillating
194
385
 
195
386
  #### HeaterCooler
387
+ - `temperatureUnits` - The temperature units of the incoming value supplied by the thermostat, `C` for Celsius (default) `F` for Fahrenheit
196
388
  - `topicGetActive*` - Get whether or not the accessory is currently active
197
389
  - `topicSetActive*` - Set whether or not the accessory is currently active
390
+ - `topicGetCurrentTemperature*` - Get the current temperature
198
391
  - `topicGetCurrentHeaterCoolerState*` - Get the current mode (i.e. inactive, idle, heating, cooling)
199
392
  - `topicGetTargetHeaterCoolerState*` - Get the target mode (i.e. auto, heat, cool)
200
393
  - `topicSetTargetHeaterCoolerState*` - Set the target mode (i.e. auto, heat, cool)
394
+ - `topicGetCoolingThresholdTemperature` - Get the cooling threshold temperature
395
+ - `topicSetCoolingThresholdTemperature` - Set the cooling threshold temparture
396
+ - `topicGetHeatingThresholdTemperature` - Get the heating threshold temperature
397
+ - `topicSetHeatingThresholdTemperature` - Set the heating threshold temperature
201
398
  - `topicGetLockPhysicalControls` - Get whether or not the physical controls are locked
202
399
  - `topicSetLockPhysicalControls` - Set whether or not the physical controls are locked
203
400
  - `topicGetRotationSpeed` - Get the rotation speed as a percentage
204
401
  - `topicSetRotationSpeed` - Set the rotation speed as a percentage
205
402
  - `topicGetSwingMode` - Get whether or not accessory is oscillating
206
403
  - `topicSetSwingMode` - Set whether or not accessory is oscillating
404
+ - `topicGetFilterChangeIndication` - Whether or not the filter needs to be changed. *Required if other filter topics are defined.
405
+ - `topicGetFilterLifeLevel` - Filter life remaining as a percentage
406
+ - `topicResetFilterIndication` - Used to reset the filter
207
407
  - `valueStateActive*` - Accessory is currently active
208
408
  - `valueStateInactive*` - Accessory is currently inactive
209
409
  - `valueModeAuto` - Mode is auto
@@ -215,24 +415,28 @@ As with topics, you will also need to populate the appropriate values based on t
215
415
  - `valueControlUnlock` - Physical controls are unlocked
216
416
  - `valueSwingEnabled` - Accessory is oscillating
217
417
  - `valueSwingDisabled` - Accessory is not oscillating
218
-
219
- #### Thermostat
220
- - `topicGetCurrentHeatingCoolingState*` - Get the current mode (i.e. cooling, heating, off)
221
- - `topicGetTargetHeatingCoolingState*` - Get the target mode (i.e. auto, cooling, heating, off)
222
- - `topicSetTargetHeatingCoolingState*` - Set the target mode (i.e. auto, cooling, heating, off)
223
- - `topicGetCurrentTemperature*` - Get the current temperature
224
- - `topicGetTargetTemperature*` - Get the target temperature
225
- - `topicSetTargetTemperature*` - Set the target temperature
226
- - `topicGetCurrentRelativeHumidity` - Get the current humidity
227
- - `topicGetTargetRelativeHumidity` - Get the target humidity
228
- - `topicSetTargetRelativeHumidity` - Set the target humidity
229
- - `valueModeAuto` - Auto mode
230
- - `valueModeCool` - Cool mode
231
- - `valueModeHeat` - Heat mode
232
- - `valueModeOff` - Thermostat off
418
+ - `valueFilterChange` - Indicates that the filter needs to be changed. *Required if `topicGetFilterChangeIndication` is defined.
233
419
 
234
420
  ### Others
235
421
 
422
+ #### GarageDoorOpener
423
+ - `topicGetCurrentDoorState*` - Current state of the garage door, i.e. open/opening/closed/closing/stopped
424
+ - `topicGetTargetDoorState*` - Target state of the garage door, i.e. open/closed
425
+ - `topicSetTargetDoorState*` - Set the target door state, i.e. open/closed
426
+ - `topicGetObstructionDetected*` - Whether or not the garage door is obstructed
427
+ - `topicGetCurrentLockState` - The current state of the garage lock, i.e. locked/unlocked
428
+ - `topicGetTargetLockState` - The target (i.e. desired) state of the garage lock
429
+ - `topicSetTargetLockState` - For setting the target (i.e. desired) state of the garage lock
430
+ - `valueDoorObstructed*` - Door is obstructed
431
+ - `valueDoorStateClosed` - Door is closed
432
+ - `valueDoorStateClosing` - Door is closing
433
+ - `valueDoorStateOpen` - Door is open
434
+ - `valueDoorStateOpening` - Door is opening
435
+ - `valueDoorStateStopped` - Door is stopped
436
+ - `valueLockStateJammed` - Door lock is jammed
437
+ - `valueLockStateSecured` - Door is locked
438
+ - `valueLockStateUnsecured` - Door is unlocked
439
+
236
440
  #### LockMechanism
237
441
  - `topicGetCurrentLockState*` - The current state of the lock, i.e. locked/unlocked
238
442
  - `topicGetTargetLockState*` - The target (i.e. desired) state of the lock
@@ -255,6 +459,24 @@ As with topics, you will also need to populate the appropriate values based on t
255
459
  - `valueFault` - Accessory has a fault
256
460
  - `valueTampered` - Accessory has been tampered with
257
461
 
462
+ #### Valve
463
+ - `valveType` - One of `GENERIC_VALVE` (default), `IRRIGATION`, `SHOWER_HEAD`, or `WATER_FAUCET`
464
+ - `topicGetValveActive*` - For getting whether or not the valve is active
465
+ - `topicSetValveActive*` - For setting whether or not the valve is active
466
+ - `topicGetValveInUse*` - For getting whether or not the valve is in use
467
+ - `topicGetStatusFault` - For getting whether or not there is a fault
468
+ - `topicGetValveIsConfigured` - For getting wether or not valve is configured
469
+ - `topicSetValveIsConfigured` - For setting wether or not valve is configured
470
+ - `topicGetValveSetDuration` - For getting the set duration in seconds
471
+ - `topicSetValveSetDuration` - For setting the set duration in seconds
472
+ - `topicGetValveRemainingDuration` - For getting the time remaining in seconds
473
+ - `valueActive*` - Valve is active, e.g. "true", or "1", or "active"
474
+ - `valueInactive*` - Valve is not active e.g. "false", or "0", or "active"
475
+ - `valueInUse*` - Valve is in use, e.g. "true", or "1", or "used"
476
+ - `valueConfigured` - Valve is configured, e.g. "true", or "1", or "configured"
477
+ - `valueNotConfigured` - Valve is not configured, e.g. "false", or "0", or "unconfigured"
478
+ - `valueFault` - Valve has a fault, e.g. "error", or "-1"
479
+
258
480
  ## Logging/Debugging:
259
481
 
260
482
  By default, devices will log activity, for example when a Switch is turned on or a LockMechanism is unlocked.
@@ -269,10 +491,29 @@ You may also turn on additional logging if you'd like to see the MQTT messages p
269
491
 
270
492
  ## MQTT Options
271
493
 
272
- You are able to pass in any arbitrary MQTT options via `mqtt.options` in the config. This can include, for example, such as clientId, protocolVersion, etc. Just make sure the value provided is valid JSON. For example:
494
+ You are able to pass in any arbitrary MQTT options via `mqtt.options` in the config. This can be a combination of [client options](https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#mqttclientstreambuilder-options) and [publish options](https://github.com/mqttjs/MQTT.js?tab=readme-ov-file#mqttclientpublishtopic-message-options-callback). Just make sure the value provided is valid JSON. For example:
273
495
 
274
496
  ```
275
- "options": "{ \"protocolVersion\": \"4\", \"clientId\": \"my-client-id\", \"rejectUnauthorized\": true }"
497
+ "options": "{ \"protocolVersion\": \"4\", \"clientId\": \"my-client-id\", \"retain\": true }"
498
+ ```
499
+
500
+ ## MQTT OnConnect
501
+
502
+ Accessories can be configured to publish any number of arbitratry messages to the MQTT server on connect. This can be useful to invoke accessories to give updates on their current status.
503
+
504
+ Each entry should have a topic and a message:
505
+
506
+ ```
507
+ "onConnect": [
508
+ {
509
+ "topic": "some/arbitrary/topic",
510
+ "message": "connected",
511
+ },
512
+ {
513
+ "topic": "another/arbitrary/topic",
514
+ "message": "{ \"value\": \"can also be json\" }",
515
+ }
516
+ ]
276
517
  ```
277
518
 
278
519
  ## JSONPaths
@@ -371,6 +612,12 @@ Due to the complexity, this was intentionally left out of the plugin config UI,
371
612
 
372
613
  Since `customCharacteristics` is an array, you may define as many custom characteristics as you wish.
373
614
 
615
+ ## Persistance
616
+
617
+ By default, all accessory values are saved and reloaded when the plugin restarts. However, you may override this behavior by selecting `Reset on Restart` option and accessories will be reset to defaults whenever the plugin or Homebridge restarts.
618
+
619
+ - `"resetOnRestart": true`
620
+
374
621
  ## Credits
375
622
 
376
623
  [@arachnetech](https://github.com/arachnetech) for the fantastic [homebridge-mqttthing](https://github.com/arachnetech/homebridge-mqttthing) plugin which serves as the main inspiration for this project