HA自动发现mqtt设备(开关篇)switches
确认homeassistant已经配置自动发现后,编写python代码运行即可:
Switches开关如下:
homeasstant官网说明:https://www.home-assistant.io/docs/mqtt/discovery/
视频过程:


python代码:
运行后,可在homeassistant的mqtt实体注册或者开发者工具选项里面发现设备。
单独发送测试命令:
添加是提到首页概览中:

测试成功
确认homeassistant已经配置自动发现后,编写python代码运行即可:
Switches开关如下:
homeasstant官网说明:https://www.home-assistant.io/docs/mqtt/discovery/
视频过程:
python代码:
运行后,可在homeassistant的mqtt实体注册或者开发者工具选项里面发现设备。
单独发送测试命令:
添加是提到首页概览中:
测试成功