diff --git a/knxd/CHANGELOG.md b/knxd/CHANGELOG.md new file mode 100644 index 0000000..64969a8 --- /dev/null +++ b/knxd/CHANGELOG.md @@ -0,0 +1,75 @@ +# Changelog + +## 0.5.2 + +- updated the definition of the default value for the "device" config option so that the visual editor will also render this option as optional. +- bumped KNXD to version 0.14.66 + +## 0.5.1 + +- added support for the `ipt` interface + +## 0.5.0 + +- bumped docker base image to 3.20 +- adjusted architecture to work with new s6overlay +- updated KNXD to version 0.14.63 which should fix some issues with programming devices using ETS6 + +## 0.4.7 + +- bumped docker base image to 3.16 again + +## 0.4.6 + +- downgraded docker base image to 3.14 until issues are resolved + +## 0.4.5 + +- updated KNXD to version 0.14.56 +- updated docker base image to Alpine 3.16 + +## 0.4.4 + +- added new experimental interfaces for `tpuart-ip` and `ncn5120-ip` + +## 0.4.3 + +- update addon based on home assistant template structure +- removed "hassio_role": "admin" +- bumped KNXD to 0.14.53 +- bumped base images to 3.14 +- add validators for `address` and `client_address`: +- add english descriptions for all parameters + +## 0.4.2 + +- fixed line breaks not being preserved in the resulting config file when using a `custom_config` + +## 0.4.1 + +- correctly map USB hardware device paths to the expected integer values in knxd configuration + +## 0.4 + +- using new approach on how the KNXD config is generated +- added device selector to the add-on configuration options +- added possibility to configure the error log level to be able to debug issues more easily +- switched add-on base image back to Alpine 3.12 since the new 3.13 seems to have severe issues with USB interfaces + +## 0.3.7 + +- switched to new hass-io base containers based on GitHub Docker Repository +- removed run.sh and replaced it with according s6-overlay scripts + +## 0.3.6 + +- bumped knxd version to 0.14.39 which fixes some delays with pace filters + +## 0.3.5 + +- bumped knxd version to 0.14.37 which fixes a memory leak in the FT12 driver +- add-on now uses the hosts network which enables multicast support. Thanks to stemnic for noticing the issue and fixing it. + +## 0.3.4 + +- bumped knxd version to 0.14.34 diff --git a/knxd/DOCS.md b/knxd/DOCS.md new file mode 100644 index 0000000..445c9f2 --- /dev/null +++ b/knxd/DOCS.md @@ -0,0 +1,75 @@ +# KNXD daemon + +## 安装 + +按照以下步骤在您的系统上安装插件: + + 1. 在您的家庭助理前端导航到**主管**->**插件商店**。 + + 1. 如果您还没有将此附加存储库添加到您的主管,请单击右上角的菜单图标,选择**存储库**,添加`https://github.com/da-anda/hass-io-addons` 作为新存储库,然后再次关闭对话框。 + + 1. 找到“KNXD”插件并单击它。 + + 1. 点击“安装”按钮。 + +## 配置 + +附加组件配置: + +```yaml + "address": "0.0.1", + "client_address": "0.0.2:8", + "interface": "tpuart", + "device": "/dev/ttyACM0", + "usb_filters": "", + "custom_config": "" +``` + +### 选项: +这些选项的描述部分复制自“knxd”[文档][documentation](https://githubcom/knxd/knxd/blob/master/doc/inifile.rst)。 +您将在那里找到更多示例和详细信息。 + +#### 选项: `address` + +knxd deamon本身的KNX地址。例如,用于源自组缓存的请求。 + +#### 选项: `client_address` + +要分配给客户端连接的地址范围。请注意,长度参数表示要分配的地址数量。 + +例如: 1.2.3:5 (示例:1.2.3:5(这将地址1.2.3到1.2.7分配给knxd的客户端。)) + +#### 选项: `interface` + +驱动程序“knxd”应用作与KNX总线通信的接口。此插件的典型用例中最常见的是: + +- `tpuart` (用于基于UART的KNX接口,如Busware.de中的接口) +- `usb` (用于商用USB KNX接口) + +有关所有可能选项的完整列表,请参阅knxd文档的驱动程序部分。 + +#### 选项: `device` (某些接口可选) + +nux中适配器的物理设备地址。例子:: + +- **TPUART interface**: `/dev/ttyACM0` ### 物理设备地址 ; 实体装置位址 +- **USB interface**: 可以尝试将此留空,以便`knxd`自动检测您的设备。如果空白时不起作用,请尝试指定一个设备地址,如“/dev/ttyAMA0”。 + +请注意,这些地址仅为示例,可能因您的设备而异。要找出设备地址,您必须通过SSH连接到主机操作系统(**不是**主管!),并检查连接到那里的设备。 + +#### 选项: `usb_filters` (optional) + +使用USB接口时,您可以指定要使用的其他过滤器。请参阅[过滤器部分](https://github.com/knxd/knxd/blob/master/doc/inifile.rst#filters) 官方“knxd”文件。 + +#### 选项: `custom_config` (optional) + +允许您编写自己的自定义“knxd”ini配置,而不是使用此插件中准备好的模板,该模板使用了上述所有其他配置选项。 + +您的自定义配置将替换此插件提供的默认配置,因此上述所有其他配置选项都将被忽略。请参阅[knxd文档](https://github.com/knxd/knxd/blob/master/doc/inifile.rst)对于所有可能的配置选项。 + + +## 支持 + +如果您有任何问题,请随时加入HomeAssistant社区,并在[附加线程]中提问(https://community.home-assistant.io/t/knxd插件将knx usb接口转换为ha/38108/38可以使用的ip接口). + +如果你发现了一个bug,请随时在 [Github](https://github.com/da-anda/hass-io-addons/issues) \ No newline at end of file diff --git a/knxd/README.md b/knxd/README.md new file mode 100644 index 0000000..62f57a1 --- /dev/null +++ b/knxd/README.md @@ -0,0 +1,22 @@ +# 冬瓜甄选Addons: KNXD daemon + +![Supports aarch64 Architecture][aarch64-shield] +![Supports amd64 Architecture][amd64-shield] +![Supports armhf Architecture][armhf-shield] +![Supports armv7 Architecture][armv7-shield] +![Supports i386 Architecture][i386-shield] + +## 关于 + +`knxd`是一个linux工具,可以用作路由器/网关,与KNX总线上的设备进行通信。此插件提供knxd守护进程,您可以使用它从家庭安装中使用TPUART或USB总线适配器创建KNX/IP网关。因此,它基本上可以将UART/USB接口转换为KNX IP接口,然后您可以在HomeAssistant中使用这些接口,或者通过以太网上的ETS对KNX设备进行编程。有关更多详细信息,请参阅https://github.com/knxd/knxd. + + +[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg +[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg +[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg +[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg +[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg + +## 源 + +https://github.com/da-anda/hass-io-addons \ No newline at end of file diff --git a/knxd/apparmor.txt b/knxd/apparmor.txt new file mode 100644 index 0000000..e82e82e --- /dev/null +++ b/knxd/apparmor.txt @@ -0,0 +1,51 @@ +#include + +profile knxdaddon flags=(attach_disconnected,mediate_deleted) { + #include + + # Capabilities + file, + signal (send) set=(kill,term,int,hup,cont), + + # S6-Overlay + /init ix, + /bin/** ix, + /usr/bin/** ix, + /run/{s6,s6-rc*,service}/** ix, + /package/** ix, + /command/** ix, + /etc/services.d/** rwix, + /etc/cont-init.d/** rwix, + /etc/cont-finish.d/** rwix, + /run/{,**} rwk, + /dev/tty rw, + + # Bashio + /usr/lib/bashio/** ix, + /tmp/** rwk, + + # Access to options.json and other files within your addon + /data/** rw, + + # Start new profile for service + /usr/sbin/knxd cx -> knxd, + /usr/sbin/knxtool cx -> knxd, + + profile knxd flags=(attach_disconnected,mediate_deleted) { + #include + + # Receive signals from S6-Overlay + signal (receive) peer=*_example, + + # Access to options.json and other files within your addon + /data/** rw, + /etc/knxd.ini r, + + /usr/sbin/knxd r, + /usr/sbin/knxtool r, + /bin/bash rix, + /bin/echo ix, + /etc/passwd r, + /dev/tty rw, + } +} \ No newline at end of file diff --git a/knxd/config.yaml b/knxd/config.yaml new file mode 100644 index 0000000..ec76b11 --- /dev/null +++ b/knxd/config.yaml @@ -0,0 +1,45 @@ +# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config +name: KNXD daemon +version: "0.5.2" +slug: knxd +description: KNXD守护进程可用于通过TPUART或USB总线适配器创建KNX/IP网关 +url: https://github.com/da-anda/hass-io-addons/tree/main/knxd +arch: + - armhf + - armv7 + - aarch64 + - amd64 + - i386 +init: false +startup: services +host_network: true +privileged: + - SYS_MODULE + - SYS_RAWIO +options: + address: "0.0.1" + client_address: "0.0.2:8" + interface: usb + log_error_level: warning + usb_filters: single + dest_port: "99" +schema: + address: "match(^\\d+\\.\\d+.\\d+$)" + client_address: "match(^\\d+\\.\\d+.\\d+\\:\\d+$)" + interface: "list(tpuart|tpuart-ip|usb|ft12|ft12cemi|ncn5120|ncn5120-ip|ipt|dummy)" + device: "device?" + log_error_level: "list(warning|error|fatal|note|info|debug)" + usb_filters: "str?" + ip_address: "str?" + dest_port: "port?" + custom_config: "str?" +watchdog: "tcp://[HOST]:[PORT:6720]" +ports: + "6720/tcp": 6720 + "3671/udp": 3671 +ports_description: + "6720/tcp": "knx接口要求,能够通过ETS访问knx总线" + "3671/udp": "knx接口要求,能够通过ETS访问knx总线" +image: "r.hassbus.com/da-anda/hass-io-addons-{arch}-addon-knxd" +uart: true +usb: true diff --git a/knxd/icon.png b/knxd/icon.png new file mode 100644 index 0000000..792a4b0 Binary files /dev/null and b/knxd/icon.png differ diff --git a/knxd/logo.png b/knxd/logo.png new file mode 100644 index 0000000..792a4b0 Binary files /dev/null and b/knxd/logo.png differ diff --git a/knxd/translations/en.yaml b/knxd/translations/en.yaml new file mode 100644 index 0000000..0c3a4ca --- /dev/null +++ b/knxd/translations/en.yaml @@ -0,0 +1,38 @@ +configuration: + address: + name: Bus Address for KNXD + description: The KNX address for the knxd deamon itself. Used e.g. for requests originating at the group cache. + client_address: + name: Bus Address Pool for KNXD Clients + description: > + Address range to be distributed to client connections. Note that the length parameter indicates the number of addresses to be allocated. + Example: 1.2.3:5 (This assigns addresses 1.2.3 through 1.2.7 to knxd's clients.) + interface: + name: Interface Driver + description: > + The driver knxd should use as interface to talk to the KNX bus. The most common ones for the typical usecase of this add-on are: + tpuart (for UART based KNX interfaces, like the one from Busware.de) + usb (for commercial USB KNX interfaces) + ipt (for connecting to existing IP tunneling interface) + device: + name: Device to use for connection + description: > + The physical device address of your adapter in linux. + You can try leaving this blank in order for knxd to auto-detect your device. + usb_filters: + name: usb_filters + description: When using an USB interface, you can specify additional filters to use. See the filters[https://github.com/knxd/knxd/blob/master/doc/inifile.rst#filters] section of the official knxd documentation. + custom_config: + name: Complete custom config + description: > + Allows you to write your own, custom knxd ini configuration instead of using the prepared template from this add-on that makes use of all the other config options above. + Your custom configuration will replace the default configuration provided by this add-on and thus all the other config options above will be ignored. See the knxd documentation for all possible configuration options. + log_error_level: + name: KNXD Loglevel + description: Define the loglevel of knxd. + ip_address: + name: Interface IP-Address + description: IP address the IP based interface should use (only for tpuart-ip, ncn5120-ip and ipt) + dest_port: + name: Interface port + description: network port the IP based interface should use (only for tpuart-ip, ncn5120-ip and ipt) diff --git a/knxd/translations/zh-Hans.yaml b/knxd/translations/zh-Hans.yaml new file mode 100644 index 0000000..5960d28 --- /dev/null +++ b/knxd/translations/zh-Hans.yaml @@ -0,0 +1,39 @@ +--- +configuration: + address: + name: KNXD巴士地址 + description: knxd deamon本身的KNX地址。例如,用于源自组缓存的请求。 + client_address: + name: KNXD客户端总线地址池 + description: >- + 分配给客户端连接的地址范围。请注意,长度参数表示要分配的地址数量。 + 示例:1.2.3:5(这将地址1.2.3到1.2.7分配给knxd的客户端。) + interface: + name: 接口驱动程序 + description: >- + 驱动程序knxd应用作与KNX总线通信的接口。此插件的典型用例中最常见的是: + tpuart(用于基于UART的KNX接口,如Busware.de中的接口) + usb(用于商用usb KNX接口) + ipt(用于连接到现有的IP隧道接口) + device: + name: 用于连接的设备 + description: >- + linux中适配器的物理设备地址。 + 您可以尝试将此留空,以便knxd自动检测您的设备。 + usb_filters: + name: usb过滤器 + description: 使用USB接口时,您可以指定要使用的其他过滤器。查看过滤器[https://github.com/knxd/knxd/blob/master/doc/inifile.rst#filters]knxd官方文件的一部分。 + custom_config: + name: 完成自定义配置 + description: >- + 允许您编写自己的自定义knxd ini配置,而不是使用此插件中准备好的模板,该模板使用了上述所有其他配置选项。 + 您的自定义配置将替换此插件提供的默认配置,因此上述所有其他配置选项都将被忽略。有关所有可能的配置选项,请参阅knxd文档。 + log_error_level: + name: KNXD日志级别 + description: 定义knxd的日志级别。 + ip_address: + name: 接口IP地址 + description: 基于IP的接口应使用的IP地址(仅适用于tpuart IP、ncn5120 IP和ipt) + dest_port: + name: 接口端口 + description: 基于IP的接口应使用的网络端口(仅适用于tpuart IP、ncn5120 IP和ipt) \ No newline at end of file