You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To have a carbon monoxide sensor appear in the Home.app, the CarbonMonoxide service is used.
19
-
Required value is `CarbonMonoxideDetected`, there will be a simple example and detailed example included below.
20
-
Characteristic Properties are not needed for this setup, the values will be updated in the Home.app based on what is being sent from your sensors.
18
+
{{< alert icon="💡" text="Home.app will not display the <strong>Carbon Monoxide Level</strong> in the Accessory's bubble." />}}
21
19
22
-
## Example
23
-
24
-
These examples are meant to be copied into your Node-RED system and adapted to your setup.
25
-
26
-
**Please note:** Different from other HomeKit services (e.g. temperature sensor) the Home.app is not showing the carbon monoxide level on the device icon. To view the current value you have to open the preferences of the device in the Home.app or ask Siri. This works as designed by Apple and can't be changed.
27
-
28
-
### Simple Carbon Monoxide Sensor
20
+
## Basic Principle
29
21
30
-
This example is a simple Carbon Monoxide sensor that is only ever "triggered" or "normal". The msg.payload going in is either `{"CarbonMonoxideDetected":1}` or `{"CarbonMonoxideDetected":0}` where 1 is "carbon monoxide detected" and 0 is "normal conditions". Use this example as a starting point for simple alarms that do not send detailed levels.
22
+
This is the simplest example of a CO Sensor item. The input nodes are `Detected` and `Not Detected`.
31
23
32
-

24
+

33
25
34
26
Copyable Node-RED flow:
35
27
36
28
```json
37
29
[{"id":"ac79f4f4.906df8","type":"homekit-service","z":"54339415.36f384","bridge":"d334490b.40dac","name":"Simple CO","serviceName":"CarbonMonoxideSensor","topic":"","manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","characteristicProperties":"{}","x":670,"y":800,"wires":[["933cc1a6.dc8c98"]]},{"id":"7fe97674.cbc19","type":"inject","z":"54339415.36f384","name":"Not Detected","topic":"","payload":"{\"CarbonMonoxideDetected\":0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":820,"wires":[["ac79f4f4.906df8"]]},{"id":"933cc1a6.dc8c98","type":"debug","z":"54339415.36f384","name":"CO Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":850,"y":800,"wires":[]},{"id":"3efd37a6.392f78","type":"inject","z":"54339415.36f384","name":"Detected","topic":"","payload":"{\"CarbonMonoxideDetected\":1}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":780,"wires":[["ac79f4f4.906df8"]]},{"id":"d334490b.40dac","type":"homekit-bridge","z":"","bridgeName":"Example Bridge","pinCode":"111-11-111","port":"","allowInsecureRequest":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number"}]
38
30
```
39
31
32
+
## Example
33
+
34
+
Below is a list of examples intended to be copied into your Node-RED system and adapted to your setup:
35
+
40
36
### Full Featured Carbon Monoxide Sensor
41
37
42
38
This is an example of a carbon monoxide detector that reports the current amount of carbon monoxide in the air as parts per million (PPM). A threshold level of 35 has been set as the "alarm level". This level was chosen because it is the limit of what OSHA has decided is unsafe for 8 hour exposure. Please adjust to the threshold you would like in your system.
@@ -49,7 +45,7 @@ There are three inject nodes in this example:
49
45
50
46
**The `Reset` inject node** will send a value of 0 to both `CarbonMonoxideDetected` and `CarbonMonoxidePeakLevel` - used to clear the system after alarms have been dealt with and carbon monoxide sources have been stopped.
51
47
52
-

This is the simplest example of a contact sensor item. The input nodes are `Open`, `Close`, `Tampered` and `Not Tampered`.
21
+
This is the simplest example of a Contact Sensor item. The input nodes are `Open`, `Close`, `Tampered` and `Not Tampered`.
22
22
23
-

23
+

24
24
25
25
Copyable Node-RED flow:
26
26
@@ -30,7 +30,7 @@ Copyable Node-RED flow:
30
30
31
31
### Characteristic Properties
32
32
33
-
Use the following JSON in your characteristic properties so that the Home application displays a contact sensor with status tampered.
33
+
Use the following JSON in your Characteristic Properties so that the Home.app displays a Contact Sensor with Status Tampered.
34
34
35
35
```json
36
36
{
@@ -41,18 +41,32 @@ Use the following JSON in your characteristic properties so that the Home applic
41
41
42
42
## Example
43
43
44
-
### Implementation with an Omron PLC
44
+
Below is a list of examples intended to be copied into your Node-RED system and adapted to your setup:
45
+
46
+
### MQTT Example
47
+
48
+
This is an example of a Contact Sensor item. The input nodes are `Open` and `Close`.
49
+
50
+

51
+
52
+
Copyable Node-RED flow:
45
53
46
-
This is an example of a contact sensor element wired in NO with a safety if the cable is cut.
54
+
```json
55
+
[{"id":"c775950460a1ce62","type":"function","z":"d57f90c91936790e","name":"State to HK","func":"const State = msg.payload.doorcontact_state;\nmsg.payload = {\"ContactSensorState\":State};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":1760,"wires":[["e655dc58594a534f"]]},{"id":"39f5723c2f8cf9e1","type":"inject","z":"d57f90c91936790e","name":"Close","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"0.5","topic":"","payload":"{\"doorcontact_state\":0}","payloadType":"json","x":150,"y":1640,"wires":[["2fe650548dfb3f03"]]},{"id":"e655dc58594a534f","type":"homekit-service","z":"d57f90c91936790e","isParent":true,"hostType":"0","bridge":"4a2a4fc162440a41","accessoryId":"","parentService":"","name":"Contact Sensor","serviceName":"ContactSensor","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\"ContactSensorState\":0}","waitForSetupMsg":false,"outputs":2,"x":520,"y":1760,"wires":[[],[]]},{"id":"752e34d9f9bd2c80","type":"inject","z":"d57f90c91936790e","name":"Open","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"0.5","topic":"","payload":"{\"doorcontact_state\":1}","payloadType":"json","x":150,"y":1700,"wires":[["2fe650548dfb3f03"]]},{"id":"03dc40ae4d42b92b","type":"mqtt in","z":"d57f90c91936790e","name":"Contact State","topic":"tele/CONTACT_DOOR/SENSOR","qos":"2","datatype":"auto","broker":"e17954568d0e969f","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":1760,"wires":[["c775950460a1ce62"]]},{"id":"2fe650548dfb3f03","type":"mqtt out","z":"d57f90c91936790e","name":"Write","topic":"tele/CONTACT_DOOR/SENSOR","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e17954568d0e969f","x":290,"y":1640,"wires":[]},{"id":"4a2a4fc162440a41","type":"homekit-bridge","bridgeName":"Bridge Node-RED","pinCode":"605-37-162","port":"","advertiser":"ciao","allowInsecureRequest":false,"manufacturer":"NRCHKB","model":"1.4.3","serialNo":"Default Serial Number","firmwareRev":"1.4.3","hardwareRev":"1.4.3","softwareRev":"1.4.3","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true},{"id":"e17954568d0e969f","type":"mqtt-broker","name":"Mosquitto","broker":"localhost","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"sessionExpiry":""}]
56
+
```
57
+
58
+
### Implementation with an Omron PLC
59
+
<!-- Please leave this example at the bottom of the page -->
60
+
This is an example of a Contact Sensor element wired in NO with a safety if the cable is cut.
0 commit comments