Digital inputs
Four dry-contact inputs. The pin of each slot is fixed: d1 GPIO16, d2 GPIO38, d3 GPIO48 (through the UPS optocoupler), d4 GPIO15. Connect one contact wire to the pin and the other to GND; the pull-up is built in.
All inputs are off by default (dN_type = off): the node does not know whether a pin is connected, so it does not read and does not send anything until you configure it.
Keys per slot
Section titled “Keys per slot”| Key | Default | Function |
|---|---|---|
dN_type |
off |
off, door, ups, water, smoke, generic. The type only determines the default LCD status text |
dN_active |
high |
the pin level that means active (value true). high if an open contact = active; low if a contact closing to GND = active |
dN_name |
empty | metric name (front_door). Empty = slot ID |
dN_label |
D1… |
name for the LCD, max. 11 characters |
dN_text_true, dN_text_false |
empty | LCD status text, max. 8 characters. Empty = type default |
dN_alarm |
false |
true = this input may trigger an alarm |
dN_alarm_on |
active |
the alarm fires when the input is active, or when it is inactive (e.g. cable unplugged) |
dN_alarm_delay_s |
-1 |
how long the condition must persist. -1 = follow alarm_delay_s; 0 = immediate |
Default LCD status text (shown on the LCD in Indonesian):
| Type | Active | Inactive |
|---|---|---|
door |
BUKA (open) |
TUTUP (closed) |
ups |
BATERAI (battery) |
ONLINE |
water |
BOCOR (leak) |
KERING (dry) |
smoke |
ASAP (smoke) |
AMAN (safe) |
generic |
AKTIF (active) |
NORMAL |
The value sent to the server is always a boolean on the metric dN_name (true = active according to dN_active).
Recipes per device
Section titled “Recipes per device”Door with an MC-38 reed switch (magnet attached = contact closed = pin LOW; door open = HIGH):
{"cfg_ver":5, "d1_name":"front_door","d1_type":"door","d1_active":"high","d1_label":"Pintu Depan", "d1_text_true":"Terbuka","d1_text_false":"Tertutup","d1_alarm":true,"d1_alarm_delay_s":20}The alarm only fires if the door stays open for more than 20 seconds, so a door opened briefly does not sound.
UPS (“on battery” dry contact through a PC817 to d3; opto on = pin LOW):
{"cfg_ver":6, "d3_name":"ups_on_battery","d3_type":"ups","d3_active":"low","d3_label":"UPS","d3_alarm":true,"d3_alarm_delay_s":10}Water leak sensor (dry contact):
{"cfg_ver":7, "d4_name":"water_leak","d4_type":"water","d4_active":"low","d4_label":"Bocor","d4_alarm":true,"d4_alarm_delay_s":0}Smoke detector:
{"cfg_ver":8, "d4_name":"smoke_detector","d4_type":"smoke","d4_active":"high","d4_label":"Asap","d4_alarm":true,"d4_alarm_delay_s":0}Generic contact input: {"d2_name":"panel_door","d2_type":"generic","d2_active":"low","d2_label":"Panel"}; add d2_alarm if needed.
Alarm when the cable is unplugged
Section titled “Alarm when the cable is unplugged”For sensors whose failure is dangerous (smoke, UPS), use an NC contact and make the alarm fire when the input is inactive:
{"cfg_ver":9,"d4_alarm_on":"inactive"}The alarm is then named alarm_smoke_detector_inactive.
Checking inputs
Section titled “Checking inputs”Trigger the sensor, then look at status in serial: "din":{"front_door":true} means active. On the LCD, the Input page shows the label and status text; the web Status tab shows the same. An input of type off appears nowhere.
A change in input state is sent as an event immediately, in addition to its value in the regular telemetry.