├── .editorconfig ├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── .vscode ├── extensions.json └── settings.json ├── LICENSE ├── README.md ├── acme.sh └── data │ └── .gitignore ├── adguardhome ├── conf │ └── .gitignore └── work │ └── .gitignore ├── chronograf └── data │ └── .gitignore ├── common-linuxserver.env ├── common.env ├── docker-compose.yml ├── esphome └── config │ ├── .gitignore │ ├── node02.yaml │ ├── node07.yaml │ ├── node08.yaml │ └── node10.yaml ├── grafana └── data │ └── .gitignore ├── influxdb └── data │ ├── .gitignore │ └── influxdb.conf ├── jackett └── config │ └── .gitignore ├── mariadb ├── config │ └── mariadb-server.cnf └── data │ └── .gitignore ├── mosquitto └── config │ ├── .gitignore │ └── mosquitto.conf ├── nginx ├── etc-nginx-cf-certs │ ├── .gitignore │ └── nginx-server.conf ├── etc-nginx-le-certs │ ├── .gitignore │ └── nginx-server.conf └── etc-nginx-templates │ └── nginx.conf.template ├── nodered └── data │ └── .gitignore ├── pihole ├── etc-dnsmasq.d │ ├── 01-pihole.conf │ └── 02-custom-settings.conf └── etc-pihole │ ├── .gitignore │ ├── pihole-FTL.conf │ ├── setupVars.conf │ └── whitelist.txt ├── portainer └── data │ └── .gitignore ├── radarr └── config │ └── .gitignore ├── readsb ├── autogain │ └── .gitignore └── collectd │ └── .gitignore ├── sonarr └── config │ └── .gitignore ├── spoolman └── data │ └── .gitignore ├── telegraf └── config │ └── telegraf.conf ├── transmission └── config │ └── .gitignore ├── ultrafeeder ├── globe_history │ └── .gitignore └── graphs1090 │ └── .gitignore ├── vscode └── data │ └── .gitignore ├── wireguard └── config │ └── .gitignore └── zigbee2mqtt ├── data ├── .gitignore └── configuration.yaml └── homeassistant-extension └── homeassistant.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | trim_trailing_whitespace = true 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 2 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: pedrolamas 2 | patreon: pedrolamas 3 | ko_fi: pedrolamas 4 | custom: https://paypal.me/pedrolamas 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */secrets.env 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "homeassistant"] 2 | path = homeassistant 3 | url = https://github.com/PedroLamas/home-assistant-config.git 4 | [submodule "zigbee2mqtt/zigbee-herdsman-converters"] 5 | path = zigbee2mqtt/zigbee-herdsman-converters 6 | url = https://github.com/Koenkk/zigbee-herdsman-converters.git 7 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-docker", 4 | "editorconfig.editorconfig", 5 | "keesschollaart.vscode-home-assistant", 6 | "lukas-tr.materialdesignicons-intellisense", 7 | "redhat.vscode-yaml", 8 | "william-voyek.vscode-nginx", 9 | "emilast.LogFileHighlighter" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "**/homeassistant/config/**/*.yaml": "home-assistant", 4 | "**/nginx/**/*.template": "nginx" 5 | }, 6 | "files.watcherExclude": { 7 | ".nfs**": true, 8 | ".Trash-0/**": true, 9 | "**/__pycache__/**": true, 10 | "**/._*": true, 11 | "**/.cloud": true, 12 | "**/.git/objects/**": true, 13 | "**/.git/subtree-cache/**": true, 14 | "**/.HA_VERSION": true, 15 | "**/.storage": true, 16 | "**/*.db-shm": true, 17 | "**/*.db-wal": true, 18 | "**/*.db": true, 19 | "**/*.log": true, 20 | "**/deps/**": true, 21 | "**/OZW_Log.txt": true, 22 | "**/pyozw.sqlite": true 23 | }, 24 | "search.exclude": { 25 | ".Trash-0/**": true, 26 | "**/__pycache__/**": true, 27 | "**/._*": true, 28 | "**/.cloud": true, 29 | "**/.git/objects/**": true, 30 | "**/.git/subtree-cache/**": true, 31 | "**/.git": true, 32 | "**/.HA_VERSION": true, 33 | "**/.storage": true, 34 | "**/*.db-shm": true, 35 | "**/*.db-wal": true, 36 | "**/*.db": true, 37 | "**/*.log": true, 38 | "**/deps/**": true, 39 | "**/OZW_Log.txt": true, 40 | "**/pyozw.sqlite": true 41 | }, 42 | "files.exclude": { 43 | ".Trash-0/**": true, 44 | "**/__pycache__": true, 45 | "**/.cloud": true, 46 | "**/.DS_Store": true, 47 | "**/.git": true, 48 | "**/.HA_VERSION": true, 49 | "**/*.db-shm": true, 50 | "**/*.db-wal": true, 51 | "**/deps/**": true 52 | }, 53 | "yaml.customTags": [ 54 | "!env_var scalar", 55 | "!include_dir_list scalar", 56 | "!include_dir_merge_list scalar", 57 | "!include_dir_merge_named scalar", 58 | "!include_dir_named scalar", 59 | "!include scalar", 60 | "!secret scalar" 61 | ], 62 | "[yaml]": { 63 | "editor.autoIndent": "full", 64 | "editor.insertSpaces": true, 65 | "editor.tabSize": 2, 66 | "editor.quickSuggestions": { 67 | "other": true, 68 | "comments": false, 69 | "strings": true 70 | } 71 | }, 72 | "[home-assistant]": { 73 | "editor.autoIndent": "full", 74 | "editor.insertSpaces": true, 75 | "editor.tabSize": 2 76 | }, 77 | "yaml.format.enable": true 78 | } 79 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2019 Pedro Lamas, https://www.pedrolamas.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker IoT Stack 2 | 3 | [![Project Maintenance](https://img.shields.io/maintenance/yes/2025.svg)](https://github.com/pedrolamas/nanopineo2-docker-config 'GitHub Repository') 4 | [![License](https://img.shields.io/github/license/pedrolamas/nanopineo2-docker-config.svg)](https://github.com/pedrolamas/nanopineo2-docker-config/blob/master/LICENSE 'License') 5 | 6 | [![Follow pedrolamas.com on Bluesky](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Dpedrolamas.com&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40pedrolamas.com)](https://bsky.app/profile/pedrolamas.com) 7 | [![Follow pedrolamas on Mastodon](https://img.shields.io/mastodon/follow/109365776481898704?label=Follow%20@pedrolamas%20on%20Mastodon&domain=https%3A%2F%2Fhachyderm.io&style=social)](https://hachyderm.io/@pedrolamas) 8 | 9 | This is my personal Docker IoT Stack configuration, currently up and running inside a [NanoPi M4V2](https://www.friendlyarm.com/index.php?route=product/product&product_id=180) small board computer (SBC) with a Sabrent 256GB Rocket NVMe PCIe M.2 2280 SSD. 10 | 11 | The NanoPI is running the latest [Armbian OS](https://www.armbian.com/nanopi-m4-v2/). 12 | 13 | To install docker, please use the [convenience script](https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script). 14 | 15 | To run, just enter the root folder and run: 16 | 17 | ```sh 18 | docker-compose up -d 19 | ``` 20 | 21 | Feel free to send questions or PR's with improvements! 22 | 23 | ## Images 24 | 25 | ### AdGuard Home 26 | 27 | Free and open source, powerful network-wide ads & trackers blocking DNS server. 28 | 29 | * Image: [adguard/adguardhome](https://hub.docker.com/r/adguard/adguardhome) 30 | 31 | ### Nginx 32 | 33 | Nginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). 34 | 35 | * Image: [nginx](https://hub.docker.com/_/nginx) 36 | 37 | ### Home Assistant 38 | 39 | Home Assistant is an open source home automation tool that puts local control and privacy first. 40 | 41 | * Image: [ghcr.io/home-assistant/home-assistant](https://github.com/home-assistant/core/pkgs/container/home-assistant) 42 | 43 | ### Eclipse Mosquitto 44 | 45 | Eclipse Mosquitto is an open source implementation of a server for version 3.1 and 3.1.1 of the MQTT protocol. 46 | 47 | * Image: [eclipse-mosquitto](https://hub.docker.com/_/eclipse-mosquitto) 48 | 49 | ### Zigbee2Mqtt 50 | 51 | Zigbee2Mqtt allows you to use your Zigbee devices without the vendors bridge or gateway. 52 | 53 | * Image: [koenkk/zigbee2mqtt](https://hub.docker.com/r/koenkk/zigbee2mqtt) 54 | 55 | ### Telegraf 56 | 57 | Telegraf is an agent for collecting metrics and writing them to InfluxDB or other outputs. 58 | 59 | * Image: [telegraf](https://hub.docker.com/_/telegraf) 60 | 61 | ### mariadb 62 | 63 | MariaDB is a community-developed fork of MySQL intended to remain free under the GNU GPL. 64 | 65 | * Image: [mariadb](https://hub.docker.com/_/mariadb) 66 | 67 | ### Grafana 68 | 69 | Grafana is the open source analytics and monitoring solution for every database. 70 | 71 | * Image: [grafana/grafana](https://hub.docker.com/r/grafana/grafana) 72 | 73 | ### ESPHome 74 | 75 | ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems. 76 | 77 | * Image: [ghcr.io/esphome/esphome](https://github.com/esphome/esphome/pkgs/container/esphome) 78 | 79 | ### ACME.sh 80 | 81 | An ACME protocol client written purely in Shell (Unix shell) language. 82 | 83 | * Image: [neilpang/acme.sh](https://hub.docker.com/r/neilpang/acme.sh) 84 | 85 | ### code-server 86 | 87 | Run VS Code on any machine anywhere and access it through the browser. 88 | 89 | * Image: [codercom/code-server](https://hub.docker.com/r/codercom/code-server) 90 | 91 | ### Portainer 92 | 93 | Build and manage your Docker environments with ease today. 94 | 95 | * Image: [portainer/portainer](https://hub.docker.com/r/portainer/portainer) 96 | 97 | ### Fluidd 98 | 99 | Fluidd is a lightweight & responsive user interface for Klipper, the 3D printer firmware. 100 | 101 | * Image: [ghcr.io/fluidd-core/fluidd:latest-develop](https://github.com/fluidd-core/fluidd/pkgs/container/fluidd) 102 | 103 | ### Mainsail 104 | 105 | Mainsail makes Klipper more accessible by adding a lightweight, responsive web user interface, centred around an intuitive and consistent design philosophy. 106 | 107 | * Image: [ghcr.io/pedrolamas/docker-mainsail:latest-dev](https://github.com/pedrolamas/docker-mainsail/pkgs/container/docker-mainsail) 108 | 109 | ### Spoolman 110 | 111 | Spoolman is a web service that helps you keep track of your filament spools and how they are being used. 112 | 113 | * Image: [ghcr.io/donkie/spoolman](https://github.com/donkie/spoolman/pkgs/container/spoolman) 114 | 115 | ### adsb-ultrafeeder 116 | 117 | adsb-ultrafeeder™ is an ADS-B data collector container. 118 | 119 | * Image: [ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder](https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder/pkgs/container/docker-adsb-ultrafeeder) 120 | 121 | ### docker-flightradar24 122 | 123 | Docker container running FlightRadar24's fr24feed. Designed to work in tandem with sdr-enthusiasts/docker-adsb-ultrafeeder. 124 | 125 | * Image: [ghcr.io/sdr-enthusiasts/docker-flightradar24](https://github.com/sdr-enthusiasts/docker-flightradar24/pkgs/container/docker-flightradar24) 126 | 127 | ### docker-opensky-network 128 | 129 | Docker container running OpenSky Network's's opensky-feeder. Designed to work in tandem with sdr-enthusiasts/docker-adsb-ultrafeeder. 130 | 131 | * Image: [ghcr.io/sdr-enthusiasts/docker-opensky-network](https://github.com/sdr-enthusiasts/docker-opensky-network/pkgs/container/docker-opensky-network) 132 | 133 | ### Wireguard 134 | 135 | WireGuard® is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. 136 | 137 | * Image: [linuxserver/wireguard](https://hub.docker.com/r/linuxserver/wireguard) 138 | 139 | ### Transmission 140 | 141 | Transmission is a cross-platform BitTorrent client. 142 | 143 | * Image: [linuxserver/transmission](https://hub.docker.com/r/linuxserver/transmission) 144 | 145 | ### Jackett 146 | 147 | Jackett works as a proxy server: it translates queries from apps into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. 148 | 149 | * Image: [linuxserver/jackett](https://hub.docker.com/r/linuxserver/jackett) 150 | 151 | ### Sonarr 152 | 153 | Sonarr is a PVR for Usenet and BitTorrent users. 154 | 155 | * Image: [linuxserver/sonarr](https://hub.docker.com/r/linuxserver/sonarr) 156 | 157 | ### Radarr 158 | 159 | Radarr is an independent fork of Sonarr reworked for automatically downloading movies via Usenet and BitTorrent. 160 | 161 | * Image: [linuxserver/radarr](https://hub.docker.com/r/linuxserver/radarr) 162 | 163 | ## Support my work 164 | 165 | A lot of time and effort goes into the development of this and other open-source projects. 166 | 167 | If you find this project valuable, please consider supporting my work by making a donation. 168 | 169 | [![Donate on Paypal](https://img.shields.io/badge/donate-paypal-blue.svg)](https://paypal.me/pedrolamas 'Donate on Paypal') 170 | [![Buy me a coffee](https://img.shields.io/badge/buy%20me%20a%20coffee-kofi-blue.svg)](https://ko-fi.com/pedrolamas 'Buy me a coffee') 171 | [![Support me on Patreon](https://img.shields.io/badge/join-patreon-blue.svg)](https://www.patreon.com/pedrolamas 'Support me on Patreon') 172 | [![Sponsor me on GitHub](https://img.shields.io/github/sponsors/pedrolamas.svg?label=github%20sponsors)](https://github.com/sponsors/pedrolamas 'Sponsor me on GitHub') 173 | 174 | Thank you for your generosity and support! 🙏 175 | 176 | ## License 177 | 178 | MIT 179 | -------------------------------------------------------------------------------- /acme.sh/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /adguardhome/conf/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /adguardhome/work/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /chronograf/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /common-linuxserver.env: -------------------------------------------------------------------------------- 1 | PUID=1000 2 | PGID=1000 3 | -------------------------------------------------------------------------------- /common.env: -------------------------------------------------------------------------------- 1 | TZ=Europe/London 2 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | adguardhome: 3 | image: adguard/adguardhome 4 | restart: unless-stopped 5 | networks: 6 | backbone: 7 | ipv4_address: 10.0.0.3 8 | ports: 9 | - "53:53/tcp" 10 | - "53:53/udp" 11 | - "784:784" 12 | - "853:853" 13 | volumes: 14 | - "./adguardhome/work:/opt/adguardhome/work" 15 | - "./adguardhome/conf:/opt/adguardhome/conf" 16 | env_file: 17 | - ./common.env 18 | 19 | nginx: 20 | depends_on: 21 | adguardhome: 22 | condition: service_started 23 | restart: false 24 | homeassistant: 25 | condition: service_started 26 | restart: false 27 | grafana: 28 | condition: service_started 29 | restart: false 30 | portainer: 31 | condition: service_started 32 | restart: false 33 | esphome: 34 | condition: service_started 35 | restart: false 36 | vscode: 37 | condition: service_started 38 | restart: false 39 | fluidd: 40 | condition: service_started 41 | restart: false 42 | mainsail: 43 | condition: service_started 44 | restart: false 45 | spoolman: 46 | condition: service_started 47 | restart: false 48 | ultrafeeder: 49 | condition: service_started 50 | restart: false 51 | flightradar24: 52 | condition: service_started 53 | restart: false 54 | image: nginx 55 | restart: unless-stopped 56 | networks: 57 | backbone: 58 | ipv4_address: 10.0.0.4 59 | ports: 60 | - "80:80" 61 | - "443:443/tcp" 62 | - "443:443/udp" 63 | - "21443:21443/tcp" 64 | - "21443:21443/udp" 65 | extra_hosts: 66 | - "homeassistant:10.0.0.1" 67 | - "esphome:10.0.0.1" 68 | volumes: 69 | - "./nginx/etc-nginx-templates:/etc/nginx/templates" 70 | - "./nginx/etc-nginx-cf-certs:/etc/nginx/cf-certs" 71 | - "./nginx/etc-nginx-le-certs:/etc/nginx/le-certs" 72 | env_file: 73 | - ./common.env 74 | - ./nginx/secrets.env 75 | environment: 76 | - NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx 77 | dns: 10.0.0.3 78 | labels: 79 | - sh.acme.target 80 | 81 | homeassistant: 82 | depends_on: 83 | - mariadb 84 | - mosquitto 85 | image: ghcr.io/home-assistant/home-assistant 86 | restart: unless-stopped 87 | healthcheck: 88 | test: >- 89 | curl -f http://localhost:8123 || exit 1 90 | network_mode: host 91 | volumes: 92 | - "./homeassistant/config:/config" 93 | - "/mnt/media/TV:/media/tv:ro" 94 | - "/mnt/media/Movies:/media/movies:ro" 95 | env_file: 96 | - ./common.env 97 | environment: 98 | - PYTHONWARNINGS=ignore:Unverified HTTPS request 99 | dns: 10.0.0.3 100 | 101 | mosquitto: 102 | depends_on: 103 | adguardhome: 104 | condition: service_started 105 | restart: false 106 | image: eclipse-mosquitto 107 | restart: unless-stopped 108 | networks: 109 | backbone: 110 | ipv4_address: 10.0.0.6 111 | ports: 112 | - "1883:1883" 113 | - "1884:1884" 114 | - "9001:9001" 115 | volumes: 116 | - "./mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf" 117 | - "./mosquitto/data:/mosquitto/data" 118 | - "./mosquitto/config/password_file:/mosquitto/config/password_file" 119 | env_file: 120 | - ./common.env 121 | dns: 10.0.0.3 122 | 123 | zigbee2mqtt: 124 | depends_on: 125 | - mosquitto 126 | image: koenkk/zigbee2mqtt 127 | restart: unless-stopped 128 | networks: 129 | backbone: 130 | ipv4_address: 10.0.0.7 131 | volumes: 132 | - "./zigbee2mqtt/data:/app/data" 133 | # - "./zigbee2mqtt/zigbee-herdsman-converters:/app/node_modules/zigbee-herdsman-converters" 134 | # - "./zigbee2mqtt/homeassistant-extension/homeassistant.js:/app/lib/extension/homeassistant.js" 135 | devices: 136 | - "/dev/ttyUSB0:/dev/ttyUSB0" 137 | # environment: 138 | # - DEBUG=zigbee-herdsman* 139 | env_file: 140 | - ./common.env 141 | dns: 10.0.0.3 142 | 143 | telegraf: 144 | depends_on: 145 | adguardhome: 146 | condition: service_started 147 | restart: false 148 | image: telegraf 149 | restart: unless-stopped 150 | networks: 151 | backbone: 152 | ipv4_address: 10.0.0.8 153 | volumes: 154 | - "./telegraf/config/telegraf.conf:/etc/telegraf/telegraf.conf:ro" 155 | - "/:/hostfs:ro" 156 | env_file: 157 | - ./common.env 158 | - ./telegraf/secrets.env 159 | environment: 160 | - HOST_MOUNT_PREFIX=/hostfs 161 | - HOST_ETC=/hostfs/etc 162 | - HOST_PROC=/hostfs/proc 163 | - HOST_SYS=/hostfs/sys 164 | - HOST_VAR=/hostfs/var 165 | - HOST_RUN=/hostfs/run 166 | dns: 10.0.0.3 167 | 168 | mariadb: 169 | depends_on: 170 | adguardhome: 171 | condition: service_started 172 | restart: false 173 | image: mariadb 174 | restart: unless-stopped 175 | networks: 176 | backbone: 177 | ipv4_address: 10.0.0.9 178 | volumes: 179 | - "./mariadb/config:/etc/mysql/conf.d" 180 | - "./mariadb/data:/var/lib/mysql" 181 | env_file: 182 | - ./common.env 183 | - ./mariadb/secrets.env 184 | dns: 10.0.0.3 185 | 186 | grafana: 187 | depends_on: 188 | adguardhome: 189 | condition: service_started 190 | restart: false 191 | image: grafana/grafana 192 | restart: unless-stopped 193 | networks: 194 | backbone: 195 | ipv4_address: 10.0.0.10 196 | volumes: 197 | - "./grafana/data:/var/lib/grafana" 198 | env_file: 199 | - ./common.env 200 | dns: 10.0.0.3 201 | 202 | portainer: 203 | depends_on: 204 | adguardhome: 205 | condition: service_started 206 | restart: false 207 | image: portainer/portainer-ce 208 | restart: unless-stopped 209 | networks: 210 | backbone: 211 | ipv4_address: 10.0.0.11 212 | volumes: 213 | - "./portainer/data:/data" 214 | - "/var/run/docker.sock:/var/run/docker.sock" 215 | env_file: 216 | - ./common.env 217 | dns: 10.0.0.3 218 | 219 | esphome: 220 | depends_on: 221 | adguardhome: 222 | condition: service_started 223 | restart: false 224 | image: ghcr.io/esphome/esphome 225 | restart: unless-stopped 226 | network_mode: host 227 | volumes: 228 | - "./esphome/config:/config" 229 | env_file: 230 | - ./common.env 231 | dns: 10.0.0.3 232 | 233 | acme.sh: 234 | depends_on: 235 | adguardhome: 236 | condition: service_started 237 | restart: false 238 | image: neilpang/acme.sh 239 | restart: unless-stopped 240 | networks: 241 | backbone: 242 | ipv4_address: 10.0.0.13 243 | volumes: 244 | - "./acme.sh/data:/acme.sh" 245 | - "/var/run/docker.sock:/var/run/docker.sock" 246 | env_file: 247 | - ./common.env 248 | - ./acme.sh/secrets.env 249 | environment: 250 | - DEPLOY_DOCKER_CONTAINER_LABEL=sh.acme.target 251 | - DEPLOY_DOCKER_CONTAINER_KEY_FILE=/etc/nginx/le-certs/key.pem 252 | - DEPLOY_DOCKER_CONTAINER_CERT_FILE="/etc/nginx/le-certs/cert.pem" 253 | - DEPLOY_DOCKER_CONTAINER_CA_FILE="/etc/nginx/le-certs/ca.pem" 254 | - DEPLOY_DOCKER_CONTAINER_FULLCHAIN_FILE="/etc/nginx/le-certs/full.pem" 255 | - DEPLOY_DOCKER_CONTAINER_RELOAD_CMD="service nginx force-reload" 256 | command: >- 257 | daemon 258 | dns: 10.0.0.3 259 | 260 | vscode: 261 | depends_on: 262 | adguardhome: 263 | condition: service_started 264 | restart: false 265 | image: codercom/code-server 266 | restart: unless-stopped 267 | networks: 268 | backbone: 269 | ipv4_address: 10.0.0.14 270 | volumes: 271 | - "./vscode/data:/home/coder/.local/share/code-server" 272 | - "./:/home/coder/project" 273 | env_file: 274 | - ./common.env 275 | - ./vscode/secrets.env 276 | command: >- 277 | --auth none --disable-telemetry project 278 | dns: 10.0.0.3 279 | 280 | fluidd: 281 | depends_on: 282 | adguardhome: 283 | condition: service_started 284 | restart: false 285 | image: ghcr.io/fluidd-core/fluidd:latest-develop 286 | restart: unless-stopped 287 | networks: 288 | backbone: 289 | ipv4_address: 10.0.0.16 290 | env_file: 291 | - ./common.env 292 | dns: 10.0.0.3 293 | 294 | mainsail: 295 | depends_on: 296 | adguardhome: 297 | condition: service_started 298 | restart: false 299 | image: ghcr.io/pedrolamas/docker-mainsail:latest-dev 300 | restart: unless-stopped 301 | networks: 302 | backbone: 303 | ipv4_address: 10.0.0.17 304 | env_file: 305 | - ./common.env 306 | dns: 10.0.0.3 307 | 308 | ultrafeeder: 309 | depends_on: 310 | adguardhome: 311 | condition: service_started 312 | restart: false 313 | image: ghcr.io/sdr-enthusiasts/docker-adsb-ultrafeeder 314 | restart: unless-stopped 315 | device_cgroup_rules: 316 | - "c 189:* rwm" 317 | networks: 318 | backbone: 319 | ipv4_address: 10.0.0.18 320 | ports: 321 | - 30005:30005 322 | volumes: 323 | - "./ultrafeeder/globe_history:/var/globe_history" 324 | - "./ultrafeeder/graphs1090:/var/lib/collectd" 325 | - "/proc/diskstats:/proc/diskstats:ro" 326 | - "/dev/bus/usb:/dev/bus/usb" 327 | env_file: 328 | - ./common.env 329 | - ./ultrafeeder/secrets.env 330 | environment: 331 | - LOGLEVEL=error 332 | - READSB_DEVICE_TYPE=rtlsdr 333 | - READSB_GAIN=auto 334 | dns: 10.0.0.3 335 | tmpfs: 336 | - /run:exec,size=256M 337 | - /tmp:size=128M 338 | - /var/log:size=32M 339 | 340 | flightradar24: 341 | depends_on: 342 | - ultrafeeder 343 | image: ghcr.io/sdr-enthusiasts/docker-flightradar24 344 | restart: unless-stopped 345 | tty: true 346 | networks: 347 | backbone: 348 | ipv4_address: 10.0.0.19 349 | env_file: 350 | - ./common.env 351 | - ./flightradar24/secrets.env 352 | dns: 10.0.0.3 353 | 354 | opensky: 355 | depends_on: 356 | - ultrafeeder 357 | image: ghcr.io/sdr-enthusiasts/docker-opensky-network 358 | restart: unless-stopped 359 | tty: true 360 | networks: 361 | backbone: 362 | ipv4_address: 10.0.0.20 363 | env_file: 364 | - ./common.env 365 | - ./opensky/secrets.env 366 | dns: 10.0.0.3 367 | 368 | spoolman: 369 | depends_on: 370 | adguardhome: 371 | condition: service_started 372 | restart: false 373 | restart: unless-stopped 374 | networks: 375 | backbone: 376 | ipv4_address: 10.0.0.21 377 | volumes: 378 | - "./spoolman/data:/home/app/.local/share/spoolman" 379 | env_file: 380 | - ./common.env 381 | 382 | wireguard: 383 | image: linuxserver/wireguard 384 | restart: unless-stopped 385 | networks: 386 | backbone: 387 | ipv4_address: 10.0.0.15 388 | volumes: 389 | - "./wireguard/config:/config" 390 | - "/lib/modules:/lib/modules:ro" 391 | env_file: 392 | - ./common.env 393 | - ./common-linuxserver.env 394 | cap_add: 395 | - NET_ADMIN 396 | - SYS_MODULE 397 | sysctls: 398 | - net.ipv4.conf.all.src_valid_mark=1 399 | 400 | transmission: 401 | depends_on: 402 | - wireguard 403 | image: linuxserver/transmission 404 | restart: unless-stopped 405 | network_mode: service:wireguard 406 | volumes: 407 | - "./transmission/config:/config" 408 | - "../downloads:/downloads" 409 | env_file: 410 | - ./common.env 411 | - ./common-linuxserver.env 412 | 413 | jackett: 414 | depends_on: 415 | - wireguard 416 | image: linuxserver/jackett 417 | restart: unless-stopped 418 | network_mode: service:wireguard 419 | volumes: 420 | - "./jackett/config:/config" 421 | - "../downloads:/downloads" 422 | env_file: 423 | - ./common.env 424 | - ./common-linuxserver.env 425 | environment: 426 | - AUTO_UPDATE=true 427 | 428 | sonarr: 429 | depends_on: 430 | - wireguard 431 | image: linuxserver/sonarr 432 | restart: unless-stopped 433 | network_mode: service:wireguard 434 | volumes: 435 | - "./sonarr/config:/config" 436 | - "../downloads:/downloads" 437 | - "/mnt/media/TV:/tv" 438 | env_file: 439 | - ./common.env 440 | - ./common-linuxserver.env 441 | 442 | radarr: 443 | depends_on: 444 | - wireguard 445 | image: linuxserver/radarr 446 | restart: unless-stopped 447 | network_mode: service:wireguard 448 | volumes: 449 | - "./radarr/config:/config" 450 | - "../downloads:/downloads" 451 | - "/mnt/media/Movies:/movies" 452 | env_file: 453 | - ./common.env 454 | - ./common-linuxserver.env 455 | 456 | networks: 457 | backbone: 458 | driver: bridge 459 | driver_opts: 460 | com.docker.network.bridge.name: backbone 461 | ipam: 462 | config: 463 | - subnet: 10.0.0.0/27 464 | -------------------------------------------------------------------------------- /esphome/config/.gitignore: -------------------------------------------------------------------------------- 1 | # Gitignore settings for ESPHome 2 | # This is an example and may include too much for your use-case. 3 | # You can modify this file to suit your needs. 4 | /.esphome/ 5 | **/.pioenvs/ 6 | **/.piolibdeps/ 7 | **/lib/ 8 | **/src/ 9 | **/platformio.ini 10 | **/partitions.csv 11 | /secrets.yaml 12 | -------------------------------------------------------------------------------- /esphome/config/node02.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | esphome_name: node02 3 | 4 | esphome: 5 | name: ${esphome_name} 6 | platform: ESP8266 7 | board: d1_mini 8 | 9 | wifi: 10 | networks: 11 | - ssid: !secret wifi_ssid 12 | password: !secret wifi_password 13 | hidden: true 14 | fast_connect: true 15 | reboot_timeout: 3min 16 | ap: 17 | ssid: "${esphome_name} Fallback Hotspot" 18 | password: !secret wifi_ap_password 19 | 20 | output: 21 | - platform: gpio 22 | id: output_gpio_d7 23 | pin: D2 24 | 25 | light: 26 | - platform: binary 27 | id: red_light 28 | internal: true 29 | output: output_gpio_d7 30 | 31 | sensor: 32 | - platform: pulse_meter 33 | name: "${esphome_name} Power Meter" 34 | pin: D1 35 | unit_of_measurement: "W" 36 | accuracy_decimals: 3 37 | internal_filter: 100ms 38 | timeout: 2min 39 | on_value: 40 | then: 41 | - if: 42 | condition: 43 | lambda: 'return id(led_enabled).state;' 44 | then: 45 | - light.turn_on: 46 | id: red_light 47 | flash_length: 100ms 48 | filters: 49 | - multiply: 60 50 | total: 51 | name: "${esphome_name} Total Energy" 52 | unit_of_measurement: "kWh" 53 | state_class: total_increasing 54 | device_class: energy 55 | accuracy_decimals: 3 56 | filters: 57 | - multiply: 0.001 58 | 59 | switch: 60 | - platform: template 61 | name: "${esphome_name} LED enabled" 62 | id: led_enabled 63 | optimistic: true 64 | 65 | button: 66 | - platform: restart 67 | name: "${esphome_name} Restart" 68 | 69 | time: 70 | - platform: homeassistant 71 | 72 | captive_portal: 73 | 74 | logger: 75 | 76 | api: 77 | encryption: 78 | key: !secret encryption_key 79 | 80 | ota: 81 | password: !secret ota_password 82 | -------------------------------------------------------------------------------- /esphome/config/node07.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | esphome_name: node07 3 | 4 | esphome: 5 | name: ${esphome_name} 6 | platform: ESP32 7 | board: esp-wrover-kit 8 | 9 | wifi: 10 | networks: 11 | - ssid: !secret wifi_ssid 12 | password: !secret wifi_password 13 | hidden: true 14 | domain: !secret wifi_domain 15 | fast_connect: true 16 | reboot_timeout: 3min 17 | ap: 18 | ssid: "${esphome_name} Fallback Hotspot" 19 | password: !secret wifi_ap_password 20 | 21 | esp32_ble_tracker: 22 | 23 | sensor: 24 | - platform: xiaomi_hhccjcy01 25 | mac_address: 'C4:7C:8D:6B:F6:EE' 26 | temperature: 27 | name: "${esphome_name} Plant 1 Temperature" 28 | moisture: 29 | name: "${esphome_name} Plant 1 Moisture" 30 | illuminance: 31 | name: "${esphome_name} Plant 1 Illuminance" 32 | conductivity: 33 | name: "${esphome_name} Plant 1 Soil Conductivity" 34 | battery_level: 35 | name: "${esphome_name} Plant 1 Battery Level" 36 | - platform: xiaomi_hhccjcy01 37 | mac_address: 'C4:7C:8D:6B:F4:91' 38 | temperature: 39 | name: "${esphome_name} Plant 2 Temperature" 40 | moisture: 41 | name: "${esphome_name} Plant 2 Moisture" 42 | illuminance: 43 | name: "${esphome_name} Plant 2 Illuminance" 44 | conductivity: 45 | name: "${esphome_name} Plant 2 Soil Conductivity" 46 | battery_level: 47 | name: "${esphome_name} Plant 2 Battery Level" 48 | 49 | switch: 50 | - platform: restart 51 | name: "${esphome_name} Restart" 52 | 53 | captive_portal: 54 | 55 | logger: 56 | 57 | api: 58 | password: !secret api_password 59 | 60 | ota: 61 | password: !secret ota_password 62 | -------------------------------------------------------------------------------- /esphome/config/node08.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | esphome_name: node08 3 | 4 | esphome: 5 | name: ${esphome_name} 6 | platform: ESP32 7 | board: esp32dev 8 | 9 | wifi: 10 | networks: 11 | - ssid: !secret wifi_ssid 12 | password: !secret wifi_password 13 | hidden: true 14 | fast_connect: true 15 | reboot_timeout: 3min 16 | ap: 17 | ssid: "${esphome_name} Fallback Hotspot" 18 | password: !secret wifi_ap_password 19 | 20 | esp32_ble_tracker: 21 | 22 | bluetooth_proxy: 23 | 24 | remote_receiver: 25 | pin: GPIO32 26 | dump: rc_switch 27 | tolerance: 50% 28 | filter: 250us 29 | idle: 4ms 30 | buffer_size: 2kb 31 | 32 | button: 33 | - platform: restart 34 | name: "${esphome_name} Restart" 35 | 36 | time: 37 | - platform: homeassistant 38 | 39 | captive_portal: 40 | 41 | logger: 42 | 43 | api: 44 | encryption: 45 | key: !secret encryption_key 46 | 47 | ota: 48 | password: !secret ota_password 49 | -------------------------------------------------------------------------------- /esphome/config/node10.yaml: -------------------------------------------------------------------------------- 1 | substitutions: 2 | esphome_name: node10 3 | 4 | esphome: 5 | name: ${esphome_name} 6 | 7 | esp8266: 8 | board: esp01_1m 9 | 10 | wifi: 11 | networks: 12 | - ssid: !secret wifi_ssid 13 | password: !secret wifi_password 14 | hidden: true 15 | domain: !secret wifi_domain 16 | fast_connect: true 17 | reboot_timeout: 3min 18 | ap: 19 | ssid: "${esphome_name} Fallback Hotspot" 20 | password: !secret wifi_ap_password 21 | 22 | uart: 23 | rx_pin: GPIO04 24 | baud_rate: 9600 25 | 26 | sensor: 27 | - platform: pm1006 28 | pm_2_5: 29 | name: "${esphome_name} Ikea Vindriktning PM25" 30 | filters: 31 | - sliding_window_moving_average: 32 | window_size: 10 33 | send_every: 10 34 | 35 | button: 36 | - platform: restart 37 | name: "${esphome_name} Restart" 38 | 39 | time: 40 | - platform: homeassistant 41 | 42 | captive_portal: 43 | 44 | logger: 45 | 46 | api: 47 | encryption: 48 | key: !secret encryption_key 49 | 50 | ota: 51 | password: !secret ota_password 52 | -------------------------------------------------------------------------------- /grafana/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /influxdb/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !influxdb.conf 4 | -------------------------------------------------------------------------------- /influxdb/data/influxdb.conf: -------------------------------------------------------------------------------- 1 | reporting-disabled = false 2 | bind-address = "127.0.0.1:8088" 3 | 4 | [meta] 5 | dir = "/var/lib/influxdb/meta" 6 | retention-autocreate = true 7 | logging-enabled = true 8 | 9 | [data] 10 | dir = "/var/lib/influxdb/data" 11 | index-version = "inmem" 12 | wal-dir = "/var/lib/influxdb/wal" 13 | wal-fsync-delay = "0s" 14 | validate-keys = false 15 | query-log-enabled = true 16 | cache-max-memory-size = 1073741824 17 | cache-snapshot-memory-size = 26214400 18 | cache-snapshot-write-cold-duration = "10m0s" 19 | compact-full-write-cold-duration = "4h0m0s" 20 | compact-throughput = 50331648 21 | compact-throughput-burst = 50331648 22 | max-series-per-database = 1000000 23 | max-values-per-tag = 100000 24 | max-concurrent-compactions = 0 25 | max-index-log-file-size = 1048576 26 | series-id-set-cache-size = 100 27 | trace-logging-enabled = false 28 | tsm-use-madv-willneed = false 29 | 30 | [coordinator] 31 | write-timeout = "10s" 32 | max-concurrent-queries = 0 33 | query-timeout = "0s" 34 | log-queries-after = "0s" 35 | max-select-point = 0 36 | max-select-series = 0 37 | max-select-buckets = 0 38 | 39 | [retention] 40 | enabled = true 41 | check-interval = "30m0s" 42 | 43 | [shard-precreation] 44 | enabled = true 45 | check-interval = "10m0s" 46 | advance-period = "30m0s" 47 | 48 | [monitor] 49 | store-enabled = true 50 | store-database = "_internal" 51 | store-interval = "10s" 52 | 53 | [subscriber] 54 | enabled = true 55 | http-timeout = "30s" 56 | insecure-skip-verify = false 57 | ca-certs = "" 58 | write-concurrency = 40 59 | write-buffer-size = 1000 60 | 61 | [http] 62 | enabled = true 63 | bind-address = ":8086" 64 | auth-enabled = false 65 | log-enabled = true 66 | suppress-write-log = false 67 | write-tracing = false 68 | flux-enabled = false 69 | flux-log-enabled = false 70 | pprof-enabled = true 71 | debug-pprof-enabled = false 72 | https-enabled = false 73 | https-certificate = "/etc/ssl/influxdb.pem" 74 | https-private-key = "" 75 | max-row-limit = 0 76 | max-connection-limit = 0 77 | shared-secret = "" 78 | realm = "InfluxDB" 79 | unix-socket-enabled = false 80 | unix-socket-permissions = "0777" 81 | bind-socket = "/var/run/influxdb.sock" 82 | max-body-size = 25000000 83 | access-log-path = "" 84 | max-concurrent-write-limit = 0 85 | max-enqueued-write-limit = 0 86 | enqueued-write-timeout = 30000000000 87 | 88 | [logging] 89 | format = "auto" 90 | level = "info" 91 | suppress-logo = false 92 | 93 | [[graphite]] 94 | enabled = false 95 | bind-address = ":2003" 96 | database = "graphite" 97 | retention-policy = "" 98 | protocol = "tcp" 99 | batch-size = 5000 100 | batch-pending = 10 101 | batch-timeout = "1s" 102 | consistency-level = "one" 103 | separator = "." 104 | udp-read-buffer = 0 105 | 106 | [[collectd]] 107 | enabled = false 108 | bind-address = ":25826" 109 | database = "collectd" 110 | retention-policy = "" 111 | batch-size = 5000 112 | batch-pending = 10 113 | batch-timeout = "10s" 114 | read-buffer = 0 115 | typesdb = "/usr/share/collectd/types.db" 116 | security-level = "none" 117 | auth-file = "/etc/collectd/auth_file" 118 | parse-multivalue-plugin = "split" 119 | 120 | [[opentsdb]] 121 | enabled = false 122 | bind-address = ":4242" 123 | database = "opentsdb" 124 | retention-policy = "" 125 | consistency-level = "one" 126 | tls-enabled = false 127 | certificate = "/etc/ssl/influxdb.pem" 128 | batch-size = 1000 129 | batch-pending = 5 130 | batch-timeout = "1s" 131 | log-point-errors = true 132 | 133 | [[udp]] 134 | enabled = false 135 | bind-address = ":8089" 136 | database = "udp" 137 | retention-policy = "" 138 | batch-size = 5000 139 | batch-pending = 10 140 | read-buffer = 0 141 | batch-timeout = "1s" 142 | precision = "" 143 | 144 | [continuous_queries] 145 | log-enabled = true 146 | enabled = true 147 | query-stats-enabled = false 148 | run-interval = "1s" 149 | 150 | [tls] 151 | min-version = "" 152 | max-version = "" 153 | 154 | -------------------------------------------------------------------------------- /jackett/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /mariadb/config/mariadb-server.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | skip-host-cache 3 | 4 | #port=3306 5 | #log_error=mariadb.err 6 | 7 | ## Persistent storage location 8 | #datadir=/data/databases 9 | 10 | # Use a proper collation set 11 | character-set-server = utf8mb4 12 | collation-server = utf8mb4_unicode_ci 13 | 14 | # Do not resolve DNS names 15 | skip-name-resolve 16 | 17 | # Tune for low-end devices (Like a Raspberry Pi) 18 | key_buffer_size = 16M 19 | max_connections = 64 20 | myisam_recover_options = FORCE 21 | myisam_sort_buffer_size = 8M 22 | net_buffer_length = 16K 23 | read_buffer_size = 256K 24 | read_rnd_buffer_size = 512K 25 | sort_buffer_size = 512K 26 | join_buffer_size = 128K 27 | table_open_cache = 64 28 | thread_cache_size = 8 29 | thread_stack = 192K 30 | tmp_table_size = 16M 31 | 32 | # Disable query cache 33 | query_cache_limit = 1M 34 | query_cache_size = 0M 35 | query_cache_type = 0 36 | 37 | # InnoDB Tweaks 38 | innodb_buffer_pool_instances = 1 39 | innodb_buffer_pool_size = 256M 40 | innodb_log_buffer_size = 8M 41 | innodb_log_file_size = 48M 42 | max_binlog_size = 96M 43 | -------------------------------------------------------------------------------- /mariadb/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /mosquitto/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !mosquitto.conf 4 | -------------------------------------------------------------------------------- /mosquitto/config/mosquitto.conf: -------------------------------------------------------------------------------- 1 | log_dest stdout 2 | 3 | persistence true 4 | persistence_location /mosquitto/data/ 5 | 6 | listener 1883 7 | protocol mqtt 8 | 9 | listener 1884 10 | protocol websockets 11 | 12 | allow_anonymous false 13 | password_file /mosquitto/config/password_file 14 | -------------------------------------------------------------------------------- /nginx/etc-nginx-cf-certs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !nginx-server.conf 4 | -------------------------------------------------------------------------------- /nginx/etc-nginx-cf-certs/nginx-server.conf: -------------------------------------------------------------------------------- 1 | listen 21443 ssl; 2 | listen [::]:21443 ssl; 3 | 4 | http2 on; 5 | 6 | ssl_certificate /etc/nginx/cf-certs/certificate.pem; 7 | ssl_certificate_key /etc/nginx/cf-certs/privatekey.pem; 8 | ssl_client_certificate /etc/nginx/cf-certs/origin-pull-ca.pem; 9 | ssl_verify_client on; 10 | ssl_dhparam /etc/nginx/cf-certs/dhparam.pem; 11 | ssl_protocols TLSv1.3; 12 | ssl_prefer_server_ciphers off; 13 | ssl_session_timeout 10m; 14 | ssl_session_cache shared:SSL:10m; 15 | ssl_session_tickets off; 16 | ssl_buffer_size 4k; 17 | 18 | add_header X-XSS-Protection "1; mode=block"; 19 | -------------------------------------------------------------------------------- /nginx/etc-nginx-le-certs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !nginx-server.conf 4 | -------------------------------------------------------------------------------- /nginx/etc-nginx-le-certs/nginx-server.conf: -------------------------------------------------------------------------------- 1 | listen 443 ssl; 2 | listen [::]:443 ssl; 3 | 4 | http2 on; 5 | 6 | allow 127.0.0.0/8; 7 | allow 10.0.0.0/8; 8 | allow 192.168.0.0/16; 9 | allow 172.16.0.0/12; 10 | deny all; 11 | 12 | ssl_certificate /etc/nginx/le-certs/full.pem; 13 | ssl_certificate_key /etc/nginx/le-certs/key.pem; 14 | ssl_dhparam /etc/nginx/le-certs/dhparam.pem; 15 | ssl_stapling on; 16 | ssl_stapling_verify on; 17 | ssl_trusted_certificate /etc/nginx/le-certs/ca.pem; 18 | ssl_protocols TLSv1.3; 19 | ssl_prefer_server_ciphers off; 20 | ssl_session_timeout 1d; 21 | ssl_session_cache shared:SSL:10m; 22 | ssl_session_tickets off; 23 | ssl_buffer_size 4k; 24 | 25 | resolver 10.0.0.3; 26 | 27 | proxy_hide_header X-Frame-Options; 28 | 29 | add_header X-XSS-Protection "1; mode=block"; 30 | add_header Referrer-Policy strict-origin-when-cross-origin; 31 | add_header X-Content-Type-Options nosniff; 32 | -------------------------------------------------------------------------------- /nginx/etc-nginx-templates/nginx.conf.template: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | worker_rlimit_nofile 20000; 3 | 4 | events { 5 | worker_connections 4096; 6 | } 7 | 8 | http { 9 | map $http_x_forwarded_proto $proxy_x_forwarded_proto { 10 | default $http_x_forwarded_proto; 11 | '' $scheme; 12 | } 13 | 14 | map $http_x_forwarded_host $proxy_x_forwarded_host { 15 | default $http_x_forwarded_host; 16 | '' $host; 17 | } 18 | 19 | map $http_x_forwarded_port $proxy_x_forwarded_port { 20 | default $http_x_forwarded_port; 21 | '' $server_port; 22 | } 23 | 24 | map $http_upgrade $connection_upgrade { 25 | default upgrade; 26 | '' close; 27 | } 28 | 29 | map $scheme $proxy_x_forwarded_ssl { 30 | default off; 31 | https on; 32 | } 33 | 34 | upstream adguardhome-upstream { 35 | ip_hash; 36 | server adguardhome; 37 | } 38 | upstream homeassistant-upstream { 39 | ip_hash; 40 | server homeassistant:8123; 41 | } 42 | upstream grafana-upstream { 43 | ip_hash; 44 | server grafana:3000; 45 | } 46 | upstream portainer-upstream { 47 | ip_hash; 48 | server portainer:9000; 49 | } 50 | upstream esphome-upstream { 51 | ip_hash; 52 | server esphome:6052; 53 | } 54 | upstream vscode-upstream { 55 | ip_hash; 56 | server vscode:8080; 57 | } 58 | upstream zigbee2mqtt-upstream { 59 | ip_hash; 60 | server zigbee2mqtt:8080; 61 | } 62 | upstream spoolman-upstream { 63 | ip_hash; 64 | server spoolman:8000; 65 | } 66 | upstream fluidd-upstream { 67 | ip_hash; 68 | server fluidd; 69 | } 70 | upstream mainsail-upstream { 71 | ip_hash; 72 | server mainsail; 73 | } 74 | upstream ender3v2-apiserver-upstream { 75 | ip_hash; 76 | server ${NGINX_ENDER3V2_UPSTREAM}:7125; 77 | } 78 | upstream ender3v2-streamer-upstream { 79 | ip_hash; 80 | server ${NGINX_ENDER3V2_UPSTREAM}:8080; 81 | } 82 | upstream trident300-apiserver-upstream { 83 | ip_hash; 84 | server ${NGINX_TRIDENT300_UPSTREAM}:7125; 85 | } 86 | upstream trident300-streamer-upstream { 87 | ip_hash; 88 | server ${NGINX_TRIDENT300_UPSTREAM}:8080; 89 | } 90 | upstream ultrafeeder-upstream { 91 | ip_hash; 92 | server ultrafeeder:80; 93 | } 94 | upstream flightradar24-upstream { 95 | ip_hash; 96 | server flightradar24:8754; 97 | } 98 | upstream transmission-upstream { 99 | ip_hash; 100 | server wireguard:9091; 101 | } 102 | upstream jackett-upstream { 103 | ip_hash; 104 | server wireguard:9117; 105 | } 106 | upstream sonarr-upstream { 107 | ip_hash; 108 | server wireguard:8989; 109 | } 110 | upstream radarr-upstream { 111 | ip_hash; 112 | server wireguard:7878; 113 | } 114 | 115 | sendfile on; 116 | tcp_nopush on; 117 | tcp_nodelay on; 118 | keepalive_timeout 15; 119 | 120 | client_max_body_size 0; 121 | 122 | gzip on; 123 | gzip_vary on; 124 | gzip_comp_level 2; 125 | gzip_min_length 1024; 126 | gzip_proxied expired no-cache no-store private auth; 127 | gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 128 | 129 | log_format vhost '$host $remote_addr - $remote_user [$time_local] ' 130 | '"$request" $status $body_bytes_sent ' 131 | '"$http_referer" "$http_user_agent"'; 132 | 133 | access_log /var/log/nginx/access.log vhost; 134 | 135 | server_names_hash_bucket_size 128; 136 | server_tokens off; 137 | 138 | proxy_http_version 1.1; 139 | proxy_buffering off; 140 | proxy_set_header Host $host; 141 | proxy_set_header Upgrade $http_upgrade; 142 | proxy_set_header Connection $connection_upgrade; 143 | proxy_set_header X-Real-IP $remote_addr; 144 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 145 | proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; 146 | proxy_set_header X-Forwarded-Host $proxy_x_forwarded_host; 147 | proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; 148 | proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port; 149 | proxy_set_header Proxy ""; 150 | 151 | server { 152 | listen 80 default_server; 153 | listen [::]:80 default_server; 154 | 155 | server_name _; 156 | 157 | return 301 https://$host$request_uri; 158 | } 159 | 160 | server { 161 | include cf-certs/nginx-server.conf; 162 | 163 | server_name _; 164 | 165 | return 444; 166 | } 167 | 168 | server { 169 | include cf-certs/nginx-server.conf; 170 | 171 | server_name ${NGINX_SERVER_HOMEASSISTANT}; 172 | 173 | location / { 174 | proxy_pass http://homeassistant-upstream/; 175 | } 176 | } 177 | 178 | server { 179 | include cf-certs/nginx-server.conf; 180 | 181 | server_name ${NGINX_SERVER_GRAFANA}; 182 | 183 | location / { 184 | proxy_pass http://grafana-upstream/; 185 | } 186 | } 187 | 188 | server { 189 | include le-certs/nginx-server.conf; 190 | 191 | server_name adguardhome.${NGINX_SERVER_LOCAL_DOMAIN}; 192 | 193 | location / { 194 | proxy_pass http://adguardhome-upstream/; 195 | } 196 | } 197 | 198 | server { 199 | include le-certs/nginx-server.conf; 200 | 201 | server_name homeassistant.${NGINX_SERVER_LOCAL_DOMAIN}; 202 | 203 | location / { 204 | proxy_pass http://homeassistant-upstream/; 205 | } 206 | } 207 | 208 | server { 209 | include le-certs/nginx-server.conf; 210 | 211 | server_name grafana.${NGINX_SERVER_LOCAL_DOMAIN}; 212 | 213 | location / { 214 | proxy_pass http://grafana-upstream/; 215 | } 216 | } 217 | 218 | server { 219 | include le-certs/nginx-server.conf; 220 | 221 | server_name portainer.${NGINX_SERVER_LOCAL_DOMAIN}; 222 | 223 | location / { 224 | proxy_pass http://portainer-upstream/; 225 | } 226 | } 227 | 228 | server { 229 | include le-certs/nginx-server.conf; 230 | 231 | server_name esphome.${NGINX_SERVER_LOCAL_DOMAIN}; 232 | 233 | location / { 234 | proxy_pass http://esphome-upstream/; 235 | } 236 | } 237 | 238 | server { 239 | include le-certs/nginx-server.conf; 240 | 241 | server_name vscode.${NGINX_SERVER_LOCAL_DOMAIN}; 242 | 243 | location / { 244 | proxy_pass http://vscode-upstream/; 245 | } 246 | } 247 | 248 | server { 249 | include le-certs/nginx-server.conf; 250 | 251 | server_name zigbee2mqtt.${NGINX_SERVER_LOCAL_DOMAIN}; 252 | 253 | location / { 254 | proxy_pass http://zigbee2mqtt-upstream/; 255 | } 256 | } 257 | 258 | server { 259 | include le-certs/nginx-server.conf; 260 | 261 | server_name spoolman.${NGINX_SERVER_LOCAL_DOMAIN}; 262 | 263 | location / { 264 | proxy_pass http://spoolman-upstream/; 265 | } 266 | } 267 | 268 | server { 269 | include le-certs/nginx-server.conf; 270 | 271 | server_name fluidd.${NGINX_SERVER_LOCAL_DOMAIN}; 272 | 273 | location / { 274 | proxy_pass http://fluidd-upstream/; 275 | } 276 | 277 | location /websocket { 278 | proxy_pass http://ender3v2-apiserver-upstream/websocket; 279 | proxy_read_timeout 86400; 280 | } 281 | 282 | location ~ ^/(printer|api|access|machine|server)/ { 283 | proxy_pass http://ender3v2-apiserver-upstream$request_uri; 284 | } 285 | 286 | location /webcam/ { 287 | proxy_pass http://ender3v2-streamer-upstream/; 288 | postpone_output 0; 289 | proxy_buffering off; 290 | proxy_ignore_headers X-Accel-Buffering; 291 | access_log off; 292 | } 293 | } 294 | 295 | server { 296 | include le-certs/nginx-server.conf; 297 | 298 | server_name ender3v2.${NGINX_SERVER_LOCAL_DOMAIN}; 299 | 300 | location / { 301 | proxy_pass http://ender3v2-apiserver-upstream/; 302 | } 303 | 304 | location /websocket { 305 | proxy_pass http://ender3v2-apiserver-upstream/websocket; 306 | proxy_read_timeout 86400; 307 | } 308 | 309 | location /webcam/ { 310 | proxy_pass http://ender3v2-streamer-upstream/; 311 | postpone_output 0; 312 | proxy_buffering off; 313 | proxy_ignore_headers X-Accel-Buffering; 314 | access_log off; 315 | } 316 | } 317 | 318 | server { 319 | include le-certs/nginx-server.conf; 320 | 321 | server_name trident300.${NGINX_SERVER_LOCAL_DOMAIN}; 322 | 323 | location / { 324 | proxy_pass http://trident300-apiserver-upstream/; 325 | } 326 | 327 | location /websocket { 328 | proxy_pass http://trident300-apiserver-upstream/websocket; 329 | proxy_read_timeout 86400; 330 | } 331 | 332 | location /webcam/ { 333 | proxy_pass http://trident300-streamer-upstream/; 334 | postpone_output 0; 335 | proxy_buffering off; 336 | proxy_ignore_headers X-Accel-Buffering; 337 | access_log off; 338 | } 339 | } 340 | 341 | server { 342 | include le-certs/nginx-server.conf; 343 | 344 | server_name mainsail.${NGINX_SERVER_LOCAL_DOMAIN}; 345 | 346 | location / { 347 | proxy_pass http://mainsail-upstream/; 348 | } 349 | 350 | location /websocket { 351 | proxy_pass http://ender3v2-apiserver-upstream/websocket; 352 | proxy_read_timeout 86400; 353 | } 354 | 355 | location ~ ^/(printer|api|access|machine|server)/ { 356 | proxy_pass http://ender3v2-apiserver-upstream$request_uri; 357 | } 358 | 359 | location /webcam/ { 360 | proxy_pass http://ender3v2-streamer-upstream/; 361 | postpone_output 0; 362 | proxy_buffering off; 363 | proxy_ignore_headers X-Accel-Buffering; 364 | access_log off; 365 | } 366 | } 367 | 368 | server { 369 | include le-certs/nginx-server.conf; 370 | 371 | server_name ultrafeeder.${NGINX_SERVER_LOCAL_DOMAIN}; 372 | 373 | location / { 374 | proxy_pass http://ultrafeeder-upstream/; 375 | } 376 | } 377 | 378 | server { 379 | include le-certs/nginx-server.conf; 380 | 381 | server_name flightradar24.${NGINX_SERVER_LOCAL_DOMAIN}; 382 | 383 | location / { 384 | proxy_pass http://flightradar24-upstream/; 385 | } 386 | } 387 | 388 | server { 389 | include le-certs/nginx-server.conf; 390 | 391 | server_name transmission.${NGINX_SERVER_LOCAL_DOMAIN}; 392 | 393 | location / { 394 | proxy_pass http://transmission-upstream/; 395 | } 396 | } 397 | 398 | server { 399 | include le-certs/nginx-server.conf; 400 | 401 | server_name jackett.${NGINX_SERVER_LOCAL_DOMAIN}; 402 | 403 | proxy_set_header X-Forwarded-Host $http_host; 404 | 405 | location / { 406 | proxy_pass http://jackett-upstream/; 407 | } 408 | } 409 | 410 | server { 411 | include le-certs/nginx-server.conf; 412 | 413 | server_name sonarr.${NGINX_SERVER_LOCAL_DOMAIN}; 414 | 415 | location / { 416 | proxy_pass http://sonarr-upstream/; 417 | } 418 | } 419 | 420 | server { 421 | include le-certs/nginx-server.conf; 422 | 423 | server_name radarr.${NGINX_SERVER_LOCAL_DOMAIN}; 424 | 425 | location / { 426 | proxy_pass http://radarr-upstream/; 427 | } 428 | } 429 | } 430 | -------------------------------------------------------------------------------- /nodered/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /pihole/etc-dnsmasq.d/01-pihole.conf: -------------------------------------------------------------------------------- 1 | # Pi-hole: A black hole for Internet advertisements 2 | # (c) 2017 Pi-hole, LLC (https://pi-hole.net) 3 | # Network-wide ad blocking via your own hardware. 4 | # 5 | # Dnsmasq config for Pi-hole's FTLDNS 6 | # 7 | # This file is copyright under the latest version of the EUPL. 8 | # Please see LICENSE file for your rights under this license. 9 | 10 | ############################################################################### 11 | # FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. # 12 | # ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE # 13 | # # 14 | # IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: # 15 | # /etc/pihole/setupVars.conf # 16 | # # 17 | # ANY OTHER CHANGES SHOULD BE MADE IN A SEPARATE CONFIG FILE # 18 | # WITHIN /etc/dnsmasq.d/yourname.conf # 19 | ############################################################################### 20 | 21 | addn-hosts=/etc/pihole/gravity.list 22 | addn-hosts=/etc/pihole/black.list 23 | addn-hosts=/etc/pihole/local.list 24 | 25 | 26 | localise-queries 27 | 28 | 29 | no-resolv 30 | 31 | 32 | 33 | cache-size=10000 34 | 35 | log-queries 36 | log-facility=/var/log/pihole.log 37 | 38 | local-ttl=2 39 | 40 | log-async 41 | server=10.0.0.2#5054 42 | domain-needed 43 | bogus-priv 44 | except-interface=nonexisting 45 | server=/use-application-dns.net/ 46 | -------------------------------------------------------------------------------- /pihole/etc-dnsmasq.d/02-custom-settings.conf: -------------------------------------------------------------------------------- 1 | #### EDIT SETTINGS 2 | dns-forward-max=5096 3 | min-cache-ttl=300 4 | rebind-domain-ok=/plex.direct/ 5 | server=/local.maialamas.com/192.168.40.1 6 | server=/168.192.in-addr.arpa/192.168.40.1 7 | server=/0.0.10.in-addr.arpa/127.0.0.11 8 | #### END EDIT 9 | -------------------------------------------------------------------------------- /pihole/etc-pihole/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !pihole-FTL.conf 4 | !setupVars.conf 5 | !whitelist.txt 6 | -------------------------------------------------------------------------------- /pihole/etc-pihole/pihole-FTL.conf: -------------------------------------------------------------------------------- 1 | DBINTERVAL=10 2 | MAXDBDAYS=60 3 | -------------------------------------------------------------------------------- /pihole/etc-pihole/setupVars.conf: -------------------------------------------------------------------------------- 1 | WEBPASSWORD=998ed4d621742d0c2d85ed84173db569afa194d4597686cae947324aa58ab4bb 2 | BLOCKING_ENABLED=true 3 | QUERY_LOGGING=true 4 | INSTALL_WEB_SERVER=true 5 | INSTALL_WEB_INTERFACE=true 6 | LIGHTTPD_ENABLED= 7 | IPV4_ADDRESS=0.0.0.0 8 | IPV6_ADDRESS= 9 | DNS_BOGUS_PRIV=true 10 | DNS_FQDN_REQUIRED=true 11 | DNSSEC=false 12 | CONDITIONAL_FORWARDING=false 13 | CONDITIONAL_FORWARDING_IP= 14 | CONDITIONAL_FORWARDING_DOMAIN= 15 | CONDITIONAL_FORWARDING_REVERSE= 16 | PIHOLE_DNS_1=10.0.0.2#5054 17 | PIHOLE_INTERFACE=eth0 18 | DNSMASQ_LISTENING=all 19 | -------------------------------------------------------------------------------- /pihole/etc-pihole/whitelist.txt: -------------------------------------------------------------------------------- 1 | xbox.ipv6.microsoft.com 2 | device.auth.xboxlive.com 3 | www.msftncsi.com 4 | title.mgt.xboxlive.com 5 | xsts.auth.xboxlive.com 6 | title.auth.xboxlive.com 7 | ctldl.windowsupdate.com 8 | attestation.xboxlive.com 9 | xboxexperiencesprod.experimentation.xboxlive.com 10 | xflight.xboxlive.com 11 | cert.mgt.xboxlive.com 12 | xkms.xboxlive.com 13 | def-vef.xboxlive.com 14 | notify.xboxlive.com 15 | help.ui.xboxlive.com 16 | licensing.xboxlive.com 17 | eds.xboxlive.com 18 | www.xboxlive.com 19 | v10.vortex-win.data.microsoft.com 20 | settings-win.data.microsoft.com 21 | clientconfig.passport.net 22 | v10.events.data.microsoft.com 23 | -------------------------------------------------------------------------------- /portainer/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /radarr/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /readsb/autogain/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /readsb/collectd/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sonarr/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /spoolman/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /transmission/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /ultrafeeder/globe_history/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /ultrafeeder/graphs1090/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /vscode/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /wireguard/config/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /zigbee2mqtt/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !configuration.yaml 4 | -------------------------------------------------------------------------------- /zigbee2mqtt/data/configuration.yaml: -------------------------------------------------------------------------------- 1 | homeassistant: 2 | enabled: true 3 | experimental_event_entities: true 4 | mqtt: 5 | base_topic: zigbee2mqtt 6 | server: mqtt://10.0.0.6 7 | user: '!secret user' 8 | password: '!secret password' 9 | serial: 10 | port: /dev/ttyUSB0 11 | adapter: zstack 12 | rtscts: false 13 | advanced: 14 | pan_id: 6752 15 | channel: 20 16 | network_key: '!secret network_key' 17 | log_level: warning 18 | log_output: 19 | - console 20 | frontend: 21 | enabled: true 22 | port: 8080 23 | availability: 24 | enabled: true 25 | device_options: {} 26 | devices: 27 | '0x00158d0002c12756': 28 | friendly_name: Master Bedroom Climate 29 | '0x00158d0002e935dd': 30 | friendly_name: Living Room Climate 31 | '0x000d6ffffec24c99': 32 | friendly_name: Kids Corner Smart Plug 33 | '0x00158d0002e20b09': 34 | friendly_name: Back Door 35 | '0x00158d0002bfc3fd': 36 | friendly_name: Front Door 37 | '0x00158d00031342a1': 38 | friendly_name: Front Door Mailbox 39 | '0x00158d0002581c83': 40 | friendly_name: Smart Switch 41 | '0x00158d0003130f12': 42 | friendly_name: Smart Vibration Sensor 43 | '0x00158d00025c0460': 44 | friendly_name: Kids Bedroom Climate 45 | '0x00158d000449f059': 46 | friendly_name: Lower Floor Climate 47 | '0x842e14fffe155397': 48 | friendly_name: Kids Corner Switch 49 | '0x0017880100e57ef4': 50 | friendly_name: Lamp 6 51 | '0x0017880100e58722': 52 | friendly_name: Lamp 5 53 | '0x14b457fffe156c68': 54 | friendly_name: Smart PIR Sensor 55 | '0x0017880100ebe30b': 56 | friendly_name: Lamp 4 57 | transition: 1 58 | '0xec1bbdfffe3dc3d7': 59 | friendly_name: Lower Floor Smart Plug 60 | '0xec1bbdfffe41a2ff': 61 | friendly_name: Master Bedroom Smart Plug 62 | '0xec1bbdfffe3f911d': 63 | friendly_name: Kids Bedroom Smart Plug 64 | '0xec1bbdfffe3bed9a': 65 | friendly_name: Washing Machine Smart Plug 66 | '0x001788010b1e94b6': 67 | friendly_name: Lamp 7 68 | '0x804b50fffef75f28': 69 | friendly_name: Sewing Corner Switch 70 | '0xd0cf5efffe311aa5': 71 | friendly_name: Lamp 3 72 | '0x1c34f1fffe7b1c6f': 73 | friendly_name: Lamp 2 74 | transition: 1 75 | '0x0017880100117838': 76 | friendly_name: Lamp 1 77 | '0x000d6ffffeda2b01': 78 | friendly_name: Laundry Room Smart Plug 79 | '0xec1bbdfffe41beea': 80 | friendly_name: Living Room Smart Plug 81 | '0x00158d000303ffbd': 82 | friendly_name: Laundry Room Climate 83 | '0xa4c1387ab28b0a44': 84 | friendly_name: Remote 1 85 | '0x001788010b1ef157': 86 | friendly_name: Lamp 8 87 | '0xa4c138e02863828f': 88 | friendly_name: Master Bedroom Ceiling Light 89 | homeassistant: 90 | switch: 91 | type: light 92 | object_id: light 93 | light: 94 | state_value_template: '{{ value_json.state }}' 95 | '0xa4c138f6add5ed0f': 96 | friendly_name: Kids Bedroom Ceiling Light 97 | homeassistant: 98 | switch: 99 | type: light 100 | object_id: light 101 | light: 102 | state_value_template: '{{ value_json.state }}' 103 | '0x086bd7fffe5ddeff': 104 | friendly_name: Kids Corner Dimmer 105 | '0xa4c1387e4ba155df': 106 | friendly_name: Lara bed light 107 | '0xa4c138700bc51466': 108 | friendly_name: Daniel Bed Light 109 | groups: 110 | '1': 111 | friendly_name: Kids Corner Group 112 | '2': 113 | friendly_name: Sewing Corner Group 114 | '3': 115 | friendly_name: Kids Beds Group 116 | version: 4 117 | -------------------------------------------------------------------------------- /zigbee2mqtt/homeassistant-extension/homeassistant.js: -------------------------------------------------------------------------------- 1 | const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters'); 2 | const settings = require('../util/settings'); 3 | const logger = require('../util/logger'); 4 | const zigbee2mqttVersion = require('../../package.json').version; 5 | const Extension = require('./extension'); 6 | const objectAssignDeep = require(`object-assign-deep`); 7 | 8 | const cfg = { 9 | // Binary sensor 10 | 'binary_sensor_occupancy': { 11 | type: 'binary_sensor', 12 | object_id: 'occupancy', 13 | discovery_payload: { 14 | payload_on: true, 15 | payload_off: false, 16 | value_template: '{{ value_json.occupancy }}', 17 | device_class: 'motion', 18 | }, 19 | }, 20 | 'binary_sensor_sos': { 21 | type: 'binary_sensor', 22 | object_id: 'sos', 23 | discovery_payload: { 24 | payload_on: true, 25 | payload_off: false, 26 | value_template: '{{ value_json.sos }}', 27 | }, 28 | }, 29 | 'binary_sensor_presence': { 30 | type: 'binary_sensor', 31 | object_id: 'presence', 32 | discovery_payload: { 33 | payload_on: true, 34 | payload_off: false, 35 | value_template: '{{ value_json.presence }}', 36 | device_class: 'presence', 37 | }, 38 | }, 39 | 'binary_sensor_tamper': { 40 | type: 'binary_sensor', 41 | object_id: 'tamper', 42 | discovery_payload: { 43 | payload_on: false, 44 | payload_off: true, 45 | value_template: '{{ value_json.tamper }}', 46 | }, 47 | }, 48 | 'binary_sensor_contact': { 49 | type: 'binary_sensor', 50 | object_id: 'contact', 51 | discovery_payload: { 52 | payload_on: false, 53 | payload_off: true, 54 | value_template: '{{ value_json.contact }}', 55 | device_class: 'door', 56 | }, 57 | }, 58 | 'binary_sensor_water_leak': { 59 | type: 'binary_sensor', 60 | object_id: 'water_leak', 61 | discovery_payload: { 62 | payload_on: true, 63 | payload_off: false, 64 | value_template: '{{ value_json.water_leak }}', 65 | device_class: 'moisture', 66 | }, 67 | }, 68 | 'binary_sensor_smoke': { 69 | type: 'binary_sensor', 70 | object_id: 'smoke', 71 | discovery_payload: { 72 | payload_on: true, 73 | payload_off: false, 74 | value_template: '{{ value_json.smoke }}', 75 | device_class: 'smoke', 76 | }, 77 | }, 78 | 'binary_sensor_gas': { 79 | type: 'binary_sensor', 80 | object_id: 'gas', 81 | discovery_payload: { 82 | payload_on: true, 83 | payload_off: false, 84 | value_template: '{{ value_json.gas }}', 85 | device_class: 'gas', 86 | }, 87 | }, 88 | 'binary_sensor_carbon_monoxide': { 89 | type: 'binary_sensor', 90 | object_id: 'carbon_monoxide', 91 | discovery_payload: { 92 | payload_on: true, 93 | payload_off: false, 94 | value_template: '{{ value_json.carbon_monoxide }}', 95 | device_class: 'safety', 96 | }, 97 | }, 98 | 'binary_sensor_led': { 99 | type: 'binary_sensor', 100 | object_id: 'led', 101 | discovery_payload: { 102 | payload_on: true, 103 | payload_off: false, 104 | value_template: '{{ value_json.led }}', 105 | device_class: 'light', 106 | }, 107 | }, 108 | 'binary_sensor_battery_low': { 109 | type: 'binary_sensor', 110 | object_id: 'battery_low', 111 | discovery_payload: { 112 | payload_on: true, 113 | payload_off: false, 114 | value_template: '{{ value_json.battery_low}}', 115 | device_class: 'battery', 116 | }, 117 | }, 118 | 'binary_sensor_update_available': { 119 | type: 'binary_sensor', 120 | object_id: 'update_available', 121 | discovery_payload: { 122 | payload_on: true, 123 | payload_off: false, 124 | value_template: '{{ value_json.update_available}}', 125 | }, 126 | }, 127 | 'binary_sensor_lock': { 128 | type: 'binary_sensor', 129 | object_id: 'lock', 130 | discovery_payload: { 131 | payload_on: 'UNLOCK', 132 | payload_off: 'LOCK', 133 | value_template: '{{ value_json.state}}', 134 | device_class: 'lock', 135 | }, 136 | }, 137 | 'binary_sensor_lock_reverse': { 138 | type: 'binary_sensor', 139 | object_id: 'lock_reverse', 140 | discovery_payload: { 141 | payload_on: 'UNLOCK', 142 | payload_off: 'LOCK', 143 | value_template: '{{ value_json.reverse}}', 144 | device_class: 'lock', 145 | }, 146 | }, 147 | 'binary_sensor_power_alarm_active': { 148 | type: 'binary_sensor', 149 | object_id: 'power_alarm_active', 150 | discovery_payload: { 151 | payload_on: true, 152 | payload_off: false, 153 | value_template: '{{ value_json.power_alarm_active}}', 154 | device_class: 'power', 155 | }, 156 | }, 157 | 158 | // Sensor 159 | 'sensor_illuminance': { 160 | type: 'sensor', 161 | object_id: 'illuminance', 162 | discovery_payload: { 163 | unit_of_measurement: '-', 164 | device_class: 'illuminance', 165 | value_template: '{{ value_json.illuminance }}', 166 | }, 167 | }, 168 | 'sensor_illuminance_lux_unit': { 169 | type: 'sensor', 170 | object_id: 'illuminance', 171 | discovery_payload: { 172 | unit_of_measurement: 'lx', 173 | device_class: 'illuminance', 174 | value_template: '{{ value_json.illuminance }}', 175 | }, 176 | }, 177 | 'sensor_illuminance_lux': { 178 | type: 'sensor', 179 | object_id: 'illuminance_lux', 180 | discovery_payload: { 181 | unit_of_measurement: 'lx', 182 | device_class: 'illuminance', 183 | value_template: '{{ value_json.illuminance_lux }}', 184 | }, 185 | }, 186 | 'sensor_humidity': { 187 | type: 'sensor', 188 | object_id: 'humidity', 189 | discovery_payload: { 190 | unit_of_measurement: '%', 191 | device_class: 'humidity', 192 | value_template: '{{ value_json.humidity }}', 193 | }, 194 | }, 195 | 'sensor_eco2': { 196 | type: 'sensor', 197 | object_id: 'eco2', 198 | discovery_payload: { 199 | unit_of_measurement: 'ppm', 200 | icon: 'mdi:air-filter', 201 | value_template: '{{ value_json.eco2 }}', 202 | }, 203 | }, 204 | 'sensor_voc': { 205 | type: 'sensor', 206 | object_id: 'voc', 207 | discovery_payload: { 208 | unit_of_measurement: 'ppb', 209 | icon: 'mdi:air-filter', 210 | value_template: '{{ value_json.voc }}', 211 | }, 212 | }, 213 | 'sensor_temperature': { 214 | type: 'sensor', 215 | object_id: 'temperature', 216 | discovery_payload: { 217 | unit_of_measurement: '°C', 218 | device_class: 'temperature', 219 | value_template: '{{ value_json.temperature }}', 220 | }, 221 | }, 222 | 'sensor_local_temperature': { 223 | type: 'sensor', 224 | object_id: 'local_temperature', 225 | discovery_payload: { 226 | unit_of_measurement: '°C', 227 | device_class: 'temperature', 228 | value_template: '{{ value_json.local_temperature }}', 229 | }, 230 | }, 231 | 'sensor_pressure': { 232 | type: 'sensor', 233 | object_id: 'pressure', 234 | discovery_payload: { 235 | unit_of_measurement: 'hPa', 236 | device_class: 'pressure', 237 | value_template: '{{ value_json.pressure }}', 238 | }, 239 | }, 240 | 'sensor_click': { 241 | type: 'sensor', 242 | object_id: 'click', 243 | discovery_payload: { 244 | icon: 'mdi:toggle-switch', 245 | value_template: '{{ value_json.click }}', 246 | }, 247 | }, 248 | 'sensor_power': { 249 | type: 'sensor', 250 | object_id: 'power', 251 | discovery_payload: { 252 | unit_of_measurement: 'W', 253 | icon: 'mdi:flash', 254 | value_template: '{{ value_json.power }}', 255 | }, 256 | }, 257 | 'sensor_current': { 258 | type: 'sensor', 259 | object_id: 'current', 260 | discovery_payload: { 261 | unit_of_measurement: 'A', 262 | icon: 'mdi:current-ac', 263 | value_template: '{{ value_json.current }}', 264 | }, 265 | }, 266 | 'sensor_voltage': { 267 | type: 'sensor', 268 | object_id: 'voltage', 269 | discovery_payload: { 270 | unit_of_measurement: 'V', 271 | icon: 'mdi:alpha-v', 272 | value_template: '{{ value_json.voltage }}', 273 | }, 274 | }, 275 | 'sensor_current_phase_b': { 276 | type: 'sensor', 277 | object_id: 'current_phase_b', 278 | discovery_payload: { 279 | unit_of_measurement: 'A', 280 | icon: 'mdi:current-ac', 281 | value_template: '{{ value_json.current_phase_b }}', 282 | }, 283 | }, 284 | 'sensor_voltage_phase_b': { 285 | type: 'sensor', 286 | object_id: 'voltage_phase_b', 287 | discovery_payload: { 288 | unit_of_measurement: 'V', 289 | icon: 'mdi:alpha-v', 290 | value_template: '{{ value_json.voltage_phase_b }}', 291 | }, 292 | }, 293 | 'sensor_current_phase_c': { 294 | type: 'sensor', 295 | object_id: 'current_phase_c', 296 | discovery_payload: { 297 | unit_of_measurement: 'A', 298 | icon: 'mdi:current-ac', 299 | value_template: '{{ value_json.current_phase_c }}', 300 | }, 301 | }, 302 | 'sensor_voltage_phase_c': { 303 | type: 'sensor', 304 | object_id: 'voltage_phase_c', 305 | discovery_payload: { 306 | unit_of_measurement: 'V', 307 | icon: 'mdi:alpha-v', 308 | value_template: '{{ value_json.voltage_phase_c }}', 309 | }, 310 | }, 311 | 'sensor_energy': { 312 | type: 'sensor', 313 | object_id: 'energy', 314 | discovery_payload: { 315 | unit_of_measurement: 'kWh', 316 | icon: 'mdi:power-plug', 317 | value_template: '{{ value_json.energy }}', 318 | }, 319 | }, 320 | 'sensor_action': { 321 | type: 'sensor', 322 | object_id: 'action', 323 | discovery_payload: { 324 | icon: 'mdi:gesture-double-tap', 325 | value_template: '{{ value_json.action }}', 326 | }, 327 | }, 328 | 'sensor_action_color': { 329 | type: 'sensor', 330 | object_id: 'action_color', 331 | discovery_payload: { 332 | value_template: '{{ value_json.action_color }}', 333 | icon: 'mdi:palette', 334 | }, 335 | }, 336 | 'sensor_action_color_temperature': { 337 | type: 'sensor', 338 | object_id: 'action_color_temperature', 339 | discovery_payload: { 340 | value_template: '{{ value_json.action_color_temperature }}', 341 | icon: 'hass:thermometer', 342 | }, 343 | }, 344 | 'sensor_brightness': { 345 | type: 'sensor', 346 | object_id: 'brightness', 347 | discovery_payload: { 348 | unit_of_measurement: 'brightness', 349 | icon: 'mdi:brightness-5', 350 | value_template: '{{ value_json.brightness }}', 351 | }, 352 | }, 353 | 'sensor_lock': { 354 | type: 'sensor', 355 | object_id: 'lock', 356 | discovery_payload: { 357 | icon: 'mdi:lock', 358 | value_template: '{{ value_json.inserted }}', 359 | }, 360 | }, 361 | 'sensor_battery': { 362 | type: 'sensor', 363 | object_id: 'battery', 364 | discovery_payload: { 365 | unit_of_measurement: '%', 366 | device_class: 'battery', 367 | value_template: '{{ value_json.battery }}', 368 | }, 369 | }, 370 | 'sensor_linkquality': { 371 | type: 'sensor', 372 | object_id: 'linkquality', 373 | discovery_payload: { 374 | icon: 'mdi:signal', 375 | unit_of_measurement: 'lqi', 376 | value_template: '{{ value_json.linkquality }}', 377 | }, 378 | }, 379 | 'sensor_gas_density': { 380 | type: 'sensor', 381 | object_id: 'gas_density', 382 | discovery_payload: { 383 | value_template: '{{ value_json.gas_density }}', 384 | icon: 'mdi:google-circles-communities', 385 | }, 386 | }, 387 | 'sensor_smoke_density': { 388 | type: 'sensor', 389 | object_id: 'smoke_density', 390 | discovery_payload: { 391 | value_template: '{{ value_json.smoke_density }}', 392 | icon: 'mdi:google-circles-communities', 393 | }, 394 | }, 395 | 'sensor_cover': { 396 | type: 'sensor', 397 | object_id: 'cover', 398 | discovery_payload: { 399 | value_template: '{{ value_json.position }}', 400 | icon: 'mdi:view-array', 401 | }, 402 | }, 403 | 'sensor_consumption': { 404 | type: 'sensor', 405 | object_id: 'consumption', 406 | discovery_payload: { 407 | unit_of_measurement: 'kWh', 408 | value_template: '{{ value_json.consumption }}', 409 | icon: 'mdi:flash', 410 | }, 411 | }, 412 | 'sensor_sensitivity': { 413 | type: 'sensor', 414 | object_id: 'sensitivity', 415 | discovery_payload: { 416 | value_template: '{{ value_json.sensitivity }}', 417 | icon: 'mdi:filter-variant', 418 | }, 419 | }, 420 | 'sensor_strength': { 421 | type: 'sensor', 422 | object_id: 'strength', 423 | discovery_payload: { 424 | value_template: '{{ value_json.strength }}', 425 | icon: 'mdi:weight', 426 | }, 427 | }, 428 | 'sensor_requested_brightness_level': { 429 | type: 'sensor', 430 | object_id: 'requested_brightness_level', 431 | discovery_payload: { 432 | value_template: '{{ value_json.requested_brightness_level }}', 433 | icon: 'mdi:brightness-5', 434 | }, 435 | }, 436 | 'sensor_requested_brightness_percent': { 437 | type: 'sensor', 438 | object_id: 'requested_brightness_percent', 439 | discovery_payload: { 440 | value_template: '{{ value_json.requested_brightness_percent }}', 441 | icon: 'mdi:brightness-5', 442 | }, 443 | }, 444 | 'sensor_radioactive_events_per_minute': { 445 | type: 'sensor', 446 | object_id: 'radioactive_events_per_minute', 447 | discovery_payload: { 448 | value_template: '{{ value_json.radioactive_events_per_minute }}', 449 | }, 450 | }, 451 | 'sensor_radiation_dose_per_hour': { 452 | type: 'sensor', 453 | object_id: 'radiation_dose_per_hour', 454 | discovery_payload: { 455 | value_template: '{{ value_json.radiation_dose_per_hour }}', 456 | }, 457 | }, 458 | 459 | // Light 460 | 'light_brightness_colortemp_colorxy': { 461 | type: 'light', 462 | object_id: 'light', 463 | discovery_payload: { 464 | brightness: true, 465 | color_temp: true, 466 | xy: true, 467 | schema: 'json', 468 | command_topic: true, 469 | brightness_scale: 254, 470 | }, 471 | }, 472 | 'light_brightness_colorxy': { 473 | type: 'light', 474 | object_id: 'light', 475 | discovery_payload: { 476 | brightness: true, 477 | xy: true, 478 | schema: 'json', 479 | command_topic: true, 480 | brightness_scale: 254, 481 | }, 482 | }, 483 | 'light_brightness_colortemp_colorhs': { 484 | type: 'light', 485 | object_id: 'light', 486 | discovery_payload: { 487 | brightness: true, 488 | color_temp: true, 489 | hs: true, 490 | schema: 'json', 491 | command_topic: true, 492 | brightness_scale: 254, 493 | }, 494 | }, 495 | 'light_brightness_colortemp': { 496 | type: 'light', 497 | object_id: 'light', 498 | discovery_payload: { 499 | brightness: true, 500 | color_temp: true, 501 | schema: 'json', 502 | command_topic: true, 503 | brightness_scale: 254, 504 | }, 505 | }, 506 | 'light_brightness': { 507 | type: 'light', 508 | object_id: 'light', 509 | discovery_payload: { 510 | brightness: true, 511 | schema: 'json', 512 | command_topic: true, 513 | brightness_scale: 254, 514 | }, 515 | }, 516 | 517 | // Switch 518 | 'switch': { 519 | type: 'switch', 520 | object_id: 'switch', 521 | discovery_payload: { 522 | payload_off: 'OFF', 523 | payload_on: 'ON', 524 | value_template: '{{ value_json.state }}', 525 | command_topic: true, 526 | }, 527 | }, 528 | 'switch_window_detection': { 529 | type: 'switch', 530 | object_id: 'window_detection', 531 | discovery_payload: { 532 | state_topic: true, 533 | command_topic: true, 534 | command_topic_postfix: 'window_detection', 535 | payload_off: 'OFF', 536 | payload_on: 'ON', 537 | state_off: 'OFF', 538 | state_on: 'ON', 539 | value_template: '{{ value_json.window_detection }}', 540 | icon: 'mdi:window-open-variant', 541 | }, 542 | }, 543 | 'switch_valve_detection': { 544 | type: 'switch', 545 | object_id: 'valve_detection', 546 | discovery_payload: { 547 | state_topic: true, 548 | command_topic: true, 549 | command_topic_postfix: 'valve_detection', 550 | payload_off: 'OFF', 551 | payload_on: 'ON', 552 | state_off: 'OFF', 553 | state_on: 'ON', 554 | value_template: '{{ value_json.valve_detection }}', 555 | }, 556 | }, 557 | 558 | // Cover 559 | 'cover': { 560 | type: 'cover', 561 | object_id: 'cover', 562 | discovery_payload: { 563 | command_topic: true, 564 | optimistic: true, 565 | }, 566 | }, 567 | 'cover_position': { 568 | type: 'cover', 569 | object_id: 'cover', 570 | discovery_payload: { 571 | command_topic: true, 572 | position_topic: true, 573 | set_position_topic: true, 574 | set_position_template: '{ "position": {{ position }} }', 575 | value_template: '{{ value_json.position }}', 576 | state_topic: false, 577 | }, 578 | }, 579 | 'cover_position_tilt': { 580 | type: 'cover', 581 | object_id: 'cover', 582 | discovery_payload: { 583 | state_topic: false, 584 | command_topic: true, 585 | set_position_topic: true, 586 | set_position_template: '{ "position": {{ position }} }', 587 | tilt_command_topic: true, 588 | position_topic: true, 589 | value_template: '{{ value_json.position }}', 590 | tilt_status_topic: true, 591 | tilt_status_template: '{{ value_json.tilt }}', 592 | }, 593 | }, 594 | 595 | // Lock 596 | 'lock': { 597 | type: 'lock', 598 | object_id: 'lock', 599 | discovery_payload: { 600 | command_topic: true, 601 | value_template: '{{ value_json.state }}', 602 | state_locked: 'LOCK', 603 | state_unlocked: 'UNLOCK', 604 | }, 605 | }, 606 | 'lock_keypad_lockout': { 607 | type: 'lock', 608 | object_id: 'keypad_lock', 609 | discovery_payload: { 610 | state_topic: true, 611 | command_topic: true, 612 | command_topic_postfix: 'keypad_lockout', 613 | payload_unlock: '0', 614 | payload_lock: '1', 615 | value_template: '{{ value_json.keypad_lockout }}', 616 | }, 617 | }, 618 | 'lock_child_lock': { 619 | type: 'lock', 620 | object_id: 'child_lock', 621 | discovery_payload: { 622 | state_topic: true, 623 | command_topic: true, 624 | command_topic_postfix: 'child_lock', 625 | payload_lock: 'LOCK', 626 | payload_unlock: 'UNLOCK', 627 | state_locked: 'LOCKED', 628 | state_unlocked: 'UNLOCKED', 629 | value_template: '{{ value_json.child_lock }}', 630 | }, 631 | }, 632 | 633 | // Fan 634 | 'fan': { 635 | type: 'fan', 636 | object_id: 'fan', 637 | discovery_payload: { 638 | state_topic: true, 639 | state_value_template: '{{ value_json.fan_state }}', 640 | command_topic: true, 641 | command_topic_postfix: 'fan_state', 642 | speed_state_topic: true, 643 | speed_command_topic: true, 644 | speed_value_template: '{{ value_json.fan_mode }}', 645 | speeds: ['off', 'low', 'medium', 'high', 'on', 'auto', 'smart'], 646 | }, 647 | }, 648 | 649 | // Trigger 650 | 'trigger_action': { 651 | type: 'device_automation', 652 | discovery_payload: { 653 | automation_type: 'trigger', 654 | type: 'action', 655 | }, 656 | }, 657 | 'trigger_click': { 658 | type: 'device_automation', 659 | discovery_payload: { 660 | automation_type: 'trigger', 661 | type: 'click', 662 | }, 663 | }, 664 | }; 665 | 666 | const switchEndpoint = (endpointName) => { 667 | return { 668 | type: 'switch', 669 | object_id: `switch_${endpointName}`, 670 | discovery_payload: { 671 | payload_off: 'OFF', 672 | payload_on: 'ON', 673 | value_template: `{{ value_json.state_${endpointName} }}`, 674 | command_topic: true, 675 | command_topic_prefix: endpointName, 676 | }, 677 | }; 678 | }; 679 | 680 | const lightEndpoint = (configType, endpointName) => { 681 | const config = objectAssignDeep.noMutate(cfg[configType]); 682 | config['object_id'] = `light_${endpointName}`; 683 | config['discovery_payload']['command_topic_prefix'] = endpointName; 684 | config['discovery_payload']['state_topic_postfix'] = endpointName; 685 | return config; 686 | }; 687 | 688 | const thermostat = (minTemp=7, maxTemp=30, temperatureStateProperty='occupied_heating_setpoint', tempStep=1) => { 689 | return { 690 | type: 'climate', 691 | object_id: 'climate', 692 | discovery_payload: { 693 | state_topic: false, 694 | min_temp: `${minTemp}`, 695 | max_temp: `${maxTemp}`, 696 | modes: ['off', 'auto', 'heat'], 697 | mode_state_topic: true, 698 | mode_state_template: '{{ value_json.system_mode }}', 699 | mode_command_topic: true, 700 | current_temperature_topic: true, 701 | current_temperature_template: '{{ value_json.local_temperature }}', 702 | temperature_state_topic: true, 703 | temperature_state_template: `{{ value_json.${temperatureStateProperty} }}`, 704 | temperature_command_topic: temperatureStateProperty, 705 | temp_step: tempStep, 706 | action_topic: true, 707 | action_template: 708 | '{% set values = {\'idle\':\'off\',\'heat\':\'heating\',\'cool\':\'cooling\',\'fan only\':\'fan\'}'+ 709 | ' %}{{ values[value_json.running_state] }}', 710 | }, 711 | }; 712 | }; 713 | 714 | const thermostatHeatCool = /* istanbul ignore next */ (minTemp=7, maxTemp=30, tempStep=0.5, opModes, fanModes=[]) => { 715 | return { 716 | type: 'climate', 717 | object_id: 'climate', 718 | discovery_payload: { 719 | state_topic: false, 720 | temperature_unit: 'C', 721 | min_temp: `${minTemp}`, 722 | max_temp: `${maxTemp}`, 723 | modes: opModes, 724 | mode_state_topic: true, 725 | mode_state_template: '{{ value_json.system_mode }}', 726 | mode_command_topic: true, 727 | current_temperature_topic: true, 728 | current_temperature_template: '{{ value_json.local_temperature }}', 729 | temperature_low_state_topic: true, 730 | temperature_low_state_template: `{{ value_json.occupied_heating_setpoint }}`, 731 | temperature_high_state_topic: true, 732 | temperature_high_state_template: `{{ value_json.occupied_cooling_setpoint }}`, 733 | temperature_low_command_topic: 'occupied_heating_setpoint', 734 | temperature_high_command_topic: 'occupied_cooling_setpoint', 735 | temp_step: tempStep, 736 | action_topic: true, 737 | action_template: 738 | '{% set values = {\'idle\':\'off\',\'heat\':\'heating\',\'cool\':\'cooling\',\'fan only\':\'fan\'}'+ 739 | ' %}{{ values[value_json.running_state] }}', 740 | fan_modes: fanModes, 741 | fan_mode_command_topic: true, 742 | fan_mode_state_topic: true, 743 | fan_mode_state_template: '{{ value_json.fan_mode }}', 744 | }, 745 | }; 746 | }; 747 | 748 | // Map Home Assistant configurations to devices. 749 | const mapping = { 750 | 'WXKG01LM': [cfg.sensor_click, cfg.sensor_battery], 751 | 'WXKG11LM': [cfg.sensor_click, cfg.sensor_battery, cfg.sensor_action], 752 | 'WXKG12LM': [cfg.sensor_click, cfg.sensor_battery, cfg.sensor_action], 753 | // DEPRECATED; BREAKING_IMPROVEMENT: only use sensor_click for WXKG03LM (action hold -> click hold) 754 | 'WXKG03LM': [cfg.sensor_click, cfg.sensor_battery, cfg.sensor_action], 755 | 'WXKG06LM': [cfg.sensor_battery, cfg.sensor_action], 756 | 'WXKG02LM': [cfg.sensor_click, cfg.sensor_battery], 757 | 'QBKG04LM': [cfg.switch, cfg.sensor_click, cfg.sensor_action], 758 | 'QBKG03LM': [switchEndpoint('left'), switchEndpoint('right'), cfg.sensor_click, cfg.sensor_temperature], 759 | 'WSDCGQ01LM': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 760 | 'WSDCGQ11LM': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_pressure, cfg.sensor_battery], 761 | 'RTCGQ01LM': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 762 | 'RTCGQ11LM': [cfg.binary_sensor_occupancy, cfg.sensor_illuminance_lux_unit, cfg.sensor_battery], 763 | 'MCCGQ01LM': [cfg.binary_sensor_contact, cfg.sensor_battery], 764 | 'MCCGQ11LM': [cfg.binary_sensor_contact, cfg.sensor_battery], 765 | 'SJCGQ11LM': [cfg.binary_sensor_water_leak, cfg.sensor_battery], 766 | 'MFKZQ01LM': [cfg.sensor_action, cfg.sensor_battery], 767 | 'ZNCZ02LM': [cfg.switch, cfg.sensor_power, cfg.sensor_temperature, cfg.sensor_consumption], 768 | 'QBCZ11LM': [cfg.switch, cfg.sensor_power], 769 | 'LED1545G12': [cfg.light_brightness_colortemp], 770 | 'LED1623G12': [cfg.light_brightness], 771 | 'LED1622G12': [cfg.light_brightness], 772 | 'LED1537R6/LED1739R5': [cfg.light_brightness_colortemp], 773 | 'LED1650R5': [cfg.light_brightness], 774 | 'LED1536G5': [cfg.light_brightness_colortemp], 775 | '7299760PH': [cfg.light_brightness_colorxy], 776 | '7146060PH': [cfg.light_brightness_colortemp_colorxy], 777 | '7602031P7': [cfg.light_brightness_colortemp_colorxy], 778 | '046677476816': [cfg.light_brightness], 779 | 'F7C033': [cfg.light_brightness], 780 | 'JTYJ-GD-01LM/BW': [cfg.binary_sensor_smoke, cfg.sensor_battery, cfg.sensor_sensitivity, cfg.sensor_smoke_density], 781 | 'PLUG EDP RE:DY': [cfg.switch, cfg.sensor_power], 782 | 'SWITCH EDP RE:DY': [cfg.switch], 783 | 'CC2530.ROUTER': [cfg.binary_sensor_led], 784 | 'AA70155': [cfg.light_brightness_colortemp], 785 | 'A9A19A60WESDZ02': [cfg.light_brightness_colortemp], 786 | 'A9BR3065WESDZ02': [cfg.light_brightness_colortemp], 787 | '4058075816718': [cfg.light_brightness_colortemp_colorxy], 788 | 'AA69697': [cfg.light_brightness_colortemp_colorxy], 789 | 'HALIGHTDIMWWE27': [cfg.light_brightness], 790 | 'HALIGHTDIMWWB22': [cfg.light_brightness], 791 | 'AB3257001NJ': [cfg.switch], 792 | 'AC10691': [cfg.switch], 793 | '8718696449691': [cfg.light_brightness], 794 | 'RB 185 C': [cfg.light_brightness_colortemp_colorxy], 795 | 'BY 185 C': [cfg.light_brightness_colortemp_colorxy], 796 | '9290012573A': [cfg.light_brightness_colortemp_colorxy], 797 | 'LED1624G9': [cfg.light_brightness_colorxy], 798 | 'LED1837R5': [cfg.light_brightness], 799 | '73742': [cfg.light_brightness_colortemp], 800 | '73740': [cfg.light_brightness_colortemp], 801 | '73739': [cfg.light_brightness_colortemp_colorxy], 802 | '72569': [cfg.light_brightness_colortemp], 803 | '72567': [cfg.light_brightness_colortemp], 804 | '75541': [cfg.light_brightness_colortemp_colorxy], 805 | '22670': [cfg.light_brightness], 806 | 'ICTC-G-1': [cfg.sensor_brightness, cfg.sensor_battery, cfg.sensor_action], 807 | 'ICPSHC24-30EU-IL-1': [cfg.light_brightness], 808 | '45852GE': [cfg.light_brightness], 809 | 'E11-G13': [cfg.light_brightness], 810 | 'LED1649C5': [cfg.light_brightness], 811 | 'ICPSHC24-10EU-IL-1': [cfg.light_brightness], 812 | 'LED1546G12': [cfg.light_brightness_colortemp], 813 | 'L1527': [cfg.light_brightness_colortemp], 814 | 'L1529': [cfg.light_brightness_colortemp], 815 | 'L1528': [cfg.light_brightness_colortemp], 816 | 'L1531': [cfg.light_brightness_colortemp], 817 | 'RB 165': [cfg.light_brightness], 818 | 'RB 175 W': [cfg.light_brightness], 819 | 'RS 125': [cfg.light_brightness], 820 | 'RS 225': [cfg.light_brightness], 821 | 'RB 145': [cfg.light_brightness], 822 | 'RB 245': [cfg.light_brightness], 823 | 'PL 110': [cfg.light_brightness], 824 | 'ST 110': [cfg.light_brightness], 825 | 'UC 110': [cfg.light_brightness], 826 | 'DL 110 N': [cfg.light_brightness], 827 | 'DL 110 W': [cfg.light_brightness], 828 | 'SL 110 N': [cfg.light_brightness], 829 | 'SL 110 M': [cfg.light_brightness], 830 | 'SL 110 W': [cfg.light_brightness], 831 | 'AE 260': [cfg.light_brightness], 832 | 'AA68199': [cfg.light_brightness_colortemp], 833 | 'QBKG11LM': [cfg.switch, cfg.sensor_power, cfg.sensor_click, cfg.sensor_temperature], 834 | 'QBKG21LM': [cfg.switch, cfg.sensor_click, cfg.sensor_action], 835 | 'QBKG22LM': [cfg.switch, cfg.sensor_click, cfg.sensor_temperature], 836 | 'QBKG12LM': [ 837 | switchEndpoint('left'), switchEndpoint('right'), cfg.sensor_power, cfg.sensor_click, 838 | cfg.sensor_temperature, 839 | ], 840 | 'K2RGBW01': [cfg.light_brightness_colortemp_colorxy], 841 | '9290011370': [cfg.light_brightness], 842 | 'Z809A': [cfg.switch, cfg.sensor_power], 843 | 'NL08-0800': [cfg.light_brightness], 844 | '98425031': [cfg.light_brightness], 845 | '915005106701': [cfg.light_brightness_colortemp_colorxy], 846 | 'Aj_Zigbee_Led_Strip': [cfg.light_brightness_colortemp_colorxy], 847 | 'AB32840': [cfg.light_brightness_colortemp], 848 | '8718696485880': [cfg.light_brightness_colortemp_colorxy], 849 | '8718696598283': [cfg.light_brightness_colortemp], 850 | '8718696695203': [cfg.light_brightness_colortemp], 851 | '73693': [cfg.light_brightness_colortemp_colorxy], 852 | '324131092621': [cfg.sensor_action, cfg.sensor_battery], 853 | '9290012607': [ 854 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, cfg.sensor_illuminance, cfg.sensor_illuminance_lux, 855 | cfg.sensor_battery, 856 | ], 857 | 'GL-C-008-1ID': [cfg.light_brightness_colortemp_colorxy], 858 | 'GL-C-009': [cfg.light_brightness], 859 | 'STSS-MULT-001': [cfg.binary_sensor_contact, cfg.sensor_battery], 860 | 'E11-G23/E11-G33': [cfg.light_brightness], 861 | 'E11-N13/E11-N13A/E11-N14/E11-N14A': [cfg.light_brightness], 862 | 'E1ACA4ABE38A': [cfg.light_brightness], 863 | 'AC03645': [cfg.light_brightness_colortemp_colorhs], 864 | 'AC03641': [cfg.light_brightness], 865 | 'AC03648': [cfg.light_brightness_colortemp], 866 | 'FB56+ZSW05HG1.2': [cfg.switch], 867 | '72922-A': [cfg.switch], 868 | 'AC03642': [cfg.light_brightness_colortemp], 869 | 'AC08560': [cfg.light_brightness], 870 | 'AC10786-DIM': [cfg.light_brightness], 871 | 'DNCKATSD001': [cfg.light_brightness], 872 | 'DNCKATSW001': [cfg.switch], 873 | 'DNCKATSW002': [switchEndpoint('left'), switchEndpoint('right')], 874 | 'DNCKATSW003': [switchEndpoint('left'), switchEndpoint('right'), switchEndpoint('center')], 875 | 'DNCKATSW004': [ 876 | switchEndpoint('bottom_left'), switchEndpoint('bottom_right'), 877 | switchEndpoint('top_left'), switchEndpoint('top_right'), 878 | ], 879 | 'BY 165': [cfg.light_brightness], 880 | 'ZLED-2709': [cfg.light_brightness], 881 | '8718696548738': [cfg.light_brightness_colortemp], 882 | '915005587401': [cfg.light_brightness_colortemp], 883 | '3435011P7': [cfg.light_brightness_colortemp], 884 | '4052899926110': [cfg.light_brightness_colortemp_colorxy], 885 | 'Z01-CIA19NAE26': [cfg.light_brightness], 886 | 'E11-N1EA': [cfg.light_brightness_colortemp_colorxy], 887 | 'E11-U2E': [cfg.light_brightness_colortemp_colorxy], 888 | '74283': [cfg.light_brightness], 889 | 'JTQJ-BF-01LM/BW': [cfg.binary_sensor_gas, cfg.sensor_gas_density, cfg.sensor_sensitivity], 890 | '50043': [cfg.switch], 891 | '50044/50045': [cfg.light_brightness], 892 | 'AV2010/22': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 893 | '3210-L': [cfg.switch, cfg.sensor_power, cfg.sensor_current, cfg.sensor_voltage], 894 | '3320-L': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 895 | '3326-L': [cfg.binary_sensor_occupancy, cfg.sensor_temperature, cfg.sensor_battery], 896 | '7299355PH': [cfg.light_brightness_colorxy], 897 | '45857GE': [cfg.light_brightness], 898 | 'A6121': [cfg.sensor_lock], 899 | '433714': [cfg.light_brightness_colortemp], 900 | '3261030P7': [cfg.light_brightness_colortemp], 901 | '3216431P5': [cfg.light_brightness_colortemp], 902 | 'DJT11LM': [cfg.sensor_action, cfg.sensor_battery, cfg.sensor_sensitivity, cfg.sensor_strength], 903 | 'E1603/E1702': [cfg.switch], 904 | '7199960PH': [cfg.light_brightness_colorxy], 905 | '74696': [cfg.light_brightness], 906 | 'AB35996': [cfg.light_brightness_colortemp_colorxy], 907 | 'AB401130055': [cfg.light_brightness_colortemp], 908 | '74282': [cfg.light_brightness_colortemp], 909 | 'RS 128 T': [cfg.light_brightness_colortemp], 910 | '53170161': [cfg.light_brightness_colortemp], 911 | '4058075036147': [cfg.light_brightness_colortemp_colorxy], 912 | 'KS-SM001': [cfg.switch], 913 | 'MG-AUWS01': [switchEndpoint('left'), switchEndpoint('right')], 914 | '9290002579A': [cfg.light_brightness_colortemp_colorxy], 915 | '4256251-RZHAC': [cfg.switch, cfg.sensor_power], 916 | '4257050-ZHAC': [cfg.light_brightness, cfg.sensor_power, cfg.sensor_current, cfg.sensor_voltage], 917 | 'STS-PRS-251': [cfg.binary_sensor_presence, cfg.sensor_battery], 918 | '4058075816794': [cfg.light_brightness_colortemp], 919 | '4052899926158': [cfg.light_brightness], 920 | '4058075036185': [cfg.light_brightness_colortemp_colorxy], 921 | '50049': [cfg.light_brightness_colortemp_colorxy], 922 | '915005733701': [cfg.light_brightness_colortemp_colorxy], 923 | 'RB 285 C': [cfg.light_brightness_colortemp_colorxy], 924 | '3216331P5': [cfg.light_brightness_colortemp], 925 | 'AC08562': [cfg.light_brightness], 926 | '900008-WW': [cfg.light_brightness], 927 | 'Mega23M12': [lightEndpoint('light_brightness_colortemp_colorxy', 'rgb'), 928 | lightEndpoint('light_brightness', 'white')], 929 | 'PSS-23ZBS': [cfg.switch], 930 | 'HS1SA-M': [cfg.binary_sensor_smoke, cfg.binary_sensor_battery_low], 931 | 'Z01-A19NAE26': [cfg.light_brightness_colortemp], 932 | 'Z01-A60EAE27': [cfg.light_brightness_colortemp], 933 | 'AC01353010G': [ 934 | cfg.binary_sensor_occupancy, cfg.binary_sensor_tamper, 935 | cfg.sensor_temperature, cfg.binary_sensor_battery_low, 936 | ], 937 | 'SP 120': [cfg.switch, cfg.sensor_power], 938 | 'SP 222': [cfg.switch], 939 | 'RB 248 T': [cfg.light_brightness_colortemp], 940 | 'HS3SA': [cfg.binary_sensor_smoke, cfg.binary_sensor_battery_low], 941 | 'HS1DS/HS3DS': [cfg.binary_sensor_contact], 942 | 'HS1WL/HS3WL': [cfg.binary_sensor_water_leak], 943 | 'HS1-WL-E': [cfg.binary_sensor_water_leak], 944 | '421786': [cfg.light_brightness], 945 | 'ICZB-IW11D': [cfg.light_brightness], 946 | '3321-S': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 947 | 'ZPIR-8000': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 948 | 'ZCTS-808': [cfg.binary_sensor_contact, cfg.sensor_battery], 949 | 'ZNLDP12LM': [cfg.light_brightness_colortemp], 950 | 'XDD12LM': [cfg.light_brightness_colortemp], 951 | 'D1821': [cfg.light_brightness_colortemp_colorxy], 952 | 'ZNCLDJ11LM': [cfg.cover_position, cfg.sensor_cover], 953 | 'TS0601': [cfg.cover_position], 954 | 'LTFY004': [cfg.light_brightness_colorxy], 955 | 'GL-S-007Z': [cfg.light_brightness_colortemp_colorxy], 956 | '3325-S': [cfg.sensor_temperature, cfg.binary_sensor_occupancy], 957 | '4713407': [cfg.light_brightness], 958 | '464800': [cfg.light_brightness_colortemp], 959 | '3261331P7': [cfg.light_brightness_colortemp], 960 | '4033930P7': [cfg.light_brightness_colortemp], 961 | '4023330P7': [cfg.light_brightness_colortemp], 962 | 'GL-B-008Z': [cfg.light_brightness_colortemp_colorxy], 963 | 'AV2010/25': [cfg.switch, cfg.sensor_power], 964 | 'E12-N14': [cfg.light_brightness], 965 | '1TST-EU': [thermostat(), cfg.sensor_battery], 966 | 'RB 178 T': [cfg.light_brightness_colortemp], 967 | '45856GE': [cfg.switch], 968 | 'GL-D-003Z': [cfg.light_brightness_colortemp_colorxy], 969 | 'GL-D-005Z': [cfg.light_brightness_colortemp_colorxy], 970 | 'GD-CZ-006': [cfg.light_brightness], 971 | 'AIRAM-CTR.U': [], 972 | 'HGZB-20-DE': [cfg.switch], 973 | 'D1531': [cfg.light_brightness], 974 | 'D1532': [cfg.light_brightness], 975 | 'D1533': [cfg.light_brightness], 976 | 'AV2010/32': [thermostat(7, 30, 'occupied_heating_setpoint', 0.5), cfg.sensor_battery], 977 | 'HGZB-07A': [cfg.light_brightness_colortemp_colorxy], 978 | 'E1524/E1810': [cfg.sensor_action, cfg.sensor_battery], 979 | 'GL-C-006': [cfg.light_brightness_colortemp], 980 | 'GL-C-007-1ID': [cfg.light_brightness_colortemp_colorxy], 981 | 'GL-C-007-2ID': [lightEndpoint('light_brightness_colortemp_colorxy', 'rgb'), 982 | lightEndpoint('light_brightness', 'white')], 983 | 'GL-C-008-2ID': [lightEndpoint('light_brightness_colorxy', 'rgb'), 984 | lightEndpoint('light_brightness_colortemp', 'cct')], 985 | 'GL-C-007S': [cfg.light_brightness_colorxy], 986 | '100.424.11': [cfg.light_brightness_colortemp], 987 | 'AC0251100NJ/AC0251700NJ': [cfg.sensor_action, cfg.sensor_battery], 988 | '71831': [cfg.light_brightness_colortemp], 989 | '404000/404005/404012': [cfg.light_brightness_colortemp_colorxy], 990 | '44435': [cfg.light_brightness_colortemp_colorxy], 991 | '404006/404008/404004': [cfg.light_brightness_colortemp], 992 | 'MLI-404011': [cfg.sensor_action], 993 | 'GL-S-003Z': [cfg.light_brightness_colorxy], 994 | 'GL-S-005Z': [cfg.light_brightness_colortemp_colorxy], 995 | 'HS1DS-E': [cfg.binary_sensor_contact], 996 | 'SP600': [cfg.switch, cfg.sensor_power, cfg.sensor_energy], 997 | '1613V': [cfg.switch, cfg.sensor_power], 998 | 'XVV-Mega23M12': [cfg.light_brightness_colortemp], 999 | 'GL-B-007Z': [cfg.light_brightness_colortemp_colorxy], 1000 | '81809': [cfg.light_brightness_colortemp_colorxy], 1001 | '4090130P7': [cfg.light_brightness_colortemp_colorxy], 1002 | '100.110.39': [cfg.light_brightness_colortemp_colorxy], 1003 | 'TI0001': [switchEndpoint('left'), switchEndpoint('right')], 1004 | 'SPZB0001': [thermostat(5, 30, 'current_heating_setpoint', 0.5), cfg.sensor_battery], 1005 | 'HS3CG': [cfg.binary_sensor_gas], 1006 | '81825': [cfg.sensor_action], 1007 | 'Z809AF': [cfg.switch, cfg.sensor_power], 1008 | 'RADON TriTech ZB': [ 1009 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, cfg.sensor_battery, cfg.binary_sensor_battery_low, 1010 | ], 1011 | '07005B': [cfg.light_brightness], 1012 | '07004D': [cfg.light_brightness_colortemp_colorxy], 1013 | '07008L': [cfg.light_brightness_colortemp_colorxy], 1014 | 'E1746': [], 1015 | 'LED1836G9': [cfg.light_brightness], 1016 | 'YRD426NRSC': [cfg.lock, cfg.sensor_battery], 1017 | 'BE468': [cfg.lock, cfg.sensor_battery], 1018 | 'YRD246HA20BP': [cfg.lock, cfg.sensor_battery], 1019 | 'E1743': [cfg.sensor_click, cfg.sensor_battery], 1020 | 'LED1732G11': [cfg.light_brightness_colortemp], 1021 | 'LED1736G9': [cfg.light_brightness_colortemp], 1022 | 'RB 265': [cfg.light_brightness], 1023 | '9290019758': [ 1024 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1025 | cfg.sensor_illuminance, cfg.sensor_illuminance_lux, cfg.sensor_battery, 1026 | ], 1027 | 'HGZB-042': [switchEndpoint('top'), switchEndpoint('bottom')], 1028 | 'HGZB-42': [switchEndpoint('top'), switchEndpoint('bottom')], 1029 | 'GL-FL-004TZ': [cfg.light_brightness_colortemp_colorxy], 1030 | 'GL-FL-004TZS': [cfg.light_brightness_colortemp_colorxy], 1031 | 'IM6001-OTP05': [cfg.switch], 1032 | 'SV01': [ 1033 | cfg.cover_position, cfg.sensor_temperature, cfg.sensor_pressure, 1034 | cfg.sensor_battery, 1035 | ], 1036 | 'SV02': [ 1037 | cfg.cover_position, cfg.sensor_temperature, cfg.sensor_pressure, 1038 | cfg.sensor_battery, 1039 | ], 1040 | '316GLEDRF': [cfg.light_brightness], 1041 | 'LVS-ZB500D': [cfg.light_brightness], 1042 | 'ST218': [ 1043 | thermostat(5, 30, 'occupied_heating_setpoint', 0.5), 1044 | cfg.sensor_local_temperature, 1045 | cfg.lock_keypad_lockout, 1046 | ], 1047 | 'E1525/E1745': [ 1048 | cfg.binary_sensor_occupancy, cfg.sensor_battery, cfg.sensor_requested_brightness_level, 1049 | cfg.sensor_requested_brightness_percent, 1050 | ], 1051 | 'ZYCT-202': [cfg.sensor_action], 1052 | 'GR-ZB01-W': [cfg.cover_position], 1053 | '4090531P7': [cfg.light_brightness_colortemp_colorxy], 1054 | 'HGZB-42-UK / HGZB-41 / HGZB-41-UK': [cfg.switch], 1055 | 'ISW-ZPR1-WP13': [ 1056 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1057 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1058 | ], 1059 | '9290018195': [cfg.light_brightness], 1060 | 'HGZB-04D / HGZB-4D-UK': [cfg.light_brightness], 1061 | 'HGZB-043': [switchEndpoint('top'), switchEndpoint('bottom'), switchEndpoint('center')], 1062 | 'HGZB-44': [ 1063 | switchEndpoint('top_left'), switchEndpoint('top_right'), switchEndpoint('bottom_left'), 1064 | switchEndpoint('bottom_right'), 1065 | ], 1066 | 'NCZ-3043-HA': [ 1067 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1068 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1069 | ], 1070 | 'NCZ-3041-HA': [ 1071 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1072 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1073 | ], 1074 | 'NCZ-3045-HA': [ 1075 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1076 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1077 | ], 1078 | 'STS-IRM-250': [ 1079 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1080 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1081 | ], 1082 | '3305-S': [ 1083 | cfg.binary_sensor_occupancy, cfg.sensor_temperature, 1084 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1085 | ], 1086 | '3300-S': [ 1087 | cfg.sensor_temperature, cfg.binary_sensor_contact, 1088 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1089 | ], 1090 | 'IM6001-BTP01': [cfg.sensor_click, cfg.sensor_temperature, cfg.sensor_battery], 1091 | 'AV2010/34': [cfg.sensor_click], 1092 | 'PP-WHT-US': [ 1093 | cfg.switch, cfg.sensor_power, 1094 | cfg.sensor_current, cfg.sensor_voltage, 1095 | ], 1096 | 'CR701-YZ': [ 1097 | cfg.binary_sensor_battery_low, cfg.binary_sensor_carbon_monoxide, 1098 | cfg.binary_sensor_gas, 1099 | ], 1100 | 'HGZB-1S': [cfg.switch, cfg.sensor_click], 1101 | 'HGZB-045': [cfg.switch, cfg.sensor_click], 1102 | 'HGZB-43': [switchEndpoint('top'), switchEndpoint('bottom'), switchEndpoint('center')], 1103 | 'HGZB-01A': [cfg.switch], 1104 | 'HGZB-02A': [cfg.light_brightness], 1105 | 'MCT-350 SMA': [cfg.binary_sensor_contact], 1106 | '3310-S': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1107 | 'IM6001-WLP01': [ 1108 | cfg.sensor_temperature, cfg.binary_sensor_water_leak, 1109 | cfg.sensor_battery, 1110 | ], 1111 | 'WTR-UK-V2': [ 1112 | cfg.sensor_temperature, cfg.binary_sensor_water_leak, 1113 | cfg.sensor_battery, 1114 | ], 1115 | '3315-S': [ 1116 | cfg.sensor_temperature, cfg.binary_sensor_water_leak, 1117 | cfg.sensor_battery, 1118 | ], 1119 | 'F-MLT-US-2': [ 1120 | cfg.sensor_temperature, cfg.binary_sensor_contact, 1121 | cfg.sensor_battery, cfg.binary_sensor_battery_low, 1122 | ], 1123 | 'SWO-KEF1PA': [cfg.sensor_action], 1124 | 'HGZB-02S': [cfg.sensor_click, cfg.switch], 1125 | 'HGZB-41': [cfg.switch], 1126 | 'ZG9101SAC-HP': [cfg.light_brightness], 1127 | 'RS 122': [cfg.light_brightness], 1128 | 'GL-B-001Z': [cfg.light_brightness_colortemp_colorxy], 1129 | 'IM6001-MTP01': [cfg.sensor_temperature, cfg.sensor_battery, cfg.binary_sensor_occupancy], 1130 | 'U86K31ND6': [switchEndpoint('left'), switchEndpoint('right'), switchEndpoint('center')], 1131 | 'HLD812-Z-SC': [cfg.light_brightness], 1132 | 'HLC610-Z': [cfg.light_brightness], 1133 | 'BY 285 C': [cfg.light_brightness_colortemp_colorxy], 1134 | 'HS1RC-M': [cfg.sensor_action, cfg.sensor_battery], 1135 | 'SWO-WDS1PA': [cfg.binary_sensor_contact], 1136 | 'LLKZMK11LM': [ 1137 | switchEndpoint('l1'), switchEndpoint('l2'), 1138 | cfg.sensor_power, cfg.sensor_temperature, cfg.sensor_consumption, 1139 | ], 1140 | 'T18W3Z': [switchEndpoint('l1'), switchEndpoint('l2'), switchEndpoint('l3')], 1141 | 'LVS-SM10ZW': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1142 | 'HS2SK': [cfg.switch, cfg.sensor_power], 1143 | '45853GE': [cfg.switch, cfg.sensor_power], 1144 | '50064': [cfg.light_brightness_colortemp], 1145 | '9290011998B': [cfg.light_brightness_colortemp], 1146 | '9290022167': [cfg.light_brightness_colortemp], 1147 | '4096730U7': [cfg.light_brightness_colortemp], 1148 | 'RB 278 T': [cfg.light_brightness_colortemp], 1149 | '3315-G': [ 1150 | cfg.sensor_temperature, cfg.sensor_battery, cfg.binary_sensor_water_leak, 1151 | ], 1152 | 'N2G-SP': [cfg.sensor_power, cfg.switch], 1153 | 'AC0363900NJ': [cfg.light_brightness_colortemp_colorxy], 1154 | 'LXZB-02A': [cfg.light_brightness], 1155 | 'GL-S-004Z': [cfg.light_brightness_colortemp], 1156 | 'SCM-5ZBS': [cfg.cover_position], 1157 | 'YRD226HA2619': [cfg.sensor_battery, cfg.lock], 1158 | 'YMF40/YDM4109+': [cfg.lock, cfg.sensor_battery], 1159 | 'V3-BTZB': [cfg.lock, cfg.sensor_battery], 1160 | '3RSS008Z': [cfg.switch, cfg.sensor_battery], 1161 | '3RSS007Z': [cfg.switch], 1162 | '99432': [cfg.fan, cfg.light_brightness], 1163 | '511.10': [cfg.light_brightness], 1164 | 'IM6001-MPP01': [ 1165 | cfg.sensor_temperature, cfg.binary_sensor_contact, cfg.sensor_battery, 1166 | ], 1167 | 'HLC821-Z-SC': [cfg.light_brightness], 1168 | 'RS 228 T': [cfg.light_brightness_colortemp], 1169 | 'RS 229 T': [cfg.light_brightness_colortemp], 1170 | '67200BL': [cfg.switch], 1171 | 'InstaRemote': [cfg.sensor_action], 1172 | '100.425.90': [cfg.switch], 1173 | '74580': [cfg.light_brightness], 1174 | 'HS1CA-E': [ 1175 | cfg.binary_sensor_carbon_monoxide, cfg.binary_sensor_battery_low, 1176 | cfg.sensor_battery, 1177 | ], 1178 | 'MCT-340 E': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 1179 | 'MCT-340 SMA': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 1180 | 'D1542': [cfg.light_brightness_colortemp], 1181 | 'ZGRC-KEY-013': [cfg.sensor_click], 1182 | 'ZigUP': [cfg.switch], 1183 | 'YRD256HA20BP': [cfg.sensor_battery, cfg.lock], 1184 | 'SZ-ESW01-AU': [cfg.sensor_power, cfg.switch], 1185 | 'PSM-29ZBSR': [cfg.switch, cfg.sensor_power], 1186 | 'ZM350STW1TCF': [cfg.light_brightness_colortemp], 1187 | 'M350STW1': [cfg.light_brightness], 1188 | 'A806S-Q1R': [cfg.light_brightness], 1189 | 'XY12S-15': [cfg.light_brightness_colortemp_colorxy], 1190 | 'B07KG5KF5R': [cfg.light_brightness_colortemp], 1191 | 'SCM-S1': [cfg.cover_position], 1192 | 'HEIMAN-M1': [cfg.binary_sensor_contact], 1193 | '3216131P5': [cfg.light_brightness_colortemp], 1194 | 'ST8AU-CON': [cfg.light_brightness], 1195 | 'HS3MS': [cfg.binary_sensor_occupancy], 1196 | 'DIYRUZ_R4_5': [ 1197 | switchEndpoint('bottom_left'), switchEndpoint('bottom_right'), switchEndpoint('center'), 1198 | switchEndpoint('top_left'), switchEndpoint('top_right'), 1199 | ], 1200 | 'NCZ-3011-HA': [cfg.binary_sensor_contact, cfg.sensor_battery], 1201 | 'MEAZON_BIZY_PLUG': [cfg.sensor_power, cfg.switch, cfg.sensor_temperature], 1202 | 'MEAZON_DINRAIL': [cfg.sensor_power, cfg.switch, cfg.sensor_temperature], 1203 | 'HS1CA-M': [cfg.binary_sensor_carbon_monoxide, cfg.binary_sensor_battery_low], 1204 | '7099860PH': [cfg.light_brightness_colorxy], 1205 | 'HV-GSCXZB269': [cfg.light_brightness_colortemp], 1206 | '3216231P5': [cfg.light_brightness_colortemp], 1207 | 'AC03647': [cfg.light_brightness_colortemp_colorhs], 1208 | '12031': [cfg.cover_position], 1209 | 'LS12128': [cfg.cover_position], 1210 | '421792': [cfg.light_brightness_colortemp_colorxy], 1211 | 'HGZB-06A': [cfg.light_brightness_colortemp_colorxy], 1212 | 'LED1733G7': [cfg.light_brightness_colortemp], 1213 | '9290011370B': [cfg.light_brightness], 1214 | 'RB 250 C': [cfg.light_brightness_colortemp_colorxy], 1215 | '8718696170625': [cfg.light_brightness], 1216 | 'GL-G-001Z': [cfg.light_brightness_colortemp_colorxy], 1217 | 'HV-GSCXZB279_HV-GSCXZB229': [cfg.light_brightness_colortemp], 1218 | 'HS2WD-E': [cfg.sensor_battery], 1219 | 'ZNMS12LM': [ 1220 | cfg.sensor_action, cfg.binary_sensor_lock, cfg.binary_sensor_lock_reverse, 1221 | ], 1222 | 'ZNMS13LM': [ 1223 | cfg.sensor_action, cfg.binary_sensor_lock, cfg.binary_sensor_lock_reverse, 1224 | ], 1225 | 'ZNMS11LM': [ 1226 | cfg.sensor_action, cfg.binary_sensor_lock, cfg.binary_sensor_lock_reverse, 1227 | ], 1228 | '12050': [cfg.switch, cfg.sensor_power], 1229 | 'ROB_200-004-0': [cfg.light_brightness], 1230 | '4512700': [cfg.light_brightness], 1231 | 'RH3040': [cfg.sensor_battery, cfg.binary_sensor_occupancy], 1232 | 'DZ4743-00B': [cfg.switch], 1233 | 'GLSK3ZB-1711': [cfg.switch], 1234 | 'GLSK3ZB-1712': [switchEndpoint('top'), switchEndpoint('bottom')], 1235 | 'GLSK3ZB-1713': [switchEndpoint('top'), switchEndpoint('center'), switchEndpoint('bottom')], 1236 | 'GLSK6ZB-1714': [ 1237 | switchEndpoint('top_left'), switchEndpoint('bottom_left'), 1238 | switchEndpoint('top_right'), switchEndpoint('bottom_right'), 1239 | ], 1240 | 'GLSK6ZB-1715': [ 1241 | switchEndpoint('top_left'), switchEndpoint('center_left'), switchEndpoint('bottom_left'), 1242 | switchEndpoint('top_right'), switchEndpoint('bottom_right'), 1243 | ], 1244 | 'GLSK6ZB-1716': [ 1245 | switchEndpoint('top_left'), switchEndpoint('center_left'), switchEndpoint('bottom_left'), 1246 | switchEndpoint('top_right'), switchEndpoint('center_right'), switchEndpoint('bottom_right'), 1247 | ], 1248 | '3306431P7': [cfg.light_brightness_colortemp], 1249 | 'AC08559': [cfg.light_brightness_colortemp_colorxy], 1250 | 'LVS-ZB15S': [cfg.switch], 1251 | 'LZL4BWHL01': [cfg.sensor_action], 1252 | '2AJZ4KPKEY': [cfg.sensor_click, cfg.sensor_battery], 1253 | '2AJZ4KPFT': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1254 | 'TT001ZAV20': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1255 | 'TS0002': [switchEndpoint('l1'), switchEndpoint('l2')], 1256 | 'LVS-SN10ZW': [cfg.sensor_battery, cfg.binary_sensor_occupancy], 1257 | 'LVS-ZB15R': [cfg.switch], 1258 | 'TH1123ZB': [ 1259 | thermostat(7, 30, 'occupied_heating_setpoint', 1.0), cfg.sensor_local_temperature, 1260 | cfg.lock_keypad_lockout, cfg.sensor_power, 1261 | ], 1262 | 'TH1124ZB': [thermostat()], 1263 | 'TH1400ZB': [thermostat()], 1264 | 'TH1500ZB': [thermostat()], 1265 | 'Zen-01-W': [thermostat(10, 30, 'occupied_heating_setpoint', 0.5)], 1266 | '9290022166': [cfg.light_brightness_colortemp_colorxy], 1267 | 'PM-C140-ZB': [cfg.sensor_power, cfg.switch], 1268 | 'PM-B530-ZB': [cfg.sensor_power, cfg.switch], 1269 | 'PM-B430-ZB': [cfg.sensor_power, cfg.switch], 1270 | 'ptvo.switch': [ 1271 | switchEndpoint('bottom_left'), switchEndpoint('bottom_right'), switchEndpoint('top_left'), 1272 | switchEndpoint('top_right'), switchEndpoint('center'), cfg.sensor_click, 1273 | ], 1274 | 'DIYRuZ_R4_5': [ 1275 | switchEndpoint('bottom_left'), switchEndpoint('bottom_right'), switchEndpoint('top_left'), 1276 | switchEndpoint('top_right'), switchEndpoint('center'), 1277 | ], 1278 | 'DIYRuZ_KEYPAD20': [], 1279 | 'DTB190502A1': [], 1280 | 'FL 130 C': [cfg.light_brightness_colortemp_colorxy], 1281 | 'OFL 120 C': [cfg.light_brightness_colortemp_colorxy], 1282 | 'OFL 140 C': [cfg.light_brightness_colortemp_colorxy], 1283 | 'OSL 130 C': [cfg.light_brightness_colortemp_colorxy], 1284 | 'BF 263': [cfg.light_brightness], 1285 | 'RF 263': [cfg.light_brightness], 1286 | 'HS1CG-M': [cfg.binary_sensor_gas], 1287 | 'HS1CG_M': [cfg.binary_sensor_gas], 1288 | 'LVS-SN10ZW_SN11': [cfg.sensor_battery, cfg.binary_sensor_occupancy], 1289 | 'B00TN589ZG': [cfg.light_brightness], 1290 | 'PSB19-SW27': [cfg.light_brightness], 1291 | 'S1': [cfg.switch, cfg.sensor_power], 1292 | 'S2': [switchEndpoint('l1'), switchEndpoint('l2'), cfg.sensor_power], 1293 | 'ZWallRemote0': [cfg.sensor_click], 1294 | 'D1': [cfg.light_brightness, cfg.sensor_power], 1295 | 'J1': [cfg.cover_position_tilt, cfg.sensor_power], 1296 | '73741': [cfg.light_brightness_colortemp_colorxy], 1297 | 'ZA806SQ1TCF': [cfg.light_brightness_colortemp], 1298 | 'RF 265': [cfg.light_brightness], 1299 | 'ZNCZ03LM': [cfg.switch, cfg.sensor_power], 1300 | '17436/30/P7': [cfg.light_brightness], 1301 | '17435/30/P7': [cfg.light_brightness_colorxy], 1302 | '9290018187B': [cfg.light_brightness_colortemp_colorxy], 1303 | '1741830P7': [cfg.light_brightness_colortemp_colorxy], 1304 | 'Z3-1BRL': [cfg.sensor_action, cfg.sensor_brightness], 1305 | 'HS1CG-E': [cfg.binary_sensor_gas], 1306 | 'LED1842G3': [cfg.light_brightness], 1307 | 'ROB_200-008-0': [cfg.sensor_battery, cfg.sensor_click], 1308 | 'ICZB-IW11SW': [cfg.switch], 1309 | 'HV-GUCXZB5': [cfg.light_brightness_colortemp], 1310 | 'HGZB-20A': [cfg.switch], 1311 | 'SZ-ESW01': [cfg.switch, cfg.sensor_power], 1312 | 'LXZB-12A': [cfg.light_brightness_colortemp_colorxy], 1313 | '2AJZ4KPBS': [cfg.sensor_battery, cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1314 | '2AJZ4KPDR': [cfg.sensor_battery, cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1315 | '6717-84': [cfg.switch], 1316 | 'ICZB-KPD18S': [cfg.sensor_battery, cfg.sensor_click, cfg.sensor_action], 1317 | '8195-55': [cfg.light_brightness_colortemp], 1318 | 'E1757': [cfg.cover_position, cfg.sensor_battery], 1319 | 'E1926': [cfg.cover_position, cfg.sensor_battery], 1320 | 'LWG004': [cfg.light_brightness], 1321 | '54668161': [cfg.light_brightness_colortemp], 1322 | '8718699688820': [cfg.light_brightness], 1323 | 'GL-W-001Z': [cfg.switch], 1324 | 'E1766': [cfg.sensor_click, cfg.sensor_battery], 1325 | '929001953101': [cfg.light_brightness_colortemp_colorxy], 1326 | '8718699673147': [cfg.light_brightness], 1327 | '3300-P': [cfg.sensor_temperature, cfg.binary_sensor_contact, cfg.sensor_battery], 1328 | 'GL-B-008ZS': [cfg.light_brightness_colortemp_colorxy], 1329 | 'T1828': [cfg.light_brightness_colortemp], 1330 | 'T1829': [cfg.light_brightness_colortemp], 1331 | '929002240401': [cfg.switch], 1332 | 'HGZB-20-UK': [cfg.switch], 1333 | 'PTAPT-WH02': [cfg.switch], 1334 | '929001953301': [cfg.light_brightness_colortemp], 1335 | 'DIYRuZ_magnet': [cfg.binary_sensor_contact, cfg.sensor_battery], 1336 | 'ZLED-TUNE9': [cfg.light_brightness_colortemp], 1337 | 'XHS2-SE': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 1338 | '4000116784070': [cfg.switch], 1339 | '9290020399': [cfg.light_brightness], 1340 | '929002241201': [cfg.light_brightness], 1341 | 'YRD210-HA-605': [cfg.lock, cfg.sensor_battery], 1342 | 'YRD220/240 TSDB': [cfg.lock, cfg.sensor_battery], 1343 | 'ZM-CSW032-D': [cfg.cover_position], 1344 | 'LH-32ZB': [cfg.sensor_humidity, cfg.sensor_temperature, cfg.sensor_battery], 1345 | '511.201': [cfg.light_brightness], 1346 | 'ZNCLDJ12LM': [cfg.cover_position, cfg.sensor_battery], 1347 | '046677552343': [cfg.switch], 1348 | '3115331PH': [cfg.light_brightness_colortemp_colorxy], 1349 | 'ZWLD-100': [cfg.binary_sensor_water_leak, cfg.binary_sensor_battery_low, cfg.sensor_battery], 1350 | 'GL-MC-001': [cfg.light_brightness_colortemp_colorxy], 1351 | 'YRD226/246 TSDB': [cfg.lock, cfg.sensor_battery], 1352 | 'T1820': [cfg.light_brightness_colortemp], 1353 | 'BASICZBR3': [cfg.switch], 1354 | 'E1744': [cfg.sensor_action, cfg.sensor_battery], 1355 | 'TS0201': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1356 | 'LH07321': [cfg.binary_sensor_water_leak, cfg.binary_sensor_battery_low], 1357 | 'GL-C-008S': [cfg.light_brightness_colortemp_colorxy], 1358 | 'BY 178 T': [cfg.light_brightness_colortemp], 1359 | '8718699688882': [cfg.light_brightness], 1360 | 'LED1738G7': [cfg.light_brightness_colortemp], 1361 | '9290022169': [cfg.light_brightness_colortemp], 1362 | 'TERNCY-PP01': [ 1363 | cfg.sensor_temperature, cfg.binary_sensor_occupancy, cfg.sensor_illuminance, cfg.sensor_illuminance_lux, 1364 | cfg.sensor_click, 1365 | ], 1366 | 'CR11S8UZ': [cfg.sensor_action], 1367 | 'RB 148 T': [cfg.light_brightness_colortemp], 1368 | 'STS-OUT-US-2': [cfg.switch, cfg.sensor_power], 1369 | 'UK7004240': [thermostat(), cfg.sensor_battery], 1370 | 'S31ZB': [cfg.switch], 1371 | 'SA-003-Zigbee': [cfg.switch], 1372 | 'SZ-DWS04': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.sensor_battery], 1373 | 'ICZB-B1FC60/B3FC64/B2FC95/B2FC125': [cfg.light_brightness_colortemp], 1374 | 'TS0203': [cfg.sensor_battery, cfg.binary_sensor_contact], 1375 | 'TS0204': [cfg.binary_sensor_gas], 1376 | 'TS0205': [cfg.binary_sensor_smoke, cfg.sensor_battery], 1377 | 'TS0111': [cfg.switch], 1378 | 'TS0001': [cfg.switch], 1379 | 'TS0207': [cfg.binary_sensor_water_leak, cfg.sensor_battery], 1380 | 'iL07_1': [cfg.binary_sensor_occupancy, cfg.binary_sensor_tamper, cfg.binary_sensor_battery_low], 1381 | 'S31 Lite zb': [cfg.switch], 1382 | 'LH-992ZB': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1383 | '548727': [cfg.light_brightness_colortemp_colorxy], 1384 | 'TS0202': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 1385 | 'TS0218': [cfg.sensor_action, cfg.sensor_battery], 1386 | '404021': [cfg.switch], 1387 | 'Eco-Dim.07': [cfg.light_brightness], 1388 | 'DIYRuZ_rspm': [cfg.switch, cfg.sensor_action, cfg.sensor_power, cfg.sensor_current], 1389 | 'ZG9101SAC-HP-Switch': [cfg.switch], 1390 | 'ZNCZ04LM': [ 1391 | cfg.switch, cfg.sensor_power, cfg.sensor_consumption, 1392 | cfg.sensor_current, cfg.sensor_voltage, cfg.sensor_temperature, 1393 | ], 1394 | 'ZNCZ12LM': [cfg.switch, cfg.sensor_power], 1395 | 'GL-S-007ZS': [cfg.light_brightness_colortemp_colorxy], 1396 | '4058075816732': [cfg.light_brightness_colortemp_colorxy], 1397 | 'GL-B-007ZS': [cfg.light_brightness_colortemp_colorxy], 1398 | 'GL-G-007Z': [cfg.light_brightness_colortemp_colorxy], 1399 | 'WXCJKG11LM': [cfg.sensor_action, cfg.sensor_battery], 1400 | 'WXCJKG12LM': [cfg.sensor_action, cfg.sensor_battery], 1401 | 'WXCJKG13LM': [cfg.sensor_action, cfg.sensor_battery], 1402 | '8718699693985': [cfg.sensor_action, cfg.sensor_battery], 1403 | 'GL-D-004ZS': [cfg.light_brightness_colortemp_colorxy], 1404 | 'AC10787': [cfg.light_brightness_colortemp], 1405 | 'F-APP-UK-V2': [cfg.switch, cfg.sensor_power], 1406 | 'S9TSZGB_3': [cfg.sensor_action], 1407 | 'S9TSZGB_1': [cfg.sensor_action], 1408 | 'SP-EUC01': [cfg.switch, cfg.sensor_power], 1409 | '511.012': [cfg.light_brightness], 1410 | 'GL-S-008Z': [cfg.light_brightness_colortemp_colorxy], 1411 | 'TZSW22FW-L4': [switchEndpoint('top'), switchEndpoint('bottom')], 1412 | 'GDKES-01TZXD': [cfg.switch], 1413 | 'GDKES-02TZXD': [switchEndpoint('left'), switchEndpoint('right')], 1414 | 'GDKES-03TZXD': [switchEndpoint('left'), switchEndpoint('center'), switchEndpoint('right')], 1415 | '6735/6736/6737': [cfg.switch, cfg.sensor_action], 1416 | '4034031P7': [cfg.light_brightness_colortemp], 1417 | '5900131C5': [cfg.light_brightness_colortemp], 1418 | 'SZ-SRN12N': [], 1419 | 'ML-ST-D200': [cfg.light_brightness], 1420 | '7099930PH': [cfg.light_brightness_colorxy], 1421 | '9GED18000-009': [cfg.lock, cfg.sensor_battery], 1422 | '9GED21500-005': [cfg.lock, cfg.sensor_battery], 1423 | 'MP-841': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1424 | 'MCT-370 SMA': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1425 | 'RB 162': [cfg.light_brightness], 1426 | 'SOHM-I1': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1427 | 'SWHM-I1': [cfg.binary_sensor_water_leak, cfg.binary_sensor_battery_low], 1428 | 'SMHM-I1': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1429 | 'SKHMP30-I1': [cfg.switch, cfg.sensor_power], 1430 | '404028': [cfg.light_brightness_colortemp_colorxy], 1431 | '595UGR22': [cfg.light_brightness_colortemp], 1432 | '6ARCZABZH': [cfg.sensor_battery, cfg.sensor_action], 1433 | 'ZK-EU-2U': [cfg.switch], 1434 | '511.202': [cfg.switch], 1435 | 'SP 224': [cfg.switch], 1436 | '9290022411': [cfg.light_brightness], 1437 | 'E1C-NB6': [cfg.switch], 1438 | 'LVS-SC7': [cfg.sensor_action], 1439 | '1742930P7': [cfg.light_brightness_colortemp_colorxy], 1440 | 'ZM-L03E-Z': [switchEndpoint('left'), switchEndpoint('center'), switchEndpoint('right')], 1441 | 'DL15S-1BZ': [cfg.switch], 1442 | 'E1D-G73WNA': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1443 | 'WV704R0A0902': [thermostat()], 1444 | '067776': [cfg.cover_position], 1445 | '067773': [cfg.sensor_action, cfg.sensor_battery], 1446 | '067771': [cfg.light_brightness], 1447 | '064873': [cfg.sensor_action], 1448 | 'K4003C': [cfg.switch, cfg.sensor_action], 1449 | 'STZB402': [ 1450 | thermostat(5, 30, 'occupied_heating_setpoint', 0.5), 1451 | cfg.sensor_local_temperature, 1452 | cfg.lock_keypad_lockout, 1453 | ], 1454 | 'SMT402': [ 1455 | thermostat(5, 30, 'occupied_heating_setpoint', 0.5), 1456 | cfg.sensor_local_temperature, 1457 | cfg.lock_keypad_lockout, 1458 | ], 1459 | 'SMT402AD': [ 1460 | thermostat(5, 30, 'occupied_heating_setpoint', 0.5), 1461 | cfg.sensor_local_temperature, 1462 | cfg.lock_keypad_lockout, 1463 | ], 1464 | '046677551780': [cfg.light_brightness], 1465 | '798.15': [cfg.light_brightness], 1466 | '12126': [cfg.switch], 1467 | '067775': [cfg.switch, cfg.sensor_power], 1468 | '064888': [cfg.switch], 1469 | '412015': [cfg.sensor_power, cfg.binary_sensor_power_alarm_active], 1470 | 'gq8b1uv': [cfg.light_brightness], 1471 | 'GZCGQ01LM': [cfg.sensor_battery, cfg.sensor_illuminance, cfg.sensor_illuminance_lux], 1472 | '9290018215': [cfg.light_brightness], 1473 | '1743230P7': [cfg.light_brightness_colortemp_colorxy], 1474 | '1744130P7': [cfg.light_brightness_colortemp_colorxy], 1475 | '1743130P7': [cfg.light_brightness_colortemp_colorxy], 1476 | '100.110.51': [cfg.light_brightness_colortemp], 1477 | 'ZL1000100-CCT-US-V1A02': [cfg.light_brightness_colortemp], 1478 | 'ZL1000701-27-EU-V1A02': [cfg.light_brightness], 1479 | 'HGZB-DLC4-N12B': [cfg.light_brightness_colortemp_colorxy], 1480 | 'U86KCJ-ZP': [cfg.sensor_action], 1481 | 'HS1HT': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1482 | 'HS2ESK-E': [cfg.switch, cfg.sensor_power], 1483 | 'B01M7Y8BP9': [cfg.sensor_action], 1484 | 'GP-WOU019BBDWG': [cfg.switch, cfg.sensor_power, cfg.sensor_energy], 1485 | 'AV2010/21A': [cfg.binary_sensor_battery_low, cfg.binary_sensor_contact, cfg.binary_sensor_tamper], 1486 | 'AL-PIR02': [cfg.binary_sensor_occupancy, cfg.binary_sensor_tamper, cfg.sensor_battery], 1487 | 'MKS-CM-W5': [ 1488 | switchEndpoint('l1'), switchEndpoint('l2'), 1489 | switchEndpoint('l3'), switchEndpoint('l4'), 1490 | ], 1491 | 'STS-WTR-250': [cfg.binary_sensor_water_leak, cfg.sensor_battery, cfg.sensor_temperature], 1492 | 'ZG2835RAC': [cfg.light_brightness], 1493 | 'BW-IS2': [cfg.binary_sensor_contact, cfg.sensor_battery], 1494 | 'BW-IS3': [cfg.binary_sensor_occupancy], 1495 | 'SLR1b': [thermostat()], 1496 | 'WPT1': [], 1497 | '4058075047853': [cfg.light_brightness_colortemp_colorxy], 1498 | 'ROB_200-003-0': [cfg.switch], 1499 | '4512704': [cfg.switch], 1500 | 'AV2010/24A': [cfg.binary_sensor_smoke, cfg.binary_sensor_battery_low, cfg.binary_sensor_tamper], 1501 | '902010/24': [cfg.binary_sensor_smoke, cfg.binary_sensor_battery_low, cfg.binary_sensor_tamper], 1502 | 'ROB_200-014-0': [cfg.light_brightness], 1503 | '4090631P7': [cfg.light_brightness_colortemp_colorxy], 1504 | 'SGMHM-I1': [cfg.binary_sensor_gas, cfg.binary_sensor_battery_low, cfg.binary_sensor_tamper], 1505 | 'STHM-I1H': [cfg.sensor_humidity, cfg.sensor_temperature, cfg.sensor_battery], 1506 | 'BDHM8E27W70-I1': [cfg.light_brightness_colortemp], 1507 | 'M420': [cfg.sensor_battery], 1508 | '8718696167991': [cfg.light_brightness_colortemp_colorxy], 1509 | 'GP-LBU019BBAWU': [cfg.light_brightness], 1510 | '371000001': [cfg.light_brightness_colortemp], 1511 | '10011725': [cfg.light_brightness_colortemp_colorxy], 1512 | '929002277501': [cfg.light_brightness], 1513 | 'RS 230 C': [cfg.light_brightness_colortemp_colorxy], 1514 | 'LED1903C5/LED1835C6': [cfg.light_brightness_colortemp], 1515 | '1402755': [cfg.light_brightness], 1516 | '4503848C5': [cfg.light_brightness_colortemp], 1517 | '500.48': [cfg.light_brightness], 1518 | 'TS0042': [cfg.sensor_action], 1519 | 'RHK06': [cfg.binary_sensor_contact, cfg.sensor_battery], 1520 | 'RHK07': [cfg.sensor_action, cfg.sensor_battery], 1521 | 'RHK08': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1522 | 'RHK09': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 1523 | '07046L': [cfg.sensor_action], 1524 | '07045L': [cfg.binary_sensor_contact, cfg.binary_sensor_tamper, cfg.binary_sensor_battery_low], 1525 | '3402831P7': [cfg.light_brightness_colortemp], 1526 | 'TERNCY-SD01': [cfg.sensor_click, cfg.sensor_battery], 1527 | '07048L': [cfg.switch, cfg.sensor_power], 1528 | 'ICZB-KPD14S': [cfg.sensor_battery, cfg.sensor_click, cfg.sensor_action], 1529 | '73743': [cfg.sensor_action, cfg.sensor_battery], 1530 | 'C4': [cfg.sensor_action], 1531 | 'GL-D-003ZS': [cfg.light_brightness_colortemp_colorxy], 1532 | '66492-001': [cfg.lock, cfg.sensor_battery], 1533 | '798.09': [cfg.light_brightness_colortemp_colorxy], 1534 | 'U202DST600ZB': [lightEndpoint('light_brightness', 'l1'), lightEndpoint('light_brightness', 'l2')], 1535 | 'SM10ZW': [cfg.binary_sensor_contact, cfg.sensor_battery], 1536 | 'ICZB-R11D': [cfg.light_brightness], 1537 | 'SW2500ZB': [cfg.switch], 1538 | '4512703': [cfg.sensor_action, cfg.sensor_battery], 1539 | '4512702': [cfg.sensor_action, cfg.sensor_battery], 1540 | '4090331P9': [cfg.light_brightness_colortemp_colorxy], 1541 | 'HS1EB': [cfg.sensor_click], 1542 | 'HS2SW1A-N': [cfg.switch], 1543 | 'HS2SW2A-N': [switchEndpoint('left'), switchEndpoint('right')], 1544 | 'HS2SW3A-N': [switchEndpoint('left'), switchEndpoint('right'), switchEndpoint('center')], 1545 | 'MCLH-07': [cfg.binary_sensor_water_leak, cfg.sensor_battery], 1546 | 'MCLH-04': [cfg.binary_sensor_contact, cfg.sensor_battery], 1547 | 'MCLH-02': [cfg.light_brightness_colortemp_colorxy], 1548 | '3323-G': [cfg.binary_sensor_contact, cfg.sensor_temperature, cfg.binary_sensor_battery_low], 1549 | 'ZL1000400-CCT-EU-2-V1A02': [cfg.light_brightness_colortemp], 1550 | 'ROB_200-007-0': [cfg.sensor_action, cfg.sensor_battery], 1551 | 'PM-S140-ZB': [cfg.switch], 1552 | 'PM-S240-ZB': [switchEndpoint('top'), switchEndpoint('bottom')], 1553 | 'PM-S340-ZB': [switchEndpoint('top'), switchEndpoint('center'), switchEndpoint('bottom')], 1554 | 'PM-S140R-ZB': [cfg.switch], 1555 | 'PM-S240R-ZB': [switchEndpoint('top'), switchEndpoint('bottom')], 1556 | 'PM-S340R-ZB': [switchEndpoint('top'), switchEndpoint('center'), switchEndpoint('bottom')], 1557 | 'U201DST600ZB': [cfg.light_brightness], 1558 | 'U201SRY2KWZB': [cfg.switch], 1559 | 'U202SRY2KWZB': [switchEndpoint('l1'), switchEndpoint('l2')], 1560 | '93999': [cfg.light_brightness], 1561 | 'ZHS-15': [cfg.switch, cfg.sensor_power, cfg.sensor_current, cfg.sensor_voltage], 1562 | 'GS361A-H04': [ 1563 | cfg.lock_child_lock, 1564 | cfg.switch_window_detection, 1565 | cfg.switch_valve_detection, 1566 | thermostat(5, 30, 'current_heating_setpoint', 0.5), 1567 | cfg.sensor_battery, 1568 | ], 1569 | 'HLC614-ZLL': [switchEndpoint('l1'), switchEndpoint('l2'), switchEndpoint('l3')], 1570 | 'EMIZB-132': [ 1571 | cfg.sensor_power, cfg.sensor_voltage, cfg.sensor_current, cfg.sensor_energy, cfg.sensor_current_phase_b, 1572 | cfg.sensor_current_phase_c, cfg.sensor_voltage_phase_b, cfg.sensor_voltage_phase_c, 1573 | ], 1574 | 'S9ZGBRC01': [cfg.sensor_action, cfg.sensor_battery], 1575 | '511.557': [cfg.sensor_action], 1576 | 'RL804CZB': [cfg.light_brightness_colortemp_colorxy], 1577 | '3420-G': [cfg.light_brightness], 1578 | 'U02I007C.01': [ 1579 | cfg.sensor_action, cfg.binary_sensor_contact, cfg.binary_sensor_water_leak, 1580 | cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery, 1581 | ], 1582 | '4080248P9': [cfg.light_brightness_colortemp_colorxy], 1583 | '4080148P9': [cfg.light_brightness_colortemp_colorxy], 1584 | '4058075148338': [cfg.light_brightness_colortemp], 1585 | '4058075181472': [cfg.light_brightness_colortemp], 1586 | '484719': [cfg.light_brightness], 1587 | 'SEB01ZB': [cfg.binary_sensor_sos, cfg.sensor_battery], 1588 | 'SBM01ZB': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 1589 | 'STH01ZB': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1590 | 'SSA01ZB': [cfg.binary_sensor_smoke, cfg.sensor_battery], 1591 | 'SCA01ZB': [cfg.binary_sensor_carbon_monoxide, cfg.sensor_battery], 1592 | 'SGA01ZB': [cfg.binary_sensor_gas, cfg.sensor_battery], 1593 | 'SWA01ZB': [cfg.binary_sensor_water_leak, cfg.sensor_battery], 1594 | 'SDM01ZB': [cfg.binary_sensor_contact, cfg.sensor_battery], 1595 | 'SFS01ZB': [cfg.switch], 1596 | 'SLS301ZB_2': [switchEndpoint('left'), switchEndpoint('right')], 1597 | 'SLS301ZB_3': [switchEndpoint('left'), switchEndpoint('right'), switchEndpoint('center')], 1598 | 'SSS401ZB': [cfg.switch, cfg.sensor_action], 1599 | 'E12-N1E': [cfg.light_brightness_colortemp_colorxy], 1600 | '4040B': [cfg.sensor_power, switchEndpoint('l1'), switchEndpoint('l2')], 1601 | '3460-L': [cfg.sensor_action, cfg.sensor_temperature, cfg.sensor_battery], 1602 | '3157100': [thermostatHeatCool(10, 30, 1, ['off', 'heat', 'cool'], ['auto', 'on']), cfg.sensor_battery], 1603 | '4257050-RZHAC': [cfg.switch, cfg.sensor_power], 1604 | '27087-03': [cfg.switch, cfg.sensor_battery], 1605 | '99140-002': [cfg.lock, cfg.sensor_battery], 1606 | '4512706': [cfg.sensor_battery, cfg.sensor_action], 1607 | 'GL-S-004ZS': [cfg.light_brightness_colortemp_colorxy], 1608 | '7121131PU': [cfg.light_brightness_colortemp_colorxy], 1609 | 'RL804QZB': [switchEndpoint('l1'), switchEndpoint('l2'), switchEndpoint('l3')], 1610 | 'RC-2000WH': [thermostatHeatCool(10, 30, 1, ['off', 'auto', 'heat', 'cool'], ['auto', 'on', 'smart'])], 1611 | 'TH1300ZB': [thermostat()], 1612 | 'SP 220': [cfg.switch], 1613 | '511.040': [cfg.light_brightness_colortemp_colorxy], 1614 | '511.344': [cfg.sensor_battery, cfg.sensor_action, cfg.sensor_action_color, cfg.sensor_action_color_temperature], 1615 | 'SMSZB-120': [cfg.binary_sensor_smoke, cfg.sensor_temperature, cfg.sensor_battery], 1616 | 'DWS003': [cfg.binary_sensor_contact, cfg.sensor_battery, cfg.binary_sensor_battery_low, cfg.sensor_temperature], 1617 | 'MOT003': [cfg.binary_sensor_occupancy, cfg.sensor_temperature, cfg.sensor_battery, cfg.binary_sensor_battery_low], 1618 | 'HALIGHTDIMWWE14': [cfg.light_brightness], 1619 | 'GreenPower_On_Off_Switch': [cfg.sensor_action], 1620 | 'GreenPower_7': [cfg.sensor_action], 1621 | '3RSL011Z': [cfg.light_brightness_colortemp], 1622 | '3RSL012Z': [cfg.light_brightness_colortemp], 1623 | '1746130P7': [cfg.light_brightness_colortemp_colorxy], 1624 | '6xy-M350ST-W1Z': [cfg.light_brightness_colortemp], 1625 | 'AU-A1GUZBCX5': [cfg.light_brightness_colortemp], 1626 | 'AU-A1GUZB5/30': [cfg.light_brightness], 1627 | 'AU-A1GUZBRGBW': [cfg.light_brightness_colortemp_colorxy], 1628 | 'AU-A1GSZ9RGBW': [cfg.light_brightness_colortemp_colorxy], 1629 | 'RF 261': [cfg.light_brightness], 1630 | 'RF 264': [cfg.light_brightness], 1631 | 'HY369RT': [ 1632 | cfg.lock_child_lock, 1633 | cfg.switch_window_detection, 1634 | cfg.switch_valve_detection, 1635 | thermostat(5, 30, 'current_heating_setpoint', 0.5), 1636 | cfg.sensor_battery, 1637 | ], 1638 | 'WXKG07LM': [cfg.sensor_action, cfg.sensor_battery], 1639 | 'MCLH-03': [cfg.switch, cfg.sensor_voltage, cfg.sensor_power, cfg.sensor_current], 1640 | '752189': [cfg.sensor_action, cfg.sensor_battery], 1641 | '676-00301024955Z': [cfg.light_brightness], 1642 | '1743030P7': [cfg.light_brightness_colortemp_colorxy], 1643 | 'XBee': [], 1644 | 'ZBHT-1': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1645 | 'rgbw2.zbee27': [cfg.light_brightness_colortemp_colorxy], 1646 | 'MCLH-05': [cfg.binary_sensor_occupancy, cfg.sensor_battery], 1647 | '5045148P7': [cfg.light_brightness_colortemp_colorxy], 1648 | 'GL-FL-006TZ': [cfg.light_brightness_colortemp_colorxy], 1649 | '5AA-SS-ZA-H0': [cfg.binary_sensor_occupancy, cfg.sensor_illuminance, cfg.sensor_illuminance_lux], 1650 | 'MOSZB-130': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1651 | 'AU-A1ZBRC': [cfg.sensor_action, cfg.sensor_battery], 1652 | 'AU-A1ZBPIRS': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low, cfg.sensor_illuminance_lux], 1653 | 'TS0121': [cfg.switch], 1654 | 'ZK03840': [thermostat()], 1655 | 'ZS1100400-IN-V1A02': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1656 | 'MCLH-08': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_eco2, cfg.sensor_voc], 1657 | 'GL-FL-005TZ': [cfg.light_brightness_colortemp_colorxy], 1658 | 'ED2004-012': [cfg.switch], 1659 | 'ZG192910-4': [cfg.light_brightness_colortemp], 1660 | 'SLT2': [], 1661 | 'ZL1000700-22-EU-V1A02': [cfg.light_brightness], 1662 | 'SLB2': [], 1663 | '8840100H': [cfg.binary_sensor_water_leak, cfg.sensor_temperature, cfg.sensor_battery], 1664 | '404037': [cfg.light_brightness_colortemp], 1665 | '9290022408': [cfg.switch], 1666 | 'HGZB-14A': [cfg.binary_sensor_water_leak, cfg.sensor_battery], 1667 | 'TERNCY-DC01': [cfg.sensor_temperature, cfg.binary_sensor_contact], 1668 | 'ZS110050078': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1669 | 'HGZB-DLC4-N15B': [cfg.light_brightness_colortemp_colorxy], 1670 | 'ECW-100-A03': [switchEndpoint('top'), switchEndpoint('center'), switchEndpoint('bottom')], 1671 | '4098430P7': [cfg.light_brightness_colortemp], 1672 | 'PQC19-DY01': [cfg.light_brightness], 1673 | 'DIYRuZ_FreePad': [cfg.sensor_action, cfg.sensor_battery], 1674 | 'ST20': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1675 | 'ST21': [cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_battery], 1676 | 'T30W3Z': [switchEndpoint('top'), switchEndpoint('center'), switchEndpoint('bottom')], 1677 | 'T21W2Z': [switchEndpoint('top'), switchEndpoint('bottom')], 1678 | 'T21W1Z': [cfg.switch], 1679 | 'W40CZ': [cfg.cover_position], 1680 | 'R11W2Z': [switchEndpoint('l1'), switchEndpoint('l2')], 1681 | 'R20W2Z': [switchEndpoint('l1'), switchEndpoint('l2')], 1682 | 'SW21': [cfg.binary_sensor_water_leak, cfg.binary_sensor_battery_low], 1683 | 'SE21': [cfg.sensor_action], 1684 | '4052899926127': [cfg.light_brightness], 1685 | 'GL-B-001ZS': [cfg.light_brightness_colortemp_colorxy], 1686 | 'LH-990ZB': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1687 | 'HO-09ZB': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low], 1688 | '500.67': [cfg.sensor_action], 1689 | 'E1E-G7F': [cfg.sensor_action], 1690 | 'LH-990F': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1691 | 'QBKG25LM': [ 1692 | switchEndpoint('left'), switchEndpoint('center'), switchEndpoint('right'), cfg.sensor_action, 1693 | cfg.sensor_power, 1694 | ], 1695 | 'QBKG24LM': [switchEndpoint('left'), switchEndpoint('right'), cfg.sensor_power], 1696 | 'WS-USC01': [cfg.switch], 1697 | 'WS-USC02': [switchEndpoint('top'), switchEndpoint('bottom')], 1698 | 'WS-USC04': [switchEndpoint('top'), switchEndpoint('bottom')], 1699 | '100.462.31': [cfg.sensor_action], 1700 | 'SN10ZW': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1701 | 'AU-A1ZBPIAB': [cfg.switch, cfg.sensor_voltage, cfg.sensor_current, cfg.sensor_power], 1702 | 'AU-A1ZBDWS': [cfg.binary_sensor_contact, cfg.sensor_battery], 1703 | '4058075816459': [cfg.sensor_action], 1704 | '14592.0': [cfg.switch], 1705 | '73699': [cfg.light_brightness_colorxy], 1706 | 'SAGE206612': [cfg.sensor_action, cfg.sensor_battery], 1707 | 'TI0001-switch': [cfg.switch], 1708 | 'TI0001-socket': [cfg.switch], 1709 | '9290022891': [cfg.light_brightness_colortemp_colorxy], 1710 | '160-01': [cfg.switch, cfg.sensor_power], 1711 | 'ZS232000178': [cfg.sensor_action], 1712 | 'mcdj3aq': [cfg.cover_position], 1713 | 'DIYRuZ_Geiger': [cfg.sensor_radioactive_events_per_minute, cfg.sensor_radiation_dose_per_hour, cfg.sensor_action], 1714 | '8718696170557': [cfg.light_brightness_colortemp_colorxy], 1715 | '12127': [switchEndpoint('l1'), switchEndpoint('l2')], 1716 | 'SWO-MOS1PA': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1717 | 'STS-IRM-251': [cfg.sensor_temperature, cfg.binary_sensor_occupancy, cfg.sensor_battery], 1718 | 'WSDCGQ12LM': [cfg.sensor_temperature, cfg.sensor_pressure, cfg.sensor_humidity, cfg.sensor_battery], 1719 | 'SJCGQ12LM': [cfg.sensor_battery, cfg.binary_sensor_water_leak], 1720 | 'DJT12LM': [cfg.sensor_action], 1721 | 'AV2010/22A': [cfg.binary_sensor_occupancy, cfg.binary_sensor_battery_low], 1722 | 'D1523': [cfg.light_brightness], 1723 | 'RS-23ZBS': [cfg.sensor_temperature, cfg.sensor_humidity], 1724 | 'E11-U3E': [cfg.light_brightness_colortemp_colorxy], 1725 | '5062231P7': [cfg.light_brightness_colortemp_colorxy], 1726 | '5062431P7': [cfg.light_brightness_colortemp_colorxy], 1727 | '5062131P7': [cfg.light_brightness_colortemp_colorxy], 1728 | '5062331P7': [cfg.light_brightness_colortemp_colorxy], 1729 | 'GL-D-004Z': [cfg.light_brightness_colortemp_colorxy], 1730 | '9290022268': [cfg.light_brightness], 1731 | '73773': [cfg.light_brightness_colortemp_colorxy], 1732 | 'KMPCIL_RES005': [ 1733 | cfg.sensor_battery, cfg.sensor_temperature, cfg.sensor_humidity, cfg.sensor_pressure, cfg.sensor_illuminance, 1734 | cfg.binary_sensor_occupancy, cfg.switch, 1735 | ], 1736 | 'DIYRuZ_R8_8': [ 1737 | switchEndpoint('l1'), switchEndpoint('l2'), switchEndpoint('l3'), switchEndpoint('l4'), 1738 | switchEndpoint('l5'), switchEndpoint('l6'), switchEndpoint('l7'), switchEndpoint('l8'), 1739 | ], 1740 | '511.010': [cfg.light_brightness], 1741 | '43080': [cfg.light_brightness], 1742 | 'DIYRuZ_RT': [cfg.switch, cfg.sensor_temperature], 1743 | '929002039801': [cfg.light_brightness], 1744 | 'DM2500ZB': [cfg.light_brightness], 1745 | '99100-006': [cfg.lock, cfg.sensor_battery], 1746 | 'SPE600': [cfg.switch, cfg.sensor_power], 1747 | '067774': [cfg.sensor_action, cfg.sensor_battery], 1748 | '067694': [cfg.sensor_action, cfg.sensor_battery], 1749 | }; 1750 | 1751 | /** 1752 | * This extensions handles integration with HomeAssistant 1753 | */ 1754 | class HomeAssistant extends Extension { 1755 | constructor(zigbee, mqtt, state, publishEntityState, eventBus) { 1756 | super(zigbee, mqtt, state, publishEntityState, eventBus); 1757 | 1758 | // A map of all discoverd devices 1759 | this.discovered = {}; 1760 | this.discoveredTriggers = {}; 1761 | 1762 | if (!settings.get().advanced.cache_state) { 1763 | logger.warn('In order for HomeAssistant integration to work properly set `cache_state: true'); 1764 | } 1765 | 1766 | if (settings.get().experimental.output === 'attribute') { 1767 | throw new Error('Home Assitant integration is not possible with attribute output!'); 1768 | } 1769 | 1770 | this.discoveryTopic = settings.get().advanced.homeassistant_discovery_topic; 1771 | this.statusTopic = settings.get().advanced.homeassistant_status_topic; 1772 | 1773 | this.eventBus.on('deviceRemoved', (data) => this.onDeviceRemoved(data.device)); 1774 | this.eventBus.on('publishEntityState', (data) => this.onPublishEntityState(data)); 1775 | this.eventBus.on('deviceRenamed', (data) => this.onDeviceRenamed(data.device)); 1776 | } 1777 | 1778 | onDeviceRemoved(device) { 1779 | delete this.discovered[device.ieeeAddr]; 1780 | const definition = zigbeeHerdsmanConverters.findByDevice(device); 1781 | if (definition) { 1782 | logger.info(`Clearing Home Assistant discovery topic for '${device.ieeeAddr}'`); 1783 | this.getConfigs(definition).forEach((config) => { 1784 | const topic = this.getDiscoveryTopic(config, device); 1785 | this.mqtt.publish(topic, null, {retain: true, qos: 0}, this.discoveryTopic); 1786 | }); 1787 | } 1788 | } 1789 | 1790 | async onPublishEntityState(data) { 1791 | /** 1792 | * In case we deal with a lightEndpoint configuration Zigbee2mqtt publishes 1793 | * e.g. {state_l1: ON, brightness_l1: 250} to zigbee2mqtt/mydevice. 1794 | * As the Home Assistant MQTT JSON light cannot be configured to use state_l1/brightness_l1 1795 | * as the state variables, the state topic is set to zigbee2mqtt/mydevice/l1. 1796 | * Here we retrieve all the attributes with the _l1 values and republish them on 1797 | * zigbee2mqtt/mydevice/l1. 1798 | */ 1799 | if (data.entity.definition && mapping[data.entity.definition.model]) { 1800 | for (const config of mapping[data.entity.definition.model]) { 1801 | const match = /light_(.*)/.exec(config['object_id']); 1802 | if (match) { 1803 | const endpoint = match[1]; 1804 | const endpointRegExp = new RegExp(`(.*)_${endpoint}`); 1805 | const payload = {}; 1806 | for (const key of Object.keys(data.payload)) { 1807 | const keyMatch = endpointRegExp.exec(key); 1808 | if (keyMatch) { 1809 | payload[keyMatch[1]] = data.payload[key]; 1810 | } 1811 | } 1812 | 1813 | await this.mqtt.publish( 1814 | `${data.entity.name}/${endpoint}`, JSON.stringify(payload), {}, 1815 | ); 1816 | } 1817 | } 1818 | } 1819 | 1820 | /** 1821 | * Publish an empty value for click and action payload, in this way Home Assistant 1822 | * can use Home Assistant entities in automations. 1823 | * https://github.com/Koenkk/zigbee2mqtt/issues/959#issuecomment-480341347 1824 | */ 1825 | if (settings.get().advanced.homeassistant_legacy_triggers) { 1826 | const key = ['action', 'click'].find((k) => data.payload.hasOwnProperty(k) && data.payload[k] !== ''); 1827 | if (key) { 1828 | this.publishEntityState(data.entity.device.ieeeAddr, {[key]: ''}); 1829 | } 1830 | } 1831 | 1832 | /** 1833 | * Implements the MQTT device trigger (https://www.home-assistant.io/integrations/device_trigger.mqtt/) 1834 | * The MQTT device trigger does not support JSON parsing, so it cannot listen to zigbee2mqtt/my_device 1835 | * Whenever a device publish an {action: *} we discover an MQTT device trigger sensor 1836 | * and republish it to zigbee2mqtt/my_devic/action 1837 | */ 1838 | const key = ['action', 'click'].find((k) => data.payload.hasOwnProperty(k) && data.payload[k] !== ''); 1839 | if (data.entity.definition && key) { 1840 | const device = data.entity.device; 1841 | if (!this.discoveredTriggers[device.ieeeAddr]) { 1842 | this.discoveredTriggers[device.ieeeAddr] = new Set(); 1843 | } 1844 | 1845 | const value = data.payload[key].toString(); 1846 | const discoveredKey = `${key}_${value}`; 1847 | 1848 | if (!this.discoveredTriggers[device.ieeeAddr].has(discoveredKey)) { 1849 | const config = cfg[`trigger_${key}`]; 1850 | config.object_id = `${key}_${value}`; 1851 | const topic = this.getDiscoveryTopic(config, device); 1852 | const payload = { 1853 | ...config.discovery_payload, 1854 | subtype: value, 1855 | payload: value, 1856 | topic: `${settings.get().mqtt.base_topic}/${data.entity.name}/${key}`, 1857 | device: this.getDevicePayload(data.entity), 1858 | }; 1859 | 1860 | await this.mqtt.publish(topic, JSON.stringify(payload), {retain: true, qos: 0}, this.discoveryTopic); 1861 | this.discoveredTriggers[device.ieeeAddr].add(discoveredKey); 1862 | } 1863 | 1864 | await this.mqtt.publish(`${data.entity.name}/${key}`, value, {}); 1865 | } 1866 | 1867 | /** 1868 | * Publish a value for update_available (if not there yet) to prevent Home Assistant generating warnings of 1869 | * this value not being available. 1870 | */ 1871 | const mockedValues = [ 1872 | { 1873 | property: 'update_available', 1874 | condition: data.entity.device && data.entity.definition && data.entity.definition.hasOwnProperty('ota'), 1875 | value: false, 1876 | }, 1877 | { 1878 | property: 'water_leak', 1879 | condition: data.entity.device && data.entity.definition && mapping[data.entity.definition.model] && 1880 | mapping[data.entity.definition.model].includes(cfg.binary_sensor_water_leak), 1881 | value: false, 1882 | }, 1883 | ]; 1884 | 1885 | for (const entry of mockedValues) { 1886 | if (entry.condition && !data.payload.hasOwnProperty(entry.property)) { 1887 | logger.debug(`Mocking '${entry.property}' value for Home Assistant`); 1888 | this.publishEntityState(data.entity.device.ieeeAddr, {[entry.property]: entry.value}); 1889 | } 1890 | } 1891 | } 1892 | 1893 | onDeviceRenamed(device) { 1894 | const resolvedEntity = this.zigbee.resolveEntity(device); 1895 | logger.info(`Refreshing Home Assistant discovery topic for '${device.ieeeAddr}'`); 1896 | this.discover(resolvedEntity, true); 1897 | } 1898 | 1899 | async onMQTTConnected() { 1900 | this.mqtt.subscribe(this.statusTopic); 1901 | 1902 | // MQTT discovery of all paired devices on startup. 1903 | for (const device of this.zigbee.getClients()) { 1904 | const resolvedEntity = this.zigbee.resolveEntity(device); 1905 | this.discover(resolvedEntity, true); 1906 | } 1907 | } 1908 | 1909 | getConfigs(mappedModel) { 1910 | let configs = mapping[mappedModel.model].slice(); 1911 | configs.push(cfg.sensor_linkquality); 1912 | 1913 | if (mappedModel.hasOwnProperty('ota')) { 1914 | configs.push(cfg.binary_sensor_update_available); 1915 | } 1916 | 1917 | if (!settings.get().advanced.homeassistant_legacy_triggers) { 1918 | configs = configs.filter((c) => c !== cfg.sensor_action && c !== cfg.sensor_click); 1919 | } 1920 | 1921 | return configs; 1922 | } 1923 | 1924 | discover(resolvedEntity, force=false) { 1925 | // Check if already discoverd and check if there are configs. 1926 | const {device, definition} = resolvedEntity; 1927 | const deviceSettings = {...settings.get().device_options, ...resolvedEntity.settings}; 1928 | const discover = force || !this.discovered[device.ieeeAddr]; 1929 | if (!discover || !device || !definition || !mapping[definition.model] || !deviceSettings || 1930 | (deviceSettings.hasOwnProperty('homeassistant') && !deviceSettings.homeassistant)) { 1931 | return; 1932 | } 1933 | 1934 | const friendlyName = deviceSettings.friendlyName; 1935 | this.getConfigs(definition).forEach((config) => { 1936 | const topic = this.getDiscoveryTopic(config, device); 1937 | const payload = {...config.discovery_payload}; 1938 | let stateTopic = `${settings.get().mqtt.base_topic}/${deviceSettings.friendlyName}`; 1939 | if (payload.state_topic_postfix) { 1940 | stateTopic += `/${payload.state_topic_postfix}`; 1941 | delete payload.state_topic_postfix; 1942 | } 1943 | 1944 | if (!payload.hasOwnProperty('state_topic') || payload.state_topic) { 1945 | payload.state_topic = stateTopic; 1946 | } else { 1947 | /* istanbul ignore else */ 1948 | if (payload.hasOwnProperty('state_topic')) { 1949 | delete payload.state_topic; 1950 | } 1951 | } 1952 | 1953 | if (payload.position_topic) { 1954 | payload.position_topic = stateTopic; 1955 | } 1956 | 1957 | if (payload.tilt_status_topic) { 1958 | payload.tilt_status_topic = stateTopic; 1959 | } 1960 | 1961 | payload.json_attributes_topic = stateTopic; 1962 | 1963 | // Set (unique) name 1964 | payload.name = `${friendlyName}_${config.object_id}`; 1965 | 1966 | // Set unique_id 1967 | payload.unique_id = `${deviceSettings.ID}_${config.object_id}_${settings.get().mqtt.base_topic}`; 1968 | 1969 | // Attributes for device registry 1970 | payload.device = this.getDevicePayload(resolvedEntity); 1971 | 1972 | // Set availability payload 1973 | // When using availability_timeout each device has it's own availability topic. 1974 | // If not, use the availability topic of zigbee2mqtt. 1975 | if (settings.get().advanced.availability_timeout) { 1976 | payload.availability_topic = `${settings.get().mqtt.base_topic}/${friendlyName}/availability`; 1977 | } else { 1978 | payload.availability_topic = `${settings.get().mqtt.base_topic}/bridge/state`; 1979 | } 1980 | 1981 | if (payload.command_topic) { 1982 | payload.command_topic = `${settings.get().mqtt.base_topic}/${friendlyName}/`; 1983 | 1984 | if (payload.command_topic_prefix) { 1985 | payload.command_topic += `${payload.command_topic_prefix}/`; 1986 | delete payload.command_topic_prefix; 1987 | } 1988 | 1989 | payload.command_topic += 'set'; 1990 | 1991 | if (payload.command_topic_postfix) { 1992 | payload.command_topic += `/${payload.command_topic_postfix}`; 1993 | delete payload.command_topic_postfix; 1994 | } 1995 | } 1996 | 1997 | if (payload.set_position_topic && payload.command_topic) { 1998 | payload.set_position_topic = payload.command_topic; 1999 | } 2000 | 2001 | if (payload.tilt_command_topic && payload.command_topic) { 2002 | // Home Assistant does not support templates to set tilt (as of 2019-08-17), 2003 | // so we (have to) use a subtopic. 2004 | payload.tilt_command_topic = payload.command_topic + '/tilt'; 2005 | } 2006 | 2007 | if (payload.mode_state_topic) { 2008 | payload.mode_state_topic = stateTopic; 2009 | } 2010 | 2011 | if (payload.mode_command_topic) { 2012 | payload.mode_command_topic = `${stateTopic}/set/system_mode`; 2013 | } 2014 | 2015 | if (payload.current_temperature_topic) { 2016 | payload.current_temperature_topic = stateTopic; 2017 | } 2018 | 2019 | if (payload.temperature_state_topic) { 2020 | payload.temperature_state_topic = stateTopic; 2021 | } 2022 | 2023 | if (payload.temperature_low_state_topic) { 2024 | payload.temperature_low_state_topic = stateTopic; 2025 | } 2026 | 2027 | if (payload.temperature_high_state_topic) { 2028 | payload.temperature_high_state_topic = stateTopic; 2029 | } 2030 | 2031 | if (payload.speed_state_topic) { 2032 | payload.speed_state_topic = stateTopic; 2033 | } 2034 | 2035 | if (payload.temperature_command_topic) { 2036 | payload.temperature_command_topic = `${stateTopic}/set/${payload.temperature_command_topic}`; 2037 | } 2038 | 2039 | if (payload.temperature_low_command_topic) { 2040 | payload.temperature_low_command_topic = `${stateTopic}/set/${payload.temperature_low_command_topic}`; 2041 | } 2042 | 2043 | if (payload.temperature_high_command_topic) { 2044 | payload.temperature_high_command_topic = `${stateTopic}/set/${payload.temperature_high_command_topic}`; 2045 | } 2046 | 2047 | if (payload.fan_mode_state_topic) { 2048 | payload.fan_mode_state_topic = stateTopic; 2049 | } 2050 | 2051 | if (payload.fan_mode_command_topic) { 2052 | payload.fan_mode_command_topic = `${stateTopic}/set/fan_mode`; 2053 | } 2054 | 2055 | if (payload.speed_command_topic) { 2056 | payload.speed_command_topic = `${stateTopic}/set/fan_mode`; 2057 | } 2058 | 2059 | if (payload.action_topic) { 2060 | payload.action_topic = stateTopic; 2061 | } 2062 | 2063 | // Override configuration with user settings. 2064 | if (deviceSettings.hasOwnProperty('homeassistant')) { 2065 | const add = (obj) => { 2066 | Object.keys(obj).forEach((key) => { 2067 | if (['number', 'string', 'boolean'].includes(typeof obj[key])) { 2068 | payload[key] = obj[key]; 2069 | } else if (obj[key] === null) { 2070 | delete payload[key]; 2071 | } else if (key === 'device' && typeof obj[key] === 'object') { 2072 | Object.keys(obj['device']).forEach((key) => { 2073 | payload['device'][key] = obj['device'][key]; 2074 | }); 2075 | } 2076 | }); 2077 | }; 2078 | 2079 | add(deviceSettings.homeassistant); 2080 | 2081 | if (deviceSettings.homeassistant.hasOwnProperty(config.object_id)) { 2082 | add(deviceSettings.homeassistant[config.object_id]); 2083 | } 2084 | } 2085 | 2086 | this.mqtt.publish(topic, JSON.stringify(payload), {retain: true, qos: 0}, this.discoveryTopic); 2087 | }); 2088 | 2089 | this.discovered[device.ieeeAddr] = true; 2090 | } 2091 | 2092 | onMQTTMessage(topic, message) { 2093 | if (topic !== this.statusTopic) { 2094 | return false; 2095 | } 2096 | 2097 | if (message.toLowerCase() === 'online') { 2098 | const timer = setTimeout(async () => { 2099 | // Publish all device states. 2100 | for (const device of this.zigbee.getClients()) { 2101 | if (this.state.exists(device.ieeeAddr)) { 2102 | this.publishEntityState(device.ieeeAddr, this.state.get(device.ieeeAddr)); 2103 | } 2104 | } 2105 | 2106 | clearTimeout(timer); 2107 | }, 30000); 2108 | } 2109 | } 2110 | 2111 | onZigbeeEvent(type, data, resolvedEntity) { 2112 | if (resolvedEntity && type !== 'deviceLeave' && this.mqtt.isConnected()) { 2113 | this.discover(resolvedEntity); 2114 | } 2115 | } 2116 | 2117 | getDevicePayload(resolvedEntity) { 2118 | return { 2119 | identifiers: [`zigbee2mqtt_${resolvedEntity.settings.ID}`], 2120 | name: resolvedEntity.settings.friendlyName, 2121 | sw_version: `Zigbee2mqtt ${zigbee2mqttVersion}`, 2122 | model: `${resolvedEntity.definition.description} (${resolvedEntity.definition.model})`, 2123 | manufacturer: resolvedEntity.definition.vendor, 2124 | }; 2125 | } 2126 | 2127 | getDiscoveryTopic(config, device) { 2128 | return `${config.type}/${device.ieeeAddr}/${config.object_id}/config`; 2129 | } 2130 | 2131 | // Only for homeassistant.test.js 2132 | _getMapping() { 2133 | return mapping; 2134 | } 2135 | } 2136 | 2137 | module.exports = HomeAssistant; 2138 | --------------------------------------------------------------------------------