Skip to content

Commit ddea902

Browse files
authored
Merge pull request #2 from jimtng/develop
Merged from develop for v 1.1.0. Changes in partition topics
2 parents 912b7f2 + ef0be33 commit ddea902

File tree

4 files changed

+301
-181
lines changed

4 files changed

+301
-181
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,27 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
55

6+
## [1.1.0]
7+
### Added
8+
- The alarm panel's time is published via MQTT Topic `homie/device-id/alarm/panel-time` and set through `homie/device-id/alarm/panel-time/set`
9+
- MQTT Topic `homie/device-id/partition-N/entry-delay` to indicate that the alarm is in the entry-delay state
10+
- MQTT Topic `homie/device-id/partition-N/access-code` the access code is published whenever the alarm was armed/disarmed
11+
- MQTT Topic `homie/device-id/partition-N/lights` the light status for the partition
12+
13+
### Changed
14+
- Major change: each partition is now implemented as a individual node.
15+
MQTT topics `partition-N-xxx` moved from the `alarm` node to individual `partition-N` nodes. Hence the topics will change from `homie/device-id/alarm/partition-N-away` to `homie/device-id/partition-N/away` etc. Note the removal of `alarm` in the topic.
16+
- Only active partitions are announced. If partitions were added/removed from the alarm after boot up, perform a reboot via `maintenance/set`: `reboot`
17+
- Updated library dependency to use Homie-esp8266 v3.0.1 (Homie convention v3)
18+
- Updated library dependency to use dscKeybusInterface v1.3 (develop branch)
19+
- `openzone-N` topics changed from retained to not retained
20+
21+
### Fixed
22+
- Fixed a bug when writing to `keypad` topic
23+
624
## [1.0.1] 2019-06-05
725
### Added
8-
- MQTT Topic `maintenance` - See README.md. Added the ability to stop and start the dsc interface, needed to avoid crashing during config update
26+
- MQTT Topic `maintenance` - See (README.md). Added the ability to stop and start the dsc interface, needed to avoid crashing during config update
927

1028
### Removed
1129
- MQTT Topic `reboot` has been removed. Its functionality has been incorporated into the new `maintenance` topic

README.md

Lines changed: 68 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,88 @@ For a detailed wiring diagram, please see:
88
https://github.com/taligentx/dscKeybusInterface
99

1010

11-
## Features:
11+
## Features
1212
- MQTT Based
1313
- OTA Updateable (Thanks to Homie)
1414
- Configurable Wifi, MQTT, device id, and Alarm's access code. See the Setup Instructions below
15-
- Tested with OpenHAB, but it should work with other home automation systems
15+
- Tested with OpenHAB, but it should work with other home automation systems. Let me know if you're using it with other home automation systems so I can update this document.
1616

17+
## Usage Examples
18+
- To arm partition 1 to away mode, publish to `homie/device-id/partition-1/away/set`: `1`
19+
- To disarm it, publish to `homie/device-id/partition-1/away/set`: `0`
20+
- To monitor motions on zone 1 (regardless of armed status), subscribe to `homie/device-id/alarm/openzone-1`
21+
- To know partition 1 alarm has been triggered, subscribe to `homie/device-id/partition-1/alarm`
22+
- When zone 3 triggered an alarm `homie/device-id/alarm/alarmzone-3` will be published with a value of `1`
23+
- To know whether partition 1 is armed, subscribe to `homie/device-id/partition-1/away` for away mode, or `homie/device-id/partition-1/stay` for stay mode
1724

18-
## MQTT Topics:
25+
## Homie
26+
The Homie convention specifies the following syntax for MQTT topics:
27+
`homie/device-id/nodename/xxx`
1928

20-
Base MQTT Topic (prepend this to all the topics below):
21-
```
22-
homie/device-id/alarm/
23-
```
29+
- The `device-id` can be set in Homie configuration - see **Initial Setup** below.
30+
31+
## Homie Nodes
32+
- `alarm` for the main alarm functionalities
33+
- `partition-N` for partition related status/commands
34+
35+
So for `alarm` node, the full MQTT topics will start with `homie/device-id/alarm/`, and for the `partition-N` the full MQTT topics will be `homie/device-id/partition-N/`
36+
37+
## MQTT Topics:
2438

