openhab 配置说明

本文详细介绍了openHAB的配置过程,包括openhab.cfg文件中设置KNX绑定,yourname.items文件中定义物品和组,以及yourname.sitemap文件中设计用户界面。通过示例展示了如何配置GROUP、ITEMS以及SMARTMAP,最后说明了如何启动服务器并进行测试。

The openhab.cfg file

在文件中找到 knx binding 节,配置knx 通讯  如下:
################################ KNX Binding ##########################################
# KNX gateway IP address (optional, if serialPort or connection type 'ROUTER' is specified)
knx:ip=192.168.131.223


# KNX IP connection type. Could be either TUNNEL or ROUTER (optional, defaults to TUNNEL)
knx:type=TUNNEL


# KNX gateway port (optional, defaults to 3671)
knx:port=3671
  • The easiest way of configuring a KNX binding is by connecting in ROUTER mode. To do so, enable this: knx:type=ROUTER . If you cannot use the ROUTER mode, set it to TUNNEL, but you must then configure the IP: knx:ip=<IP of the KNX-IP module>

The yourname.items file

配置工程中条目清单,格式如下:
itemtype itemname ["labeltext"] [<iconname>] [(group1, group2, ...)] {knx=""}
类型,名称,显示文字,图标,分组,组地址
目前支持的itemType有,
1.Color  可用于LED 灯光 
2.Contact  用于门,窗等的传感器返回 open ,close
3.DateTime
4.Dimmer 用于调光开关switch (ON/OFF),接受一个百分比的值
5.Number 用于decimal 值类型的传感器象温度,亮度
6.Rollershutter
7.String
8.Switch  ON,OFF 普通开关

The next thing we must do is to tell openHAB which items we have. To do so, go to the "configurations/items" directory and create a new file called thenameyouwish.items. You have a demo.items sample file to see which is the syntax of this file.

In this file we define groups

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值