家庭助理,接收MQTT时出现问题
我想在我的家庭助理环境中加入一个移动气象站 在我的Synology NAS上,我运行以下脚本:家庭助理,接收MQTT时出现问题,mqtt,home-assistant,Mqtt,Home Assistant,我想在我的家庭助理环境中加入一个移动气象站 在我的Synology NAS上,我运行以下脚本: { "localIPv4Address": "192.168.0.xxx", "mqtt": "mqtt://192.168.0.xxx", "mqtt_home": "MobileAlerts/", "mqtt_username": "
{
"localIPv4Address": "192.168.0.xxx",
"mqtt": "mqtt://192.168.0.xxx",
"mqtt_home": "MobileAlerts/",
"mqtt_username": "mqtt_alert",
"mqtt_password": "MY_PASSWORT",
"logfile": "./MobileAlerts.log",
"logGatewayInfo": false,
"proxyServerPort": 8080,
"mobileAlertsCloudForward": false,
"serverPost": null,
"serverPostUser": null,
"serverPostPassword": null
}
在我的home assistant服务器(raspberry)上,我安装了具有以下配置的MQTT代理:
logins:
- username: mqtt_alert
password: MY_PASSWORT
anonymous: false
customize:
active: false
folder: MobileAlerts
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
现在,在我的NAS上,我看到服务正在运行:
### Local IP address for proxy: 192.168.0.172
(node:31664) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Mobile-Alert Gateway : 001d8c0dffb7
Name : MOBILEALERTS-Gateway
Use DHCP : true
DHCP IP : 192.168.0.xxx
Fixed IP : 192.168.1.xxx
DHCP Netmask : 255.255.255.0
Fixed DNS IP : 192.168.1.xxx
Fixed Gateway : 192.168.1.xxx
Use Proxy : true
Proxy Server Name : 192.168.0.xxx
Proxy Port : 8080
Data Server Name : www.data199.com
### MQTT server is connected
undefined MobileAlerts/035xxc2xxd54d/json {"temperature":[22.4,22.4],"humidity":[63,63],"id":"0x35c27xxxx3d74d","t":"2020-11-03T18:40:58.000Z","offline":false}
undefined MobileAlerts/031xxxcd672ed2/json {"temperature":[22.1,22.1],"humidity":[62,62],"id":"0331cxxxxed2","t":"2020-11-03T18:41:15.000Z","offline":false}
最后,我尝试了以下配置(configuration.yaml)
但是,传感器状态始终保持“未知”
有人知道我做错了什么吗
mqtt:
broker: 192.168.0.xxx
port: 1883
username: mqtt_alert
password: MY_PASSWORD
sensor:
- platform: mqtt
name: "aaa"
state_topic: "MobileAlerts/03xxxxxx6B08A6/json"
unit_of_measurement: '°C'
value_template: "{{value_json.temperature[0]}}"