家庭助理,接收MQTT时遇到问题

问题描述

我正试图将MobileAlerts气象站纳入我的家庭助手中。

在Synology NAS上,我正在运行以下脚本:

{
  "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

}

在家庭助理服务器(树莓派)上,我安装了具有以下配置的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]}}"

但是,传感器状态始终保持“未知”。

有人看到我做错了吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...