执行下面命令:

#/bin/bash
cd $HOME/.homeassistant
wget https://raw.githubusercontent.com/5high/hass-configurator/master/configurator.py
sudo chmod 755 configurator.py
cur_dir=$(cd "$(dirname "$0")"; pwd)
sudo sh -c "echo '[Unit]
Description=HA Yaml Server
After=syslog.target network-online.target

[Service]
Type=simple
User=root
ExecStart=$cur_dir/configurator.py $cur_dir/settings.conf
Restart=always

[Install]
WantedBy=multi-user.target' > /etc/systemd/system/hayaml.service"
sudo systemctl enable hayaml
cd $HOME/.homeassistant
wget https://raw.githubusercontent.com/5high/hass-configurator/master/settings.conf
sudo systemctl start hayaml
sudo systemctl start hayaml

修改为自己的Home Assistant的IP地址添加下面内容到Home Assistant 的配置文件:

panel_iframe:
  configurator:
    title: Configurator
    icon: mdi:wrench
    url: http://123.123.132.132:3218

Home Assistant中有个配置文件名字是settings.conf,这个文件是configurator的配置文件,大家可以自行修改默认路径,或者支持ssl等等。

下面为高级用户参数解释:

{
    "LISTENIP": "0.0.0.0",  #监听地址
    "PORT": 3218, #监听端口
    "GIT": false, 
    "BASEPATH": "/root/.homeassistant", #软件打开默认目录
    "ENFORCE_BASEPATH": false,
    "SSL_CERTIFICATE": "/data/*.xxx.com.cer",  #cert证书文件存放位置
    "SSL_KEY": "/data/*.xxx.com.key",  #key证书文件存放位置
    "SSL": true, #是否启用https
    "IGNORE_SSL": false,
    "HASS_API": "http://127.0.0.1:8123/api/", #Home Assistant API通信地址
    "HASS_WS_API": "admin",  #API 用户名
    "HASS_API_PASSWORD": "itcommander",  #API 密码
    "USERNAME": "admin",  #访问configurator的用户名
    "PASSWORD": "itcommander",   #访问configurator的密码
    "ALLOWED_NETWORKS": [],  #地址白名单  
    "ALLOWED_DOMAINS": [],   #域名白名单
    "BANNED_IPS": [],  #黑名单地址
    "BANLIMIT": 0,
    "IGNORE_PATTERN": [],
    "DIRSFIRST": false,
    "SESAME": null,
    "SESAME_TOTP_SECRET": null,
    "VERIFY_HOSTNAME": null,
    "ENV_PREFIX": "HC_",
    "NOTIFY_SERVICE": "persistent_notification.create"
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据