树莓派安装开源智能家居系统 Domoticz

前言

最近闲来无事开始折腾自己的智能家居系统,对比了几种比较流行的开源智能家居系统,觉得 Domoticz 更适合,Domoticz的官方中文文档,虽然不是很完善但还是可以参考一下。需要注意的是下文用了 mosquitto 对接到 Domoticz 。

安装

树莓派使用 raspbian 系统,安装 Domoticz 只需一条命令

sudo curl -L install.domoticz.cn | bash

安装过程配置启用的服务(这里只启用 HTTP),端口和安装目录,安装完成后会自动添加 Domoticz 到开机启动

只开启 HTTP

HTTP 端口

安装路径

安装 mosquitto

sudo apt-get install mosquitto

添加用户名和密码验证的步骤,首先创建一个文件 user,添加内容,冒号前后分别为用户名和密码

admin:admin

然后加密这个文件并移动到 mosquitto 目录

mosquitto_passwd -U user
mv user /etc/mosquitto/

修改 /etc/mosquitto/mosquitto.conf,在结尾添加内容后重启 mosquitto

allow_anonymous false
password_file /etc/mosquitto/user

配置

在浏览器打开树莓派 IP:8080,将界面设置为中文,需要填入经纬度,不然会报错

初始配置

对接到本机的 MQTT 服务器 mosquitto
在设置 → 硬件中添加一项 MQTT Client Gateway with LAN Interface

最后

下篇文章将介绍添加设备的操作流程

原文地址:https://www.cnblogs.com/HintLee/p/9502259.html