2539
### General MQTT topics:
26-
- `trouble`
27-
- `power-trouble`
28-
- `battery-trouble`
29-
- `fire-alarm-keypad`
30-
- `aux-alarm-keypad`
31-
- `panic-alarm-keypad`
40+
- `homie/device-id/alarm/trouble` this corresponds to the "Trouble" light / status of the alarm
41+
- `homie/device-id/alarm/power-trouble`
42+
- `homie/device-id/alarm/battery-trouble`
43+
- `homie/device-id/alarm/fire-alarm-keypad`
44+
- `homie/device-id/alarm/aux-alarm-keypad`
45+
- `homie/device-id/alarm/panic-alarm-keypad`
46+
- `homie/device-id/alarm/panel-time` provides the date/time stored in the alarm system formatted as YYYY-MM-DD HH:mm
3247

3348
### Partitions:
34-
- `partition-1-away`: 0 (disarmed) | 1 (armed away)
35-
- `partition-1-stay`: 0 (disarmed) | 1 (armed stay)
36-
- `partition-1-alarm`: 0 (no alarm) | 1 (triggered)
37-
- `partition-1-fire`: 0 (no alarm) | 1 (fire alarm)
49+
Each partition is implemented as a homie node, so the base MQTT topic for partition 1 is `homie/device-id/partition-N/`
50+
- `homie/device-id/partition-1/away`: 0 (disarmed) | 1 (armed away)
51+
- `homie/device-id/partition-1/stay`: 0 (disarmed) | 1 (armed stay)
52+
- `homie/device-id/partition-1/alarm`: 0 (no alarm) | 1 (the alarm has been triggered)
53+
- `homie/device-id/partition-1/entry-delay`: 0 | 1 (the system is in entry-delay state)
54+
- `homie/device-id/partition-1/exit-delay`: 0 | 1 (the system is in exit-delay state)
55+
- `homie/device-id/partition-1/fire`: 0 (no alarm) | 1 (fire alarm)
56+
- `homie/device-id/partition-1/access-code`: The access code used to arm/disarm
57+
- `homie/device-id/partition-1/lights`: Status lights in JSON { "ready": "ON|OFF", "armed": "ON|OFF", "memory": "ON|OFF", "bypass": "ON|OFF", "trouble": "ON|OFF", "program": "ON|OFF", "fire": "ON|OFF", "backlight": "ON|OFF"}
3858
- ...
39-
- `partition-N-xxxx` as above
59+
- `homie/device-id/partition-N/xxxx` as above
60+
61+
### To arm/disarm a partition, publish to:
62+
- `homie/device-id/partition-N/away/set`: 1 | on | arm = arm partition N - away mode. 0 | off | disarm = disarm
63+
- `homie/device-id/partition-N/stay/set`: 1 | on | arm = arm partition N - stay mode. 0 | off | disarm = disarm
4064

4165
### Zones:
42-
- `openzone-1`: 0 (no movement) | 1 (movement detected)
66+
#### General Motion Detection
67+
These will be published whenever motion is detected within the zone, regardless of the armed state:
68+
- `homie/device-id/alarm/openzone-1`: 0 (no movement) | 1 (movement detected)
4369
- ...
44-
- `openzone-N`: as above
70+
- `homie/device-id/alarm/openzone-N`: as above
4571

46-
- `alarmzone-1`: 0|1
72+
#### Triggered Alarm Zones
73+
These will be published when the alarm was triggered by zone motion detection during the armed state:
74+
- `homie/device-id/alarm/alarmzone-1`: 0|1
4775
- ...
48-
- `alarmzone-N`: as above
76+
- `homie/device-id/alarm/alarmzone-N`: as above
4977

5078
## Commands
5179
### To request status refresh, publish to
52-
- `refresh-status/set`: 1
80+
- `homie/device-id/alarm/refresh-status/set`: 1
81+
82+
### To set the panel date/time, publish to
83+
- `homie/device-id/alarm/panel-time/set`: "YYYY-MM-DD HH:mm"
5384

