Home Assistant doesn‘t receive status from mqtt thermometer

题意:Home Assistant 没有从 MQTT 温度计接收到状态。

问题背景:

I've created a thermometer sensor using an ESP8166 with MQTT to publish temperature updates. The JSON emitted is in the format:

我使用 ESP8266 创建了一个温度传感器,通过 MQTT 发布温度更新。发出的 JSON 格式为:

{
    "temperature": "53.4"
}

In Home Assistant, I created a sensor in configuration.yaml:

在 Home Assistant 中,我在 configuration.yaml 中创建了一个传感器:

sensor:
  - platform: mqtt
    name: Backyard Temperature
    unique_id: a1234
    state_topic: home/temperature
    value_template: '{
  
   
   { value_json.temperature }}'
    u

猜你喜欢

转载自blog.csdn.net/suiusoar/article/details/143482148