{"action":"created","issue":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2402","repository_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota","labels_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2402/labels{/name}","comments_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2402/comments","events_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2402/events","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/2402","id":312433538,"number":2402,"title":"Add KNX Protocol support","user":{"login":"ascillato","id":35405447,"avatar_url":"https://avatars1.githubusercontent.com/u/35405447?v=4","gravatar_id":"","url":"https://api.github.com/users/ascillato","html_url":"https://github.com/ascillato","followers_url":"https://api.github.com/users/ascillato/followers","following_url":"https://api.github.com/users/ascillato/following{/other_user}","gists_url":"https://api.github.com/users/ascillato/gists{/gist_id}","starred_url":"https://api.github.com/users/ascillato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ascillato/subscriptions","organizations_url":"https://api.github.com/users/ascillato/orgs","repos_url":"https://api.github.com/users/ascillato/repos","events_url":"https://api.github.com/users/ascillato/events{/privacy}","received_events_url":"https://api.github.com/users/ascillato/received_events","type":"User","site_admin":false},"labels":[{"id":527619884,"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-04-09T08:09:25Z","updated_at":"2018-04-15T16:44:13Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/pulls/2402","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/2402","diff_url":"https://github.com/arendst/Sonoff-Tasmota/pull/2402.diff","patch_url":"https://github.com/arendst/Sonoff-Tasmota/pull/2402.patch"},"body":"# Sonoff-Tasmota KNX\r\n\r\n[Sonoff-Tasmota_KNX](https://github.com/ascillato/Sonoff-Tasmota_KNX) is a modification for [Sonoff-Tasmota](https://github.com/arendst/Sonoff-Tasmota) to add a basic functionality of the [KNX IP Protocol](https://www.knx.org/knx-en/index.php).\r\n\r\n## KNX Explanation ##\r\n\r\n[<img src=\"https://www.knx.org/wGlobal/wGlobal/layout/images/knx-logo.png\" />](https://www.knx.org/knx-en/knx/association/what-is-knx/index.php)\r\n\r\nThe [KNX IP Protocol](https://www.knx.org/knx-en/knx/association/what-is-knx/index.php) is an _international open standard_ for smart homes and smart buildings automation. It is a decentralized system. Each device can talk directly to each other without the need of a central controller or server. Any panel or server is just for telesupervision and for sending requests. KNX IP Protocol uses a UDP multicast on _224.0.23.12 : 3671_, so there is no need for a KNX Router unless you want to communicate to KNX Devices that are not in the WIFI Network (Twisted Pair, RF, Powerline).\r\n\r\nEach device has a physical address (like a fixed IP) as **1 . 1 . 0** and that address is used for configuration purposes.\r\n\r\nEach device can be configured with group addresses as **2 / 2 / 1** and that address can be used for sending/receiving commands. So, for example, if 2 devices that are configured with the **2 / 2 / 1** for turning on/off their outputs, and other device send _Turn ON_ command to **2 / 2 / 1**, both devices will turn on their outputs.\r\n\r\n## Integration ##\r\n\r\nSeveral home automation systems have KNX support. For example, [Home Assistant](https://github.com/home-assistant/home-assistant) has a [XKNX Python Library](https://github.com/XKNX/xknx) to connect to KNX devices using a KNX Router. If you don't have a **KNX Router**, you can use a **Software KNX Router** like [KNXd](https://github.com/knxd/knxd) on the same Raspberry Pi than Home Assistant. KNXd is used by Home Assistant for reading this UDP Multicast, although KNXd has other cool features that need extra hardware like connect to KNX devices by Twister Pair, Power Line or RF.\r\n\r\nIf you use the ETS (KNX Configurator Software) you can add any Sonoff Tasmota KNX as a dummy device.\r\n\r\n## Requirements ##\r\n\r\n* [ESP KNX IP Library (async-udp branch)](https://github.com/envy/esp-knx-ip/tree/async-udp)\r\n* [ESPAsyncUDP Library](https://github.com/me-no-dev/ESPAsyncUDP). This Library is used by ESP KNX IP Library. \r\n\r\nA copy of both libraries is available at:\r\n* https://github.com/ascillato/Sonoff-Tasmota_KNX/tree/development/lib/esp-knx-ip-async-udp\r\n* https://github.com/ascillato/Sonoff-Tasmota_KNX/tree/development/lib/ESPAsyncUDP-master\r\n\r\n## Usage Examples ##\r\n\r\nThere are multiple possible configurations. Here are explained just a few as example. The options for selecting relays, buttons, sensors, etc. are only available if were configured on _Configure Module Menu_.\r\n\r\nTo configure KNX, enter on the Configuration Menu of Sonoff-Tasmota and select Configure KNX.\r\n\r\n![config_menu](https://user-images.githubusercontent.com/35405447/38486490-a141a008-3bb3-11e8-9716-d8e338fb6f09.jpg)\r\n\r\n![knx_menu](https://user-images.githubusercontent.com/35405447/38486505-acbe3c3e-3bb3-11e8-88e6-43414d090489.jpg)\r\n\r\n**1) Setting Several Sonoff to be controlled as one by a Home Automation System:**\r\n\r\nWe can set one of the group address to be the same in all the devices so as to turn them on or off at the same time.\r\nIn this case, so as to inform the status of all the relays to the Automation System, just one of the devices have to be configured as the responder. If you use the same Group Address for sending and receiving, you have to take into account not to make loops.\r\n\r\nDEVICE 1\r\n\r\n![1](https://user-images.githubusercontent.com/35405447/38486549-c2a53c78-3bb3-11e8-9145-6e5a30323aab.jpg)\r\n\r\nDEVICE 2\r\n\r\n![2](https://user-images.githubusercontent.com/35405447/38486577-d6db4778-3bb3-11e8-9a46-96e7d6ef9132.jpg)\r\n\r\n**2) Setting 2 Sonoff to be linked as stair lights:**\r\n\r\nWe can set one device to send the status of its output and another to read that and follow. And the second device can send the status of its button and the first device will toggle. With this configuration we can avoid to make a loop.\r\n\r\nDEVICE 1\r\n\r\n![3](https://user-images.githubusercontent.com/35405447/38486596-e6c9fb2a-3bb3-11e8-8688-3cb29ac20207.jpg)\r\n\r\nDEVICE 2\r\n\r\n![4](https://user-images.githubusercontent.com/35405447/38486628-f5959024-3bb3-11e8-9007-4f3bb781f19e.jpg)\r\n\r\n**3) Setting a button as initiator of a scene:**\r\n\r\nJust setting one device to send the push of a button, and the rest just use that value to turn them on. In this case, there is no toggle. Every time the button is pushed, the turn on command is sent.\r\n\r\nDEVICE 1\r\n\r\n![5](https://user-images.githubusercontent.com/35405447/38486640-ff374f8c-3bb3-11e8-89f2-2834ae7b5118.jpg)\r\n\r\nDEVICE 2\r\n\r\n![6](https://user-images.githubusercontent.com/35405447/38486661-0aeb9dd8-3bb4-11e8-8ca1-e2d085096c3b.jpg)\r\n\r\n**4) Setting a Temperature sensor:**\r\n\r\nWe can configure to send the value of temperature or humidity every teleperiod. This teleperiod can be configured. See Sonoff Tasmota [wiki](https://github.com/arendst/Sonoff-Tasmota/wiki/Commands). It is recommended also to set the reply temperature address.\r\n\r\n![7](https://user-images.githubusercontent.com/35405447/38486676-11ec9fb0-3bb4-11e8-9096-7a6c29504eab.jpg)\r\n\r\n## Development Road Map ##\r\n\r\n**For Sonoff-Tasmota_KNX:**\r\n- [x] Add Web Menu\r\n- [x] Add Feature to Receive telegrams and modify Relay Status\r\n- [x] Add Feature to Receive telegrams from multiple Group Addresses to modify just one relay status (useful for scenes)\r\n- [x] Add Feature to Send telegrams of relay status change\r\n- [x] Add Feature to Send telegrams of one relay status to multiple Group Addresses (useful for scenes)\r\n- [x] Add Feature to Send telegrams of button pressed\r\n- [x] Add Feature to receive telegrams to toggle relay status\r\n- [x] Add Feature to read Temperature, Humidity from Tasmota\r\n- [x] Add Feature to send Temperature, Humidity by a set interval (tasmota teleperiod)\r\n- [x] Add Feature to receive command to read temperature, Humidity\r\n- [x] Add Feature to recognize Tasmota config to show the same number of relays, buttons, etc.\r\n- [x] Add Feature to Save Config\r\n- [x] Add Feature to Load Config\r\n- [x] Add Log Info\r\n- [x] Complete all the language files with keys\r\n\r\n## Modifications to Sonoff-Tasmota ##\r\n\r\n* Adding the file _/sonoff/xdrv_10_KNX.ino_ \r\n* Add the entry `#define USE_KNX` on _/sonoff/user_config.h_\r\n* Add entries to the file _/sonoff/webserver.ino_\r\n* Add entries to the file _/sonoff/sonoff.ino_\r\n* Add entries to the file _/sonoff/sonoff.h_\r\n* Add entries to the file _/sonoff/settings.h_\r\n* Add entries to sensor files\r\n* Add entries to language files\r\n\r\nUp to now, enabling KNX uses +23k of code and +3k3 of memory.\r\n\r\nThere is **NO CONFLICT** with MQTT, Home Assistant, Web, etc. Tests show fast response of all features running at same time.\r\n\r\n## Contributors ##\r\n\r\n* Adrian Scillato @ascillato\r\n* Sisamiwe @sisamiwe - Thanks for the guide on using KNX.\r\n* Nico Weichbrodt @envy - Thanks for the patience and help with the modifications to ESP_KNX_IP."},"comment":{"url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/comments/381420293","html_url":"https://github.com/arendst/Sonoff-Tasmota/pull/2402#issuecomment-381420293","issue_url":"https://api.github.com/repos/arendst/Sonoff-Tasmota/issues/2402","id":381420293,"user":{"login":"arendst","id":11044339,"avatar_url":"https://avatars3.githubusercontent.com/u/11044339?v=4","gravatar_id":"","url":"https://api.github.com/users/arendst","html_url":"https://github.com/arendst","followers_url":"https://api.github.com/users/arendst/followers","following_url":"https://api.github.com/users/arendst/following{/other_user}","gists_url":"https://api.github.com/users/arendst/gists{/gist_id}","starred_url":"https://api.github.com/users/arendst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arendst/subscriptions","organizations_url":"https://api.github.com/users/arendst/orgs","repos_url":"https://api.github.com/users/arendst/repos","events_url":"https://api.github.com/users/arendst/events{/privacy}","received_events_url":"https://api.github.com/users/arendst/received_events","type":"User","site_admin":false},"created_at":"2018-04-15T16:44:13Z","updated_at":"2018-04-15T16:44:13Z","author_association":"OWNER","body":"Found the Xdrv10 error (obvious) but I guess the callback KNX_CB_Action has to be defined somewhere else..."}}
{"actor":{"display_login":"arendst"}}