5485
### To reboot the device, publish to
55-
- `maintenance/set`: "reboot" to reboot
56-
- `maintenance/set`: "dsc-stop" to stop dsc keybus interrupts
57-
- `maintenance/set`: "dsc-start" to start dsc keybus interface
86+
- `homie/device-id/alarm/maintenance/set`: "reboot" to reboot
87+
- `homie/device-id/alarm/maintenance/set`: "dsc-stop" to stop dsc keybus interrupts
88+
- `homie/device-id/alarm/maintenance/set`: "dsc-start" to start dsc keybus interface
5889

5990
The DSC Keybus interrupts seem to interfere with the OTA and Config update operation (when publishing to `homie/device-id/$implementation/config/set`), causing the ESP8266 to reset, and in the case of configuration update, to cause a corruption in the Homie configuration file and put Homie into the initial configuration mode.
6091

61-
So before sending a config update, stop the DSC interrupts by publishing to `maintenance/set`: "dsc-stop". Once the config update has been made, restart the DSC interface using `maintenance/set`: "dsc-start" or sending a reboot request.
62-
63-
64-
### To arm/disarm a partition, publish to:
65-
- `partition-N-away/set`: 0 (disarm) | 1 (arm partition - away mode)
66-
- `partition-N-stay/set`: 0 (disarm) | 1 (arm partition - stay mode)
92+
So before sending a config update, stop the DSC interrupts by publishing to `homie/device-id/alarm/maintenance/set`: "dsc-stop". Once the config update has been made, restart the DSC interface using `homie/device-id/alarm/maintenance/set`: "dsc-start" or sending a reboot request.
6793

6894
## Initial Setup
6995
Homie needs to be configured before it can connect to your Wifi / MQTT server.
@@ -98,9 +124,9 @@ curl -X PUT http://192.168.123.1/config --header "Content-Type: application/json
98124
## Updating The Stored Alarm Access Code
99125

100126
Before updating Homie config, the DSC interface needs to be deactivated / stopped, because it interferes with writing the configuration file. To do this, publish an MQTT message to
101-
`maintenance/set` `dsc-stop`
127+
`homie/device-id/alarm/maintenance/set` `dsc-stop`
102128

103-
After setting the configuration, reactivate the DSC interface by publishing to `maintenance/set` `dsc-start`
129+
After setting the configuration, reactivate the DSC interface by publishing to `homie/device-id/alarm/maintenance/set` `dsc-start`
104130

105131
To change/update your access code that's stored on the device once it's operational (i.e. connected to your MQTT server), publish to
106132
`homie/device-id/$implementation/config/set {"settings":{"access-code":"1234"}}`
@@ -115,4 +141,12 @@ Note
115141
- The last step may be unnecessary because the ESP8266 seems to crash and restart, but the config gets updated.
116142
- You can update the wifi / mqtt connection details in the same manner
117143

144+
## Library Dependencies
145+
- [Homie-esp8266 v3.x](https://github.com/homieiot/homie-esp8266.git#develop-v3)
146+
- [dscKeybusReader v1.3](https://github.com/taligentx/dscKeybusInterface.git#develop)
147+
148+
## Tips When Working with the Alarm
149+
150+
- My alarm would go off when I opened my panel enclosure. It uses zone 5 for this detection. In order to stop it from going off, bypass zone 5 using `*1` to enter bypass mode. The zone LEDs will light up for bypassed zones. To toggle the zone bypass, enter the 2 digit zone number, e.g. `05`. When zone 5 is lit up, it will be bypassed. Press `#` to return to ready state.
118151

152+
- While working/testing the alarm, disconnect the internal / external speakers, and replace it with a 10K resistor. This will avoid disturbing the neighbours.

platformio.ini

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
; Please visit documentation for the other options and examples
99
; https://docs.platformio.org/page/projectconf.html
1010

11+
;[env:nodemcu]
1112
[env:d1_mini_pro]
1213
platform = espressif8266
14+
;board = nodemcu
1315
board = d1_mini_pro
1416
framework = arduino
15-
lib_deps = dscKeybusInterface, Homie
17+
lib_deps =
18+
https://github.com/taligentx/dscKeybusInterface.git#develop
19+
https://github.com/homieiot/homie-esp8266.git#develop-v3
1620
build_flags = -D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
17-
monitor_speed = 115200
21+
monitor_speed = 115200
22+

0 commit comments

Comments
 (0)