Skip to content

Commit e8ff064

Browse files
committed
Adding support for CO, CO2, Contact, Humidity, Leak, Motion, Occupancy, and Smoke sensors
1 parent 823e669 commit e8ff064

20 files changed

Lines changed: 1091 additions & 236 deletions

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
All notable changes to homebridge-dummy will be documented in this file.
44

5-
## 1.3.0-beta.0 (2025-09-XX)
5+
## 1.3.0-beta.3 (2025-09-XX)
66

77
### HELP NEEDED! (no coding experience required)
88

99
Would you like to see Homebridge Easy MQTT in your language? Please consider [getting involved](https://github.com/mpatfield/homebridge-easy-mqtt/issues/4).
1010

1111
### Added
12+
- Support for CO, CO2, Contact, Humidity, Leak, Motion, Occupancy, and Smoke sensors
1213
- Support for arbitrary custom characteristics ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#custom-characteristics))
1314
- JSONPath support in setter topics ([documentation](https://github.com/mpatfield/homebridge-easy-mqtt#jsonpaths))
1415
- Banner image in config UI

README.md

Lines changed: 137 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,22 @@ Any issues or damage resulting from use of this plugin are not the fault of the
2323

2424
This plugin is designed to be a simple replacement for the fantastic [homebridge-mqttthing](https://github.com/arachnetech/homebridge-mqttthing) plugin which appears as though it's [no longer](https://github.com/arachnetech/homebridge-mqttthing/commits/master/) being actively developed.
2525

26-
**HomebridgeEasyMQTT** currently supports `Lightbulb`, `LockMechanism`, `Outlet`, `SecuitySystem`,`Switch`, and `TemperatureSensor`, but will be expanded over time as more use cases are discovered. If there is an accessory type you'd like to see supported, please feel free to [create an issue in GitHub](https://github.com/mpatfield/homebridge-easy-mqtt/issues/new/choose).
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+
28+
- `CarbonDioxideSensor`
29+
- `CarbonMonoxideSensor`
30+
- `ContactSensor`
31+
- `HumiditySensor`
32+
- `LeakSensor`
33+
- `Lightbulb`
34+
- `LockMechanism`
35+
- `MotionSensor`
36+
- `OccupancySensor`
37+
- `Outlet`
38+
- `SecuritySystem`
39+
- `SmokeSensor`
40+
- `Switch`
41+
- `TemperatureSensor`
2742

2843
## Configuration
2944

@@ -58,123 +73,139 @@ Using the Homebridge Config UI is the easiest way to set up this plugin. However
5873
}
5974
6075
],
61-
"topicGetStatusActive": "string",
62-
"topicGetCurrentLockState": "string",
63-
"topicGetTargetLockState": "string",
64-
"topicSetTargetLockState": "string",
65-
"topicGetOn": "string",
66-
"topicSetOn": "string",
67-
"valueStatusActive": "string",
68-
"valueLockStateSecured": "string",
69-
"valueLockStateUnsecured": "string",
70-
"valueLockStateJammed": "string",
71-
"valueOn": "string",
72-
"valueOff": "string",
73-
"disableLogging": false
74-
}
75-
76+
"disableLogging": false,
77+
… // See Topics & Values below for additional attributes for each accessory type
7678
],
7779
"verbose": false,
7880
"platform": "HomebridgeEasyMQTT"
7981
}
8082
```
8183

82-
All fields are required unless noted as "(Optional)"
84+
Required fields are marked with an asterisk (*)
8385

84-
Info:
85-
- `id` - A unique ID to identify this accessory. Changing this value will result in a new accessory.
86-
- `name` - The display name for the accessory in HomeKit
87-
- `type` - The type of accessory, currently Lightbulb, LockMechanism, Outlet, SecuitySystem, Switch, and Temperature Sensor are supported
88-
- `manufacturer` - (Optional) The accessory manufacturer which will display in HomeKit device details
89-
- `model` - (Optional) The accessory model which will display in HomeKit device details
90-
- `serialNumber` - (Optional) The accessory serial number which will display in HomeKit device details
91-
- `version` - (Optional) The accessory software version which will display in HomeKit device details
86+
### Info
87+
- `id*` - A unique ID to identify this accessory. Changing this value will result in a new accessory.
88+
- `name*` - The display name for the accessory in HomeKit
89+
- `type*` - The type of accessory, currently Lightbulb, LockMechanism, Outlet, SecuritySystem, Switch, and Temperature Sensor are supported
90+
- `manufacturer` - The accessory manufacturer which will display in HomeKit device details
91+
- `model` - The accessory model which will display in HomeKit device details
92+
- `serialNumber` - The accessory serial number which will display in HomeKit device details
93+
- `version` - The accessory software version which will display in HomeKit device details
9294

93-
MQTT:
94-
- `broker` - The URL and port to use for communicating with your MQTT device
95-
- `username` - (Optional) Username
96-
- `password` - (Optional) Password
97-
- `options` - (Optional) See [MQTT Options](#mqtt-options) below
95+
### MQTT:
96+
- `broker*` - The URL and port to use for communicating with your MQTT device
97+
- `username` - Username
98+
- `password` - Password
99+
- `options` - See [MQTT Options](#mqtt-options) below
98100

99-
Topics:
101+
## Topics & Values
100102

101-
You will need to make sure to populate the appropriate topics based on the type.
103+
You will need to make sure to populate the appropriate topics based on the accessory type defined below.
102104

103105
You may define topics using a JSONPath dot notation to assist the parser in finding the right value within the message. See [JSONPaths](#jsonpaths) below for more details.
104106

105-
- General Purpose
106-
- `topicGetStatusActive` - (Optional) Whether or not the accessory is connected/reachable
107-
108-
- Lightbulb
109-
- `topicGetBrightness` - (Optional) The current brightness as a percent
110-
- `topicSetBrightness` - (Optional) For setting the brightness
111-
- `topicGetHue` - (Optional) The lightbulb's current hue
112-
- `topicSetHue` - (Optional) For setting the lightbulb's current hue
113-
- `topicGetColorTemperature` - (Optional) The current color temperature of the lightbulb
114-
- `topicSetColorTemperature` - (Optional) For setting the color temperature of the lightbulb
115-
- `topicGetSaturation` - (Optional) The current saturation setting of the lightbulb
116-
- `topicSetSaturation` - (Optional) For setting the saturation setting of the lightbulb
117-
118-
- LockMechanism
119-
- `topicGetCurrentLockState` - The current state of the lock, i.e. locked/unlocked
120-
- `topicGetTargetLockState` - The target (i.e. desired) state of the lock
121-
- `topicSetTargetLockState` - For setting the target (i.e. desired) state of the lock
122-
123-
- Outlet
124-
- `topicGetOn` - The current state of the outlet, i.e. on/off
125-
- `topicSetOn` - For setting the state of the outlet
126-
- `topicGetOutletInUse` - (Optional) Whether or not the outlet is currently being used
127-
128-
- SecuitySystem
129-
- `topicGetCurrentSecurityState` — The current state of the system
130-
- `topicGetTargetSecurityState` — The target state of the system
131-
- `topicSetTargetSecurityState` — For setting the target state of the system
132-
- `topicGetStatusTampered` — For getting whether the system has been tampered with
133-
- `topicGetStatusFault` — For getting whether there is a system error
134-
135-
- Switch
136-
- `topicGetOn` - The current state of the switch, i.e. on/off
137-
- `topicSetOn` - For setting the state of the switch
138-
139-
- TemperatureSensor
140-
- `topicGetCurrentTemperature` - The current temperature of the sensor
141-
- `temperatureUnits` - (Optional) The temperature units of the incoming value supplied by the sensor, `C` for Celsius (default) `F` for Fahrenheit
142-
143-
Values:
144-
145-
As with Topics, you will 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.
146-
147-
- General Purpose
148-
- `valueStatusActive` - Accessory is connected/reachable, e.g. "true", "1", or "Alive"
149-
150-
- Lightbulb
151-
- `valueOn` - Turned on, e.g. "true", or "1", or "On"
152-
- `valueOff` - Turned off, e.g. "false", or "0", or "Off"
153-
154-
- LockMechanism
155-
- `valueLockStateSecured` - Locked state, e.g. "true", "255", or "Locked"
156-
- `valueLockStateUnsecured` - Unlocked state, e.g. "false", "0", or "Unlocked"
157-
- `valueLockStateJammed` - (Optional) Lock is jammed, e.g. "254" or "Jammed"
158-
159-
- Outlet
160-
- `valueOn` - Turned on, e.g. "true", or "1", or "On"
161-
- `valueOff` - Turned off, e.g. "false", or "0", or "Off"
162-
- `valueOutletInUse` - Currently being used, e.g. "true", or "1", or "On"
163-
164-
- SecuritySystem
165-
- `valueArmStay` — (Optional) system armed in stay mode, e.g. "SA" or "stay"
166-
- `valueArmAway` — (Optional) system armed in away mode, e.g. "AA" or "away"
167-
- `valueArmNight` — (Optional) system armed in night mode, e.g. "NA" or "night"
168-
- `valueDisarm` — (Optional) system armed in away mode, e.g. "D" or "disarmed"
169-
- `valueAlarmTriggered` — (Optional) when the alarm has been triggered, e.g. "true" or "1" or "triggered"
170-
- `valueTampered` — (Optional) when the system has been tampered with, e.g. "true" or "1" or "tampered"
171-
- `valueFault` — (Optional) when the system has a general fault, e.g. "true" or "1" or "fault"
172-
173-
- Switch
174-
- `valueOn` - Turned on, e.g. "true", or "1", or "On"
175-
- `valueOff` - Turned off, e.g. "false", or "0", or "Off"
176-
177-
Logging/Debugging:
107+
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.
108+
109+
### General Purpose
110+
- `topicGetStatusActive` - Whether or not the accessory is connected/reachable
111+
- `topicGetBatteryLow` - Wether or not the accessory has a low battery
112+
- `topicGetBatteryLevel` - Percentage as a number
113+
- `valueStatusActive` - Accessory is connected/reachable, e.g. "true", "1", or "Alive"
114+
- `valueBatteryLow` - Accessory has a low battery level
115+
116+
### On/Off Accessories
117+
- `topicGetOn*` - The current state of the outlet, i.e. on/off
118+
- `topicSetOn*` - For setting the state of the outlet
119+
- `valueOn*` - Turned on, e.g. "true", or "1", or "On"
120+
- `valueOff*` - Turned off, e.g. "false", or "0", or "Off"
121+
122+
#### Lightbulb
123+
- `topicGetBrightness` - The current brightness as a percent
124+
- `topicSetBrightness` - For setting the brightness
125+
- `topicGetColorTemperature` - The current color temperature of the lightbulb
126+
- `topicSetColorTemperature` - For setting the color temperature of the lightbulb
127+
- `topicGetHue` - The lightbulb's current hue
128+
- `topicSetHue` - For setting the lightbulb's current hue
129+
- `topicGetSaturation` - The current saturation setting of the lightbulb
130+
- `topicSetSaturation` - For setting the saturation setting of the lightbulb
131+
132+
#### Outlet
133+
- `topicGetOutletInUse` - Whether or not the outlet is currently being used
134+
- `valueOutletInUse` - Currently being used, e.g. "true", or "1", or "On"
135+
136+
#### Switch
137+
-
138+
139+
### Sensors
140+
- `topicGetStatusFault` - Whether or not the sensor has a generic fault
141+
- `topicGetStatusTampered` - Whether or not the sensor has been tampered with
142+
- `valueFault` - Accessory has a fault
143+
- `valueTampered` - Accessory has been tampered with
144+
145+
#### CarbonDioxideSensor
146+
- `topicGetCarbonDioxideDetected*` - Whether or not the sensor has detected carbon dioxide
147+
- `topicGetCarbonDioxideLevel` - The current carbon dioxide level
148+
- `topicGetCarbonDioxidePeakLevel` - The peak carbon dioxide level
149+
- `valueCarbonDioxideDetected*` - Accessory has detected carbon dioxide
150+
151+
#### CarbonMonoxideSensor
152+
- `topicGetCarbonMonoxideDetected*` - Whether or not the sensor has detected carbon monoxide
153+
- `topicGetCarbonMonoxideLevel` - The current carbon monoxide level
154+
- `topicGetCarbonMonoxidePeakLevel` - The peak carbon monoxide level
155+
- `valueCarbonMonoxideDetected*` - Accessory has detected carbon monoxide
156+
157+
#### ContactSensor
158+
- `topicGetContactSensorState*` - Whether or not sensor has detected contact
159+
- `valueContactDetected*` - Accessory has detected contact
160+
161+
### HumiditySensor
162+
- `topicGetCurrentRelativeHumidity` - The current relatively humidity
163+
164+
#### LeakSensor
165+
- `topicGetLeakDetected*` - Whether or not sensor has detected a leak
166+
- `valueLeakDetected*` - Accessory has detected a leak
167+
168+
#### MotionSensor
169+
- `topicGetMotionDetected*` - Whether or not sensor has detected motion
170+
- `valueMotionDetected*` - Accessory has detected motion
171+
172+
#### OccupancySensor
173+
- `topicGetOccupancyDetected*` - Whether or not sensor has detected occupancy
174+
- `valueOccupancyDetected*` - Accessory has detected occupancy
175+
176+
#### SmokeSensor
177+
- `topicGetSmokeDetected*` - Whether or not sensor has detected smoke
178+
- `valueSmokeDetected*` - Accessory has detected smoke
179+
180+
#### TemperatureSensor
181+
- `topicGetCurrentTemperature*` - The current temperature of the sensor
182+
- `temperatureUnits` - The temperature units of the incoming value supplied by the sensor, `C` for Celsius (default) `F` for Fahrenheit
183+
184+
### Others
185+
186+
#### LockMechanism
187+
- `topicGetCurrentLockState*` - The current state of the lock, i.e. locked/unlocked
188+
- `topicGetTargetLockState*` - The target (i.e. desired) state of the lock
189+
- `topicSetTargetLockState*` - For setting the target (i.e. desired) state of the lock
190+
- `valueLockStateSecured*` - Locked state, e.g. "true", "255", or "Locked"
191+
- `valueLockStateUnsecured*` - Unlocked state, e.g. "false", "0", or "Unlocked"
192+
- `valueLockStateJammed` - Lock is jammed, e.g. "254" or "Jammed"
193+
194+
#### SecuritySystem
195+
- `topicGetCurrentSecurityState*` — The current state of the system
196+
- `topicGetTargetSecurityState*` — The target state of the system
197+
- `topicSetTargetSecurityState*` — For setting the target state of the system
198+
- `topicGetStatusFault` — For getting whether there is a system error
199+
- `topicGetStatusTampered` — For getting whether the system has been tampered with
200+
- `valueArmStay` - system armed in stay mode, e.g. "SA" or "stay"
201+
- `valueArmAway` - system armed in away mode, e.g. "AA" or "away"
202+
- `valueArmNight` - system armed in night mode, e.g. "NA" or "night"
203+
- `valueDisarm` - system armed in away mode, e.g. "D" or "disarmed"
204+
- `valueAlarmTriggered` - when the alarm has been triggered, e.g. "true" or "1" or "triggered"
205+
- `valueFault` - Accessory has a fault
206+
- `valueTampered` - Accessory has been tampered with
207+
208+
## Logging/Debugging:
178209

179210
By default, devices will log activity, for example when a Switch is turned on or a LockMechanism is unlocked.
180211

@@ -281,7 +312,7 @@ Due to the complexity, this was intentionally left out of the plugin config UI,
281312
- `uuid` — A unique string (recommend using a (UUID generator)[https://www.uuidgenerator.net/])
282313
- `name` — The display name for the characteristic
283314
- `getTopic` — The topic which provides the numeric value
284-
- `units` — (Optional) The units which will be displayed at the end of the numeric value
315+
- `units` - The units which will be displayed at the end of the numeric value
285316

286317
Since `customCharacteristics` is an array, you may define as many custom characteristics as you wish.
287318

0 commit comments

Comments
 (0)