https://www.home-assistant.io/blog/2015/10/11/measure-temperature-with-esp8266-and-report-to-mqtt/
最后一步是将传感器值集成到Home Assistant中。这可以通过设置Home Assistant以连接到MQTT代理并订阅传感器主题来完成。
mqtt: broker: YOUR_MQTT_SERVER_HOST username: your_username password: your_password sensor: platform: mqtt name: "Temperature" state_topic: "sensor/temperature" qos: 0 unit_of_measurement: "ºC" sensor 2: platform: mqtt name: "Humidity" state_topic: "sensor/humidity" qos: 0 unit_of_measurement: "%"