diff --git a/Applications/template_Zigbee2MQTT_integration/7.0/Zigbee2MQTT.yaml b/Applications/template_Zigbee2MQTT_integration/7.0/Zigbee2MQTT.yaml new file mode 100644 index 000000000..76b87a535 --- /dev/null +++ b/Applications/template_Zigbee2MQTT_integration/7.0/Zigbee2MQTT.yaml @@ -0,0 +1,678 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: a641245eb3c646bda87e094cf507535d + name: 'Templates Zigbee' + templates: + - uuid: e007505db52d43a6bb3ba9366f7d4df7 + template: 'Zigbee Sensors' + name: 'Zigbee Sensors' + description: | + Zigbee devices discovery for Zigbee2MQTT integration + Temperature sensor + Smart socket + Smoke sensor + Water leak detection + groups: + - name: 'Templates Zigbee' + discovery_rules: + - uuid: 7b665a67c61a4b7391c5eb4c1c5979dc + name: 'Smart Socket' + type: SCRIPT + key: smartsocket + delay: 1h + params: | + return (JSON.stringify( + [ + { + "{#MQTTSSID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaaa", + "{#MQTTNAME}": "Power line blue" + }, + { + "{#MQTTSSID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaab", + "{#MQTTNAME}": "Power line red" + }, + + { + "{#MQTTSSID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaac", + "{#MQTTNAME}": "Power line gs" + }, + + { + "{#MQTTSSID}": "zigbee2mqtt_2/0xaaaaaaaaaaaaaaaad", + "{#MQTTNAME}": "Power line ups" + } + ] + )) + item_prototypes: + - uuid: 2c426b8bbb5645329646c486a277493e + name: 'Current {#MQTTNAME}' + type: DEPENDENT + key: 'current[{#MQTTSSID}]' + delay: '0' + history: 90d + value_type: FLOAT + trends: 1825d + units: A + preprocessing: + - type: JSONPATH + parameters: + - $.current + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + trigger_prototypes: + - uuid: 7b8c66a3e5ce43c096785d83f9f9a44f + expression: 'last(/Zigbee Sensors/current[{#MQTTSSID}])>{$CURRENTTOOHIGH}' + name: 'Current too high for {#MQTTNAME}' + priority: HIGH + - uuid: 3543b5d075264a3686902d0f28bdbe47 + name: 'Linkquality Smart Socket {#MQTTNAME}' + type: DEPENDENT + key: 'linkquality[{#MQTTSSID}]' + delay: '0' + history: 90d + trends: 1825d + preprocessing: + - type: JSONPATH + parameters: + - $.linkquality + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + - uuid: ea0d9120d620403cb8034e8069ee517b + name: 'Smart Socket {#MQTTNAME} row' + type: ZABBIX_ACTIVE + key: 'mqtt.get[localhost,{#MQTTSSID}]' + delay: '0' + history: 1825d + value_type: TEXT + trends: '0' + trigger_prototypes: + - uuid: e947161ed5db44dcbec10f39af55a4c2 + expression: 'nodata(/Zigbee Sensors/mqtt.get[localhost,{#MQTTSSID}],{$NODATAFOR})=1' + name: 'No data from Smart Socket {#MQTTNAME} for {$NODATAFOR}' + priority: HIGH + - uuid: 884e73158b474ee98e15288b69b5a4e5 + name: 'Power {#MQTTNAME}' + type: DEPENDENT + key: 'power[{#MQTTSSID}]' + delay: '0' + history: 90d + trends: 1825d + units: W + preprocessing: + - type: JSONPATH + parameters: + - $.power + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + - uuid: e65722fdf8bb4872acfd3b2b0898623c + name: 'Power_outage_memory {#MQTTNAME}' + type: DEPENDENT + key: 'power_outage_memory[{#MQTTSSID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.power_outage_memory + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + tags: + - tag: Application + value: Zigbee + - uuid: 50da92c640394a66936a67cd22921e2c + name: 'Smart socket State {#MQTTNAME}' + type: DEPENDENT + key: 'state[{#MQTTSSID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.state + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: ab80e5ff27d54c44a6d7ad05faa95b24 + expression: 'last(/Zigbee Sensors/state[{#MQTTSSID}])<>"ON"' + name: 'Smart Socket OFF {#MQTTNAME}' + priority: DISASTER + - uuid: ba879b518cea4520bc8f3c9bdb7ff49b + name: 'Voltage {#MQTTNAME}' + type: DEPENDENT + key: 'voltage[{#MQTTSSID}]' + delay: '0' + history: 90d + trends: 1825d + units: V + preprocessing: + - type: JSONPATH + parameters: + - $.voltage + master_item: + key: 'mqtt.get[localhost,{#MQTTSSID}]' + trigger_prototypes: + - uuid: 5b6b4888453a462599c4800234f8e731 + expression: 'last(/Zigbee Sensors/voltage[{#MQTTSSID}])>{$VOLTAGETOOHIGH}' + name: 'Voltage too high for {#MQTTNAME}' + priority: HIGH + - uuid: 6f18cebee14d487c886e5ce9b46d539e + expression: 'last(/Zigbee Sensors/voltage[{#MQTTSSID}])<{$VOLTAGETOOLOW}' + name: 'Voltage too low for {#MQTTNAME}' + priority: HIGH + graph_prototypes: + - uuid: 0431f49534fb49f0ad7d0be829613cfa + name: 'Smart Socket {#MQTTNAME}' + show_work_period: 'NO' + show_triggers: 'NO' + graph_items: + - color: 0040FF + calc_fnc: ALL + item: + host: 'Zigbee Sensors' + key: 'voltage[{#MQTTSSID}]' + - sortorder: '1' + color: FF8000 + yaxisside: RIGHT + calc_fnc: ALL + item: + host: 'Zigbee Sensors' + key: 'current[{#MQTTSSID}]' + - sortorder: '2' + color: FF0000 + calc_fnc: ALL + item: + host: 'Zigbee Sensors' + key: 'power[{#MQTTSSID}]' + - sortorder: '3' + drawtype: BOLD_LINE + color: FFFF00 + calc_fnc: ALL + item: + host: 'Zigbee Sensors' + key: 'linkquality[{#MQTTSSID}]' + - uuid: b337773caffe4f33af8b928424306f02 + name: 'Smoke Sensor' + type: SCRIPT + key: smoke.sensors + delay: 1h + params: | + return (JSON.stringify( + [ + { + "{#MQTTSMID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaaa", + "{#MQTTNAME}": "Smoke sensor room A1" + }, + { + "{#MQTTSMID}": "zigbee2mqtt_2/0xaaaaaaaaaaaaaaaab", + "{#MQTTNAME}": "Smoke sensor room B2" + }, + + { + "{#MQTTSMID}": "zigbee2mqtt_2/0xaaaaaaaaaaaaaaaac", + "{#MQTTNAME}": "Smoke sensor room C3" + }, + { + "{#MQTTSMID}": "zigbee2mqtt_3/0xaaaaaaaaaaaaaaaad", + "{#MQTTNAME}": "Smoke sensor room D4" + } + ] + )) + item_prototypes: + - uuid: 512c88dea8164f4b85a79d11772fa420 + name: 'Battery Smoke sensor {#MQTTNAME}' + type: DEPENDENT + key: 'battery[{#MQTTSMID}]' + delay: '0' + history: 365d + trends: '0' + units: '%' + preprocessing: + - type: JSONPATH + parameters: + - $.battery + master_item: + key: 'mqtt.get[localhost,{#MQTTSMID}]' + tags: + - tag: Application + value: Zigbee + - uuid: 00c5f7afe58148a18f6d2d6a8ad0b1fa + name: 'Battery_state Smoke sensor {#MQTTNAME}' + type: DEPENDENT + key: 'battery_state[{#MQTTSMID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.battery_state + master_item: + key: 'mqtt.get[localhost,{#MQTTSMID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 28e5f23e75fb4fcf9f6c61c3586c96b4 + expression: 'last(/Zigbee Sensors/battery_state[{#MQTTSMID}])<>"high"' + name: 'Battery_state Smoke sensor {#MQTTNAME}' + priority: WARNING + - uuid: e21940f6a5b14ee5a1d468f7d02ab338 + name: 'Linkquality Smoke sensor {#MQTTNAME}' + type: DEPENDENT + key: 'linkquality[{#MQTTSMID}]' + delay: '0' + history: 365d + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.linkquality + master_item: + key: 'mqtt.get[localhost,{#MQTTSMID}]' + tags: + - tag: Application + value: Zigbee + - uuid: 30f8096917794e7cb339ca6ab87ca2d4 + name: 'Smoke sensor {#MQTTNAME} row' + type: ZABBIX_ACTIVE + key: 'mqtt.get[localhost,{#MQTTSMID}]' + delay: '0' + history: 1825d + value_type: TEXT + trends: '0' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 16492584e1c74b9cb84d18bbd7f2717c + expression: 'nodata(/Zigbee Sensors/mqtt.get[localhost,{#MQTTSMID}],{$NODATALOWFOR})=1' + name: 'No data from {#MQTTNAME} for {$NODATALOWFOR}' + priority: HIGH + - uuid: 3936a0dfca0a45e8bb5234181f176ca8 + name: 'Smoke sensor in silence mode {#MQTTNAME}' + type: DEPENDENT + key: 'silence[{#MQTTSMID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.silence + master_item: + key: 'mqtt.get[localhost,{#MQTTSMID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: e91267c0670c429fa7af1870db76f896 + expression: 'last(/Zigbee Sensors/silence[{#MQTTSMID}])<>"OFF"' + name: 'Smoke sensor in silence mode {#MQTTNAME}' + priority: AVERAGE + - uuid: 2ebb45b0e7224f8a9efc7fcc2c7d042d + name: 'Smoke detected {#MQTTNAME}' + type: DEPENDENT + key: 'smokedetected[{#MQTTSMID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.smoke + master_item: + key: 'mqtt.get[localhost,{#MQTTSMID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 2d1a4bd6e5c141f7abc4cabf159ceb77 + expression: 'last(/Zigbee Sensors/smokedetected[{#MQTTSMID}])<>"false"' + name: 'Smoke detected on {#MQTTNAME}' + priority: DISASTER + - uuid: de55122dfc9e449fb738fdd37cf72ffe + name: 'Temperature Sensor' + type: SCRIPT + key: temperature.sensors + delay: 1h + params: | + return (JSON.stringify( + [ + { + "{#MQTTID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaaa", + "{#MQTTNAME}": "Sensor room A1" + }, + { + "{#MQTTID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaab", + "{#MQTTNAME}": "Sensor room A1" + }, + + { + "{#MQTTID}": "zigbee2mqtt_2/0xaaaaaaaaaaaaaaaac", + "{#MQTTNAME}": "Sensor room A1" + }, + { + "{#MQTTID}": "zigbee2mqtt_2/0xaaaaaaaaaaaaaaaad", + "{#MQTTNAME}": "Sensor room A1" + } + ] + )) + item_prototypes: + - uuid: dc4455d98b4f46e4aa9965de9f974d58 + name: 'Battery Temperature sensor {#MQTTNAME}' + type: DEPENDENT + key: 'battery[{#MQTTID}]' + delay: '0' + history: 45d + trends: 1825d + preprocessing: + - type: JSONPATH + parameters: + - $.battery + master_item: + key: 'mqtt.get[localhost,{#MQTTID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 6f97a8f02048486b818412d122a69be8 + expression: 'last(/Zigbee Sensors/battery[{#MQTTID}])<25' + name: 'Battery too low for {#MQTTNAME}' + priority: AVERAGE + - uuid: f86fa40ec43c4e638e2767e55cbbfbfa + name: 'Humidity {#MQTTNAME}' + type: DEPENDENT + key: 'humidity[{#MQTTID}]' + delay: '0' + history: 90d + value_type: FLOAT + trends: 1825d + units: '%' + preprocessing: + - type: JSONPATH + parameters: + - $.humidity + master_item: + key: 'mqtt.get[localhost,{#MQTTID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: e64c66d3f3c9480f9a135855f4f88486 + expression: 'last(/Zigbee Sensors/humidity[{#MQTTID}])>90' + name: 'Humidy too high for {#MQTTNAME}' + priority: HIGH + - uuid: 1dcde2dfb6cd4295b68c648bfc732944 + name: 'Linkquality Temperature sensor {#MQTTNAME}' + type: DEPENDENT + key: 'linkquality[{#MQTTID}]' + delay: '0' + history: 45d + trends: 1825d + preprocessing: + - type: JSONPATH + parameters: + - $.linkquality + master_item: + key: 'mqtt.get[localhost,{#MQTTID}]' + tags: + - tag: Application + value: Zigbee + - uuid: c507655b1bfa49a481f64250596e523d + name: 'Temperature sensor {#MQTTNAME} row' + type: ZABBIX_ACTIVE + key: 'mqtt.get[localhost,{#MQTTID}]' + delay: '0' + history: 1825d + value_type: TEXT + trends: '0' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: d2befa33f24240c980ff763e86dea4b5 + expression: 'nodata(/Zigbee Sensors/mqtt.get[localhost,{#MQTTID}],{$NODATAFOR})=1' + name: 'No data from {#MQTTNAME} for {$NODATAFOR}' + priority: HIGH + - uuid: 9b3690641c9542c395d445bcc1e084de + name: 'Temperature {#MQTTNAME}' + type: DEPENDENT + key: 'temperature[{#MQTTID}]' + delay: '0' + history: 90d + value_type: FLOAT + trends: 1825d + units: °C + preprocessing: + - type: JSONPATH + parameters: + - $.temperature + master_item: + key: 'mqtt.get[localhost,{#MQTTID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 407ce62f77ca447aa20328f52c990f6c + expression: 'last(/Zigbee Sensors/temperature[{#MQTTID}])>{$TEMPERATURETOOHIGH}' + name: 'Temperature too high for {#MQTTNAME}' + priority: HIGH + - uuid: 8cab65283323400d9a1173677c39754e + expression: 'last(/Zigbee Sensors/temperature[{#MQTTID}])<{$TEMPERATURETOOLOW}' + name: 'Temperature too low for {#MQTTNAME}' + priority: AVERAGE + graph_prototypes: + - uuid: 3ee9ae218d9241e6bf7ff807fb3962eb + name: 'Temparature & Humidity {#MQTTNAME}' + show_work_period: 'NO' + show_triggers: 'NO' + graph_items: + - color: FF0000 + item: + host: 'Zigbee Sensors' + key: 'temperature[{#MQTTID}]' + - sortorder: '1' + drawtype: FILLED_REGION + color: 0040FF + yaxisside: RIGHT + item: + host: 'Zigbee Sensors' + key: 'humidity[{#MQTTID}]' + - sortorder: '2' + color: '000000' + yaxisside: RIGHT + calc_fnc: MIN + item: + host: 'Zigbee Sensors' + key: 'battery[{#MQTTID}]' + - sortorder: '3' + drawtype: BOLD_LINE + color: FFFF00 + yaxisside: RIGHT + calc_fnc: MIN + item: + host: 'Zigbee Sensors' + key: 'linkquality[{#MQTTID}]' + - uuid: 7013796f65e54bea9e6e0bfe1c1e75d9 + name: 'Water Leak Detector' + type: SCRIPT + key: waterleakdetector + delay: 1h + params: | + return (JSON.stringify( + [ + { + "{#MQTTWLDID}": "zigbee2mqtt_3/0xaaaaaaaaaaaaaaaaa", + "{#MQTTNAME}": "WLD room A1" + }, + { + "{#MQTTWLDID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaab", + "{#MQTTNAME}": "WLD room B2" + }, + + { + "{#MQTTWLDID}": "zigbee2mqtt_3/0xaaaaaaaaaaaaaaaac", + "{#MQTTNAME}": "WLD room C3" + }, + { + "{#MQTTWLDID}": "zigbee2mqtt_1/0xaaaaaaaaaaaaaaaad", + "{#MQTTNAME}": "WLD room D4" + } + ] + )) + item_prototypes: + - uuid: eb8c700e75ac4c769476d1145163a9c3 + name: 'Water leak detector {#MQTTNAME} row' + type: ZABBIX_ACTIVE + key: 'mqtt.get[localhost,{#MQTTWLDID}]' + delay: '0' + history: 1825d + value_type: TEXT + trends: '0' + tags: + - tag: Application + value: Zigbee + - uuid: 143bc96dce754ba8bf67519d240d1d7c + name: 'Battery {#MQTTNAME}' + type: DEPENDENT + key: 'wld.battery.[{#MQTTWLDID}]' + delay: '0' + history: 365d + trends: '0' + units: '%' + preprocessing: + - type: JSONPATH + parameters: + - $.battery + error_handler: DISCARD_VALUE + - type: IN_RANGE + parameters: + - '0' + - '100' + error_handler: DISCARD_VALUE + master_item: + key: 'mqtt.get[localhost,{#MQTTWLDID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: a92122679415489eba2625e11a74540e + expression: 'last(/Zigbee Sensors/wld.battery.[{#MQTTWLDID}])<25' + name: 'WLD Battery too low for {#MQTTNAME}' + priority: AVERAGE + - uuid: c4cb1d5a64ef4d5c81d26db8e89782d3 + name: 'Battery_low {#MQTTNAME}' + type: DEPENDENT + key: 'wld.battery_low.[{#MQTTWLDID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.battery_low + master_item: + key: 'mqtt.get[localhost,{#MQTTWLDID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 4a926aabbac44d369e43eed63d6c5bef + expression: 'last(/Zigbee Sensors/wld.battery_low.[{#MQTTWLDID}])="true"' + name: 'Battery_low {#MQTTNAME}' + priority: AVERAGE + - uuid: 662470f7f5e94dbda0cabdcbe9f7cc3b + name: 'WLD tamper {#MQTTNAME}' + type: DEPENDENT + key: 'wld.tamper.[{#MQTTWLDID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.tamper + master_item: + key: 'mqtt.get[localhost,{#MQTTWLDID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: 9e99dba7ec0d45489733fa57c2b6e037 + expression: 'last(/Zigbee Sensors/wld.tamper.[{#MQTTWLDID}])<>"false"' + name: 'WLD tamper on {#MQTTNAME}' + priority: WARNING + - uuid: 9e3d6a9d46bd449b8932cab3396a8a81 + name: 'Water Leak Detected {#MQTTNAME}' + type: DEPENDENT + key: 'wld.water_leak.[{#MQTTWLDID}]' + delay: '0' + history: 365d + value_type: CHAR + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - $.water_leak + master_item: + key: 'mqtt.get[localhost,{#MQTTWLDID}]' + tags: + - tag: Application + value: Zigbee + trigger_prototypes: + - uuid: af991bf9609744e59e6d8ce8c5116774 + expression: 'last(/Zigbee Sensors/wld.water_leak.[{#MQTTWLDID}])<>"false"' + name: 'Water Leak Detected on {#MQTTNAME}' + priority: DISASTER + macros: + - macro: '{$CURRENTTOOHIGH}' + value: '12' + - macro: '{$NODATAFOR}' + value: 10m + - macro: '{$NODATALOWFOR}' + value: 24h + - macro: '{$TEMPERATURETOOHIGH}' + value: '28' + - macro: '{$TEMPERATURETOOLOW}' + value: '17' + - macro: '{$VOLTAGETOOHIGH}' + value: '250' + - macro: '{$VOLTAGETOOLOW}' + value: '210' + valuemaps: + - uuid: 6c834a73c4804b73baf232a9ffd1b0d1 + name: Zigbee + mappings: + - value: 'ON' + newvalue: '1' + - value: 'on' + newvalue: '1' + - value: 'true' + newvalue: '1' + - value: 'TRUE' + newvalue: '1' + - value: 'null' + newvalue: '0' + - value: 'NULL' + newvalue: '0' + - value: 'OFF' + newvalue: '0' + - value: 'off' + newvalue: '0' + - value: 'false' + newvalue: '0' + - value: 'FALSE' + newvalue: '